input
stringlengths 10
828
| output
stringlengths 5
107
|
---|---|
public void remove variable string variable if registry key exists throw new unsupported operation exception if contains variable registry key delete value variable | remove specified variable |
public void install hook if callback null window msg callback new callback this window msg proc 4 new address window msg callback get address old address extension set window long shell handle win32 gwl wndproc new address callback new wndcallback shell old address new address public void dispose dispose callback wndcallback manager add callback shell callback shell add dispose listener new dispose listener public void widget disposed dispose event e un install hook | install the msg hook and start listening the window message |
public void un install hook if callback null wndcallback manager dispose callback shell callback | uninstall the msg hook and stop listening the window message |
public void add change listener cddrive change listener listener if listener null return if listeners null listeners new array list if listeners contains listener listeners add listener | adds the listener to the collection of listeners who will be notified |
public void remove change listener cddrive change listener listener if listener null return if listeners null listeners remove listener if listeners size 0 listeners null | removes the listener from the collection of listeners who will be |
public int get effective tldlength final string hostname final string normalized hostname normalize hostname hostname int last dot normalized hostname length for subdomain node node this root last dot 0 int next dot loc normalized hostname last index of last dot 1 node find node node normalized hostname substring next dot loc 1 last dot false if node null break last dot next dot loc if node is exception exception rules use one fewer levels than were matched break if node is stop ok break return last dot | finds the length in bytes of the effective tld for the given |
private string read string with prompt string prompt buffered reader in new buffered reader new input stream reader system in system out print prompt string text null try text in read line catch ioexception e e print stack trace try return text | this function simply shows a message on the console asking for a string |
public string ask for username string name this read string with prompt username return name ask for username | function for asking for a username by console |
public string ask for password string name this read string with prompt password return name ask for password | function for asking for a username by console |
public boolean validate string p password if password equals p password is validated true else is validated false return is validated | verifies the given password sets the sdbuser object in |
private void set date from int calendar t date calendar get instance t date set first day of week calendar monday t date clear t date set calendar year year t date set calendar week of year week our week goes from 1 monday to 7 sunday if day 7 t date set calendar day of week calendar sunday else t date set calendar day of week calendar monday day 1 date t date get time | convert a week and a day of week into a date |
public boolean get exceptional if schedule entry null return false return schedule entry get class get name sdb sdbschedule entry | true when the schedule entry is not a normal scheldue e |
public void get environment throws exception try javax naming context init ctx new javax naming initial context javax naming context env ctx javax naming context init ctx lookup java comp env max days integer env ctx lookup max days int value max hours integer env ctx lookup max hours int value file temp dir string env ctx lookup file temp dir file store dir string env ctx lookup file store dir use file boolean env ctx lookup use file boolean value catch naming exception e throw new sdbexception sdbexception error e get message | looks up the environment variables |
public void add file sdbfile file if files null init files files add file | add a file to the attached files |
public void write to print writer print writer writer throws exception open this file file input stream file new file input stream get absolute path write byte by byte int i file read while i 1 writer write i i file read | write the file to a print writer |
public sdbuser get replaced by teacher return replaced by teacher | pointer to the teacher who should take this lesson |
public void set replaced by teacher sdbuser value replaced by teacher value | pointer to the teacher who should take this lesson |
public int get week of year return week of year | week of the year |
public void set week of year int value week of year value | week of the year |
public void delete xql database connection db throws exception todo this is not failsafe if a delete file succeeds but the dateabase command fails an undefined object is left delete file db get broker delete this | deletes the file on the filesystem and the entry in the database |
public sdbuser get replaced for teacher return replaced for teacher | teacher who should be replaced |
public void set replaced for teacher sdbuser value replaced for teacher value | teacher who should be replaced |
private void update user values user set firstname string request get parameter firstname user set lastname string request get parameter lastname user set active year sdbyear sdbyear get by id dbconnector sdbyear class integer parse int get parameter value year | fetches all attributes from the form |
private void update file int p file id string p file name string p remark sdbfile t file sdbfile get file by id dbconnector p file id persistence broker t broker dbconnector get broker t file set name p file name t file set remark p remark t file touch modification date t broker store t file | update the file |
public string get parameter value string parameter return string request get parameter parameter | returns a parameter value as a string |
private int store file string p owner string p file name string p store string p remark sdbfile t file new sdbfile persistence broker t broker dbconnector get broker t file set owner p owner t file set name p file name t file set store p store t file set remark p remark t file init creation date t broker store t file system out println new file number t file get id return t file get id | store the file under the given filename and store |
private void save session t session set title string request get parameter title t session set the class string request get parameter class t session set unit string request get parameter unit system out println in savesession got t session get title t session set description string request get parameter description t session touch modification date int hours 0 try hours integer parse int string request get parameter duration catch exception e hours 0 t session set duration hours hours dbconnector get broker store t session | fetches all attributes from the form |
public void add config user config user user if surveyors contains user surveyors add user | registers a config user to the config admin |
public void reset config try reload configuration catch ioexception ie system err println could not reset config of this ie print stack trace | resets the configuration |
public void remove config user config user user surveyors remove user | unregisters a config user from the config admin |
public int reset config iterator it surveyors iterator object o while it has next o it next if o null config user o reset config return surveyors size | resets the configuration of all registered config users |
private void reload configuration throws ioexception file not found exception synchronized config file properties load new file input stream get config file | reloads the configuration from the configuration file |
public void run tidy parse get in get out | parses the input stream with jtidy and writes it to the output stream |
public input stream get in return this in | getter for property in |
public output stream get out return this out | getter for property out |
public void clean up config admin get instance remove config user this | used to remove this object from the config admins list of config users |
protected void set properties transformer trans hashtable h if h null return enumeration e h keys string key null while e has more elements key string e next element trans set parameter key h get key | sets the parameters of the given transformer using the values stored in |
public void reset config | resets the configuration |
public void set xml string xml this xml xml if xml null set source new stream source new string reader xml else set source null | convenience method for setting the action results xml data with an |
public action result perform java util hashtable parameters throws action exception int n config admin get instance reset config string reset config admin get instance get config user names string buffer sb new string buffer resetconfig number n n int l reset length for int i 0 i l i sb sb append configuser reset i configuser n sb sb append resetconfig java util hashtable h new java util hashtable return new action result sb to string h | performs the action |
public action result perform java util hashtable parameters throws action exception string xml info n pcs pcs pcs version pcs n os os os n java java java n hostname hostname hostname n info java util hashtable h new java util hashtable return new action result xml h | this action delievers as result information about the pcs framework |
public action result perform hashtable parameters throws action exception throw new action exception this is a test exception | throws an action exception |
public object get new object string key throws factory exception object o super get new object key if o instanceof xml producer throw new factory exception object connected to key key is not an xml producer check your configuration return o | factory method for creating objects |
protected string get action name return action name | returns the class name of the action connected |
public boolean use jtidy return controller get boolean jtidy false | determines whether or not to use jtidy to parse html output |
protected void set action name string action name this action name action name | sets the class name of the action of this service |
public action get action throws controller exception string clazz get action name if clazz null clazz length 0 throw new controller exception no valid action name configured action a null try a action class for name clazz new instance catch exception e throw new controller exception could not instantiate action return a | returns an instance of the action connected to this service |
public boolean accept config node node string name node get name return name equals root node | indicates wheter a given config node is accepted by this object |
public string get auth checker return this auth checker | getter for property auth checker |
public void init servlet config config throws servlet exception super init config try controller config new xml controller config get init parameter contoller xml config param catch controller exception e throw new servlet exception could not create controller config e view set use jtidy controller config use jtidy config admin get instance add config user this | initializes the servlet |
public void set auth checker string auth checker this auth checker auth checker | setter for property auth checker |
public boolean is dynamic view return this dynamic view | getter for property dynamic view |
public void set dynamic view boolean dynamic view this dynamic view dynamic view | setter for property dynamic view |
private service info lookup service string name try return controller config get service info name catch exception e return null | wrapps the get service info of controller config to return null when |
protected boolean check authorization http servlet request request return true | by this method the controller servlet checks if a given request is |
public string get servlet info return description | returns a short description of the servlet |
public void reset config try init catch exception e e print stack trace | resets the configuration by calling the servlets init method |
public void reinitialize engine filter stop filter epservice initialize | public instance methods |
public void set count hit string count hit system out println setcount hit count hit if count hit null count hit length 0 this count hit 0 else this count hit integer parse int count hit | keep track of number of times the drawer is counted |
public serial parameters this com1 9600 serial port flowcontrol none serial port flowcontrol none serial port databits 8 serial port stopbits 1 serial port parity none | hard code com1 |
public void set owner name string name this owner name name | sets owner name |
public void close connection debug enter close connection if port is alread closed just return if open return check to make sure s port has reference to avoid a npe if s port null try close the i o streams os close is close catch ioexception e system err println e close the port s port close remove the ownership listener port id remove port ownership listener this open false | close the port and clean up associated elements |
public void add primitive3 d object synchronized objects3 d objects3 d add object | adds the specified 3 d object to this panel to draw and support |
public void clear rotation matrix for int i 0 i 3 i for int j 0 j 3 j rotation matrix i j i j 1 0 | sets the rotation matrix of the camera to the identity matrix |
public void compose xrotation double x double cos t x math cos x double sin t x math sin x r 0 0 1 r 0 1 r 0 2 r 1 0 r 2 0 0 r 1 1 r 2 2 cos t x r 1 2 sin t x r 2 1 sin t x multiply matrices rotation matrix r rotation matrix | composes a rotation about the x axis with the current rotation matrix |
public void compose yrotation double y double cos t y math cos y double sin t y math sin y r 0 0 r 2 2 cos t y r 0 1 r 1 0 r 1 2 r 2 1 0 r 0 2 sin t y r 1 1 1 r 2 0 sin t y multiply matrices rotation matrix r rotation matrix | composes a rotation about the y axis with the current rotation matrix |
public void compose zrotation double z double cos t z math cos z double sin t z math sin z r 0 0 r 1 1 cos t z r 0 1 sin t z r 1 0 sin t z r 2 2 1 r 0 2 r 1 2 r 2 0 r 2 1 0 multiply matrices rotation matrix r rotation matrix | composes a rotation about the z axis with the current rotation matrix |
private void multiply matrices double a double b double result for int i 0 i 3 i for int j 0 j 3 j temp i j 0 for int x 0 x 3 x temp i j a i x b x j for int i 0 i 3 i for int j 0 j 3 j result i j temp i j | multiplies a xb and puts the result in the resulting matrix in result |
public boolean update increment the rotation if the mouse is not controlling it if mouse down set rotation camera theta camera theta increment camera phi camera phi increment project and sort objects repaint return receiving fast updates from animation clock is showing camera theta increment 0 camera phi increment 0 todo stop animation when invisible | called periodically by animation clock triggers redrawing and |
public double evaluate return value | returns the value of this constant |
public boolean contains variable string name return name equals this name | returns true if this variable has the specified name |
public boolean is constant return true | overrides the default to return true because the value of this constant |
public evaluation tree parse string expression reset the stack depth from potential previous evaluations parentheses stack depth 0 initialize the token scanner with the expression string scanner reset expression scan the first token token scanner scan parse the expression return expression min precedence 1 | parses the specified mathematical expression and returns the resulting |
public boolean contains variable string name return this name null false name equals this name | returns true if this variable has the specified name |
public boolean contains variable string name return false | returns true if this expression tree contains the specified variable |
public void reset string expression this expression expression to char array current position 0 | resets this token scanner to scan the specified string |
public void set binary operator binary operator binary operator if binary operator precedence max precedence max precedence binary operator precedence if binary operator precedence min precedence min precedence binary operator precedence binary operators put binary operator character binary operator | adds the specified binary operator to this parser |
public binary operator get binary operator char c return binary operators get c | gets the binary operator which has the specified character |
public binary operator remove binary operator char c return binary operators remove c | removes the binary operator which has the specified character from this |
public void clear binary operators binary operators clear max precedence integer min value min precedence integer max value | removes all binary operators from this parser |
public void set unary operator unary operator unary operator unary operators put unary operator name unary operator | adds the specified unary operator to this parser |
public unary operator remove unary operator string name return unary operators remove name | removes the specified unary operator from this parser |
public void set xmin double min x min min | sets the minimum x of the viewport in world coordinates |
public void clear unary operators unary operators clear | removes all binary operators from this parser |
public void set xmax double max x max max | sets the maximum x of the viewport in world coordinates |
public unary operator get unary operator string name return unary operators get name to lower case | gets the unary operator which has the specified name |
public variable get variable string name evaluation tree probably avariable but could be aconstant get variable or constant name if probably avariable but could be aconstant instanceof variable return variable probably avariable but could be aconstant else return null | gets the variable with the specified name |
public void set ymin double min y min min | sets the minimum y of the viewport in world coordinates |
public evaluation tree get variable or constant string name ignore case name name to lower case evaluation tree variable or constant variables get name if variable or constant null variables put name variable or constant new variable name return variable or constant | gets the variable or constant with the specified name |
public void set ymax double max y max max | sets the maximum y of the viewport in world coordinates |
public void add primitive2 d object objects add object | adds the specified object to this panel to draw and support interactions |
public void add constant string name double value variables put name new constant name value | adds a constant to this parser |
public double get xdistance in pixels double distance return distance width x max x min | transforms the specified distance in the x direction from world |
public double get ydistance in pixels double distance return distance height y max y min | transforms the specified distance in the y direction from world |
public double get xpixel coordinate double x return x x min x max x min width | transforms the specified x value from world coordinates to pixel |
public double get ypixel coordinate double y return 1 y y min y max y min height | transforms the specified y value from world coordinates to pixel |
public double get xworld coordinate double x return x width x max x min x min | transforms the specified x value from pixel coordinates to world |
public double get yworld coordinate double y return y min y height 1 y max y min | transforms the specified y value from pixel coordinates to world |
public void add mouse listener mouse listener mouse listener if mouse listeners null mouse listeners new linked list mouse listener mouse listeners add mouse listener | adds the specified mouse listener to this object |
public void set double x min double x max double y min double y max this x min x min this x max x max this y min y min this y max y max | sets the 2 d range in world coordinates of this viewport |
Subsets and Splits