input
stringlengths
10
828
output
stringlengths
5
107
public jcombo box get student combo box return get combo box at 1
returns the combobox of the student view
private double get average student datas data list object values data get list of values double average 0 0 double coeff sum 0 0 for int i 0 i values size 1 i if headers get i is formula object o values get i if o instanceof double average double o first line get i if o instanceof mark average mark o get value first line get i coeff sum first line get i if coeff sum 0 average coeff sum return average
gets the average of a student
public jcombo box get teacher combo box return get combo box at 2
returns the combobox of the teacher view
public jbutton get add formula button return add formula button
returns the add formula button
public jbutton get add subject component button return add subject component button
returns the add subject component button
public jbutton get copy button return copy button
returns the copy button
public jbutton get print button return print button
returns the print button
private int get index of column header string header name int index 1 for header head headers index if head get name compare to header name 0 return index return 1
returns the columns index of the string in parameters
public jbutton get see button return see button
returns the see button
public jbutton get redo button return redo button
returns the redo button
public jbutton get undo button return undo button
returns the undo button
public jtabbed pane get student tabbed pane return get tabbed pane at 1
returns the tabbed pane of the student view
private int get index of row header string header name int index 1 for student datas data datas index if data is formula if data get formula get formula name compare to header name 0 return index else if data get student to string compare to header name 0 return index return 1
returns the rows index of the string in parameters
private void init language open preferences preference string language preference get language container set lang language if equals ignore case language buffered reader reader try reader new buffered reader new file reader datas language language string line int i 1 while line reader read line null i if line compare to 0 string split line split this language put split 0 split 1 catch file not found exception e1 e1 print stack trace return catch ioexception e2 e2 print stack trace return
init the language with the one that specified in the preference file
public jtabbed pane get teacher tabbed pane return get tabbed pane at 2
returns the tabbed pane of the teacher view
private void create menu bar menu bar new symph menu bar container add the menu bar to the container container set menu bar menu bar
creates the menu bar of the window
public void add student iperson student if student null return create a new line with student values student datas data new student datas container get datas get subjects student add this line to the model datas add data one more line number of rows fire table rows inserted get row count 1 get row count 1 update undo redo enabled
add a new student to the model
private void create tool bar tool bar new symph tool bar container add the toolbar to the container container set tool bar tool bar if big icons tool bar set big icons menu bar set big icons true
creates the tool bar of the window
public jtable get student table at int index return get table at 1 index
returns the table at position index in the tabbed pane in the student
public void remove student iperson student if student null return for student datas data datas if the line is not a formula if data is formula if data get student equals student gets the index of the object in the list int index datas index of data remove the object from the list datas remove data number of rows fire table rows deleted index index 1 break update undo redo enabled
remove the line of the student in parameter
public jtable get student selected table return get student table at get student tabbed pane get selected index
returns the selected table in the tabbed pane in the student view
public void add subject isubject subject if subject null return int index headers size 1 headers add index new header subject double coeff double parse double float to string subject get coefficient first line add index coeff for student datas data datas data add value at index 0 0 number of columns fire table structure changed update undo redo enabled
add a subject column to the model
public jtable get teacher table at int index return get table at 2 index
returns the table at position index in the tabbed pane in the teacher
private void create popup menus student popup menu student popup new student popup menu container container set student popup student popup teacher popup menu teacher popup new teacher popup menu container container set teacher popup teacher popup jury popup menu jury popup new jury popup menu container container set jury popup jury popup
creates the popup menus
public jtable get teacher selected table return get teacher table at get teacher tabbed pane get selected index
returns the selected table in the tabbed pane in the teacher view
public void remove subject isubject subject if subject null return for header head headers if head is formula if head get name compare to subject get name 0 int index headers index of head headers remove head first line remove index for student datas data datas data remove at index number of columns fire table structure changed break update undo redo enabled
remove a subject column of the model
public void update subject isubject subject string name float coeff if subject null return get the index of the column int index get index of column header subject get name if index 1 set this column to the new name set column name index 1 name set the coefficient with the new one first line set index double parse double float to string coeff fire table structure changed update undo redo enabled
update the column name and the coefficient of a subject
private void create status bar status bar new symph status bar container set status bar status bar
creates the status bar
public chart panel get student chart panel at int index return get chart panel at 1 index
returns the chart panel at position index in the tabbed pane in the
public boolean is formula at column int column index if column index 0 column index get column count 1 return false return headers get column index 1 is formula
indicates if the column is a formula or not
public chart panel get teacher chart panel at int index return get chart panel at 2 index
returns the chart panel at position index in the tabbed pane in the
public boolean is formula at row int row index if row index 0 row index get row count return false return datas get row index 1 is formula
indicates if the row is a formula or not
public int get row count return number of rows
returns the number of rows in the model
public jtext area get student text area at int index return get text area at 1 index
returns the index th text area of the student view
public iformula get formula at column int column index if is formula at column column index return iformula headers get column index 1 get object return null
gets the formula at the specified column
public jtext area get teacher text area at int index return get text area at 2 index
returns the index th text area of the teacher view
public jcomponent get view jpanel panel new jpanel new border layout panel add close button border layout east jpanel panel2 new jpanel new border layout panel2 add panel border layout north panel2 add tabbed pane border layout center return panel2
returns the component that contains the admin view
public iformula get formula at row int row index if is formula at row row index return datas get row index 1 get formula return null
gets the formula at the specified row
public jtable get jury table jsplit pane split pane jsplit pane tabbed pane get component at 3 if split pane null return null jscroll pane scroll pane jscroll pane split pane get left component if scroll pane null return null jviewport view port scroll pane get viewport if view port null return null jtable table jtable view port get view return table
returns the table of the jury view
public void remove formula row at int row index iformula formula get formula at row row index if formula null remove row formula formula row index
removes a formula at the specified row
public subject component get subject component return subjec component
returns the subject component to add
public chart panel get jury chart panel jsplit pane split pane jsplit pane tabbed pane get component at 3 if split pane null return null jsplit pane split pane2 jsplit pane split pane get right component if split pane2 null return null chart panel chart panel chart panel split pane2 get top component return chart panel
returns the chart panel of the jury view
public string get password return password md5
returns the crypted password
public void set cancel button inactive cancel button set enabled false
sets the cancel button to be not active
public jtext area get jury text area jsplit pane split pane jsplit pane tabbed pane get component at 3 if split pane null return null jsplit pane split pane2 jsplit pane split pane get right component if split pane2 null return null jscroll pane scroll pane jscroll pane split pane2 get bottom component jtext area area jtext area scroll pane get viewport get view return area
returns the text area of the jury view
public data base settings get database settings return db settings
returns the settings of the data base
public void show if dialog null dialog set visible true
open the window
private int get index of row header string header name int index 1 for student datas data datas index if data get student to string compare to header name 0 return index return 1
returns the rows index of the string in parameters
public void close if dialog null dialog set visible false
close the window
public void remove student iperson student if student null return for student datas data datas if the line is not a formula if data is formula if data get student equals student gets the index of the object in the list int index datas index of data remove the object from the list datas remove data number of rows fire table rows deleted index index 1 break container update infos area update undo redo enabled
remove the line of the student in parameter
public float get coefficient return coefficient
returns the coefficient of this subject component
public void set coefficient float coefficient this coefficient coefficient
sets the coefficient of this subject component
public void set mark student student mark mark assert mark null student null marks put student mark
set a mark associated with a student
public mark get mark student student return marks get student
return the mark associated with a student null if not found
public mark get mark int student id collection student students marks key set for student s students if s get id student id return marks get s return null
return the mark associated with a student null if not found
public boolean has undo return undo list size 0
returns if an undo action exists
public void remove student student student marks remove student
remove a student from this subject component
private int compare to iperson person int cmp person get name compare to name if cmp 0 cmp person get first name compare to first name return cmp
compare 2 persons
public string to string return double to string value
returns a string representation of the mark
public void set view data type int type this type type
set the type of data
public boolean add subject component subject component subject component return components add subject component
add a subject component to the list
public boolean delete subject component string subject component name subject component component get subject component by name subject component name if component null return components remove component return false
delete a subject component found with its name
public boolean has redo return redo list size 0
returns if a redo action exists
public void remove student student student for subject component sc components sc remove student student
remove a student from all the subjects components of this subject
public void remove subject component subject component subject component components remove subject component
remove a subject component of this subject
public result set get students throws sqlexception string query select from db const str tb student return execute select query
return a set containing all the students
public double get average student student int index get index of row header student to string if index 1 return 0 return get average datas get index
gets the average of a student
public void set not editable table not editable true
sets that the table is not editable
public void reconnect throws sqlexception try thread sleep 500 catch interrupted exception e e print stack trace system err println data base easier reconnecting to url connection driver manager get connection url login password statement connection create statement
reconnect to the database
public result set get formulas throws sqlexception string builder sb new string builder sb append select from db const str tb formula string query sb to string system out println query return execute select query
return a result set filled with the formulas of the database
public boolean has elements to save return formulas to add size 0 formulas to remove size 0 formulas to update size 0 student comment size 0
indicates if the table have elements to save
public void show component component int x int y popup show component x y
pop a menu given de x and y positions
public void set all remove button active boolean b tool bar set remove button active b menu bar set remove button active b rss tree contextual menu set remove button active b
set all remove buttons active or not
public void init rule rule map parameters throws butcher exception this rule rule this parameters new hash map parameters is initialized true
initialize an item with its rule its name and parameters
public void add rules list rules throws butcher exception this rules rules
add a list of initialized rules to the current engine
public set get filter message parts todo get filter message parts voir si je l impl mente ou pas return null
an optinal method not implemented so by contract
public double filter message message throws butcher exception object threshold tmp object parameters get threshold if threshold tmp object null throw new butcher exception no threshold specified double double tmp new double string threshold tmp object return double tmp double value
simply returns its threshold
public string get name return string parameters get name
returns the name of the rule item
public void is saved remove all the elements in the undo and redo lists undo list clear redo list clear disabled the buttons and menu for undo and redo actions container get tool bar get undo button set enabled false container get tool bar get redo button set enabled false container get menu bar get undo item set enabled false container get menu bar get redo item set enabled false
say to the model that the user has saved the modified datas
public void set last requested time long last requested time this last requested time last requested time
sets the time of last dns retry
public record type get record type return record type
the type of the query
public record class get record class return record class
the class for this query
public e get k value e e reverse map get value if e null throw new illegal argument exception invalid enum value value return e
return the enum given an ordinal value
protected void put domain name io buffer byte buffer string domain name string labels domain name split for string label labels byte buffer put byte label length char characters label to char array for char character characters byte buffer put byte character byte buffer put byte 0x00
domain name is a domain name represented as a series of labels and
protected void set value list inet address addresses super set value addresses
set the dns value and mark the future as completed
private void try port table port table throws parser exception vector string anchors new vector string nevime kolik bude nazvu oddelenych carkami string ga do ga build name anchors add ga while accept comma dokud je dalsim symbolem carka if accept colon lexical symbol l ls if accept in out inout buffer accept linkage string values try values string direction direction to string l while anchors is empty port table add new port anchors remove 0 direction values 0 values 2
finds out if a port has been found
private string direction to string lexical symbol direction if direction lexical symbol in return in if direction lexical symbol out return out if direction lexical symbol inout return inout if direction lexical symbol buffer return buffer return linkage
converts lexical symbol in out inout or buffer to string
public boolean has succeeded return this success
indicates if the action has succeeded or not
public boolean is between key from key key to key boolean result if from key compare to to key 0 result this compare to from key 0 else if from key compare to to key 0 result this compare to from key 0 this compare to to key 0 else result this compare to from key 0 this compare to to key 0 if logger is debug enabled logger debug from key get value this value to key get value result return result
indicated if the current key is between two others
public big integer get value return this value
returns the value associated to this key
public int get number of peers managed return this remote peers size
returns the number of peers that the tracker manages
public boolean create logger info node this key has created a new network this predecessor null this successor this get stub return true
creates new chord network
public chord node get random peer if this remote peers size 0 return null return this remote peers get pro active random next int this remote peers size
returns a random peer from the local list
private void check peers tracker logger debug checking peers maintain as entry point list chord node failed peers new array list chord node for int i 0 i this remote peers size i try this remote peers get i is aware catch exception e failed peers add this remote peers get i for chord node peer failed peers this remote peers remove peer
checks if peers maintains as entry point are alive
public void add all entries t entries this entries put all entries get entries
add all the given entries
public finger get finger int index return this fingers index
returns the finger at the specified position
public chord node get node return this node
returns the peer to which this finger is associated
public boolean join chord node node this predecessor null this successor node find successor this key logger info node this key has joined the network from node node get key return true
joins a chord ring with a node in the chord ring
public void set node chord node node this node node
sets the peer to which this finger is associated
public big integer get start index return this start index
returns the identifier to which this finger is associated