input
stringlengths
10
828
output
stringlengths
5
107
public void run while executing diagnostic image di next to purge if di null active false try sleep 500 catch interrupted exception e do nothing else active true long mem size di get current size if di get status image status fully loaded di purge from memory if di get status image status thumbnail done purging from cache di mem size if disk loader get bytes on disk disk cache size loaders active di purge from disk if di get status image status thumbnail done purging from disk di
the execution loop
public point2 d get point2 d point2 d src pt point2 d dst pt if dst pt null dst pt src pt else dst pt set location src pt return dst pt
always returns the source point
public void set scheduled boolean scheduled this scheduled scheduled
notifies the image that it has beens scheduled for loading
public long get last failed attempt return last failed attempt
gets the time of the last failed attempt to load this image
public void abort load abort true
aborts loading of this image
public long get load start time return load start time
gets the time at which the system most recently attempted to load
public long get load finish time return load finish time
gets the time at which the system most recently successfully
private boolean is only one file with suffix exist in dict dir final string suffix file info file new file info file name file info file path info file get parent file filename filter filter new filename filter public boolean accept file dir string name return name ends with suffix string result info file path list filter if result null result length 1 return true else return false
check if only one file with given suffix exists in the dict dir
private word data item get word data string word int start pos byte word datas byte array word data type type position pos after todo get word data from a byte array if type null type word data type value of char word datas byte array start pos start pos word data item item item word data item create word data item by type type start pos item fill data through byte array word datas byte array start pos pos after set pos start pos return item
get word data since a start position in a byte array
public string convert word data to html return word explanation
concreted convert word data to html implementation we should mark
public string to string return file forma error exception on file filename position pos
convert this exception to a readable string that contain filename and
private string get name of file with suffix in dict dir final string suffix string dict path new file info file name get parent return file utils get name of file with suffix in dir dict path suffix
get name of file with suffix in dict dir
public string to string string buffer sb new string buffer 20 sb append major version append append median version append append minor version return sb to string
convert version to string
public void set buffered image buffered image buffered image this buffered image buffered image
setter for property buffered image
private void fire query listener query started string text if listener list null return object listeners listener list get listener list for int i listeners length 2 i 0 i 2 if listeners i usyd comp5425 query query listener class usyd comp5425 query query listener listeners i 1 query started text
notifies all registered listeners about the event
private void fire query listener query finished string text if listener list null return object listeners listener list get listener list for int i listeners length 2 i 0 i 2 if listeners i usyd comp5425 query query listener class usyd comp5425 query query listener listeners i 1 query finished text
notifies all registered listeners about the event
private void fire query listener item found list query result result list if listener list null return object listeners listener list get listener list for int i listeners length 2 i 0 i 2 if listeners i usyd comp5425 query query listener class usyd comp5425 query query listener listeners i 1 item found result list
notifies all registered listeners about the event
public void paint shape graphics2 d g double percent boolean enabled shape s secondary shape if percent 0 0 s primary shape g set color enabled primary color secondary color else if enabled return s secondary shape g set color secondary color g fill s
paint a shape
public void mouse entered mouse event evt if evt get source instanceof abstract button abstract button button abstract button evt get source action action button get action if action null string message string action get value action long description set message message
takes the long description of the action based components
public void register listener menu element elements if handler null handler new mouse handler for int i 0 i elements length i if elements i instanceof jmenu item jmenu item elements i add mouse listener handler register listener elements i get sub elements
helper method to recursively register all menu elements with
public void register listener component components if handler null handler new mouse handler for int i 0 i components length i if components i instanceof abstract button abstract button components i add mouse listener handler
helper method to register all components with a mouse listener
public color get image foreground return this image foreground
getter for property image foreground
public void set image foreground color image foreground this image foreground image foreground
setter for property image foreground
public void set vector vector double vector this vector vector
setter for property vector
public double compare feature vector vector double v1 vector double v2 int size v1 size double first second total if size v2 size return 99999 9 total 0 for int i 0 i size i first v1 element at i second v2 element at i total first second first second return math sqrt total
compare two vectors of double value
public double factorial int n double result 1 double sum 1 0 if n 0 result 1 else for int i 0 i n i sum i return result
this method computes the factorial of the input value
public void test get all features id as previous test we add 1000 feature info to our database now we want to get all 1000 feature info s id system out println get all features id data tap instance data tap factory create data tap collection result instance get all features id for object obj result system out println obj the result must be 1000 otherwise something wrong if result size 1000 fail size not equals to 10000
test of get all features id method of class usyd
public void test get all features idby system out println get all features idby string feature name data tap instance data tap factory create data tap collection result instance get all features idby feature name this assert true result size 0 result instance get all features idby hello this assert true result size 1000
test of get all features idby method of class usyd
public void test get feature by system out println get feature by int id 0 string feature name data tap instance data tap factory create data tap feature info result instance get feature by id feature name this assert null result result instance get feature by 4 hello this assert not null result
test of get feature by method of class usyd
public void test get features by system out println get features by string image data tap instance data tap factory create data tap collection feature info exp result null collection feature info result instance get features by image this assert true result size 0 result instance get features by abc hdd sgsg jpg this assert true result size 1000
test of get features by method of class usyd
public void test remove system out println remove int id 10 data tap instance data tap factory create data tap boolean exp result true boolean result instance remove id assert equals exp result result feature info f instance get feature by id this assert null f collection integer rs instance get all features id for integer obj rs this assert true instance remove obj
test of remove method of class usyd
public branch group get branch group return scene bg
returns a copiled branchgroup if the class could be loaded correctliy
public void progress int i if i value value i progress bar set value i
increase the value of the progress bar
public void set ready b ok set enabled true b ok request focus
activate the ok button when loading is complete
public void action performed action event e if e get source equals b ok this dispose main class set visible true
listeners main methods perform an action when
public void init mise en place des layout manager this set visible false progress frame new progress frame this animator new animator this p controller set layout new grid layout 3 6 this get content pane set layout new border layout this get content pane add p controller border layout south init menu init sliders scene new scene builder this progress frame dispose progress frame can be closed progress frame set ready this get content pane add tool bar border layout north this set jmenu bar menu bar this set visible true
initialise the gui the panels and his contents
public void store first position start values foot main class s foot get value start values arm main class s arm get value start values arm2 main class s arm2 get value start values pivot main class s pivot get value start values pivot2 main class s pivot2 get value start values hand main class s hand get value system out println animator start values for int i 0 i nb pieces i system out print start values i
read the parts positions from sliders and store
public void store last position stop values foot main class s foot get value stop values arm main class s arm get value stop values arm2 main class s arm2 get value stop values pivot main class s pivot get value stop values pivot2 main class s pivot2 get value stop values hand main class s hand get value system out println animator stop values for int i 0 i nb pieces i system out print stop values i
same as store first position but for the 2nd position
public void clear positions for int i 0 i nb pieces i start values i 0 stop values i 0 restore the arm into initial position main class s foot set value 0 main class s arm set value 0 main class s arm2 set value 0 main class s pivot set value 0 main class s pivot2 set value 0 main class s hand set value 0
remove all the elements of positions array
public void action performed action event e if e get source equals b ok dispose
invoked when someone create an event perform an
public void animate try wait an half second thread sleep delay catch exception e system err println e get message set start position restore the starting position try wait an half second thread sleep delay catch exception e system err println e get message go to stop position go to last position
change the robot position to simulate an animation
public void action performed action event e object obj e get source if obj equals mi quit quit if obj equals mi about about if obj equals mi help help if obj equals b store store position if obj equals b clear remove position if obj equals b anim animate movement if obj equals mi light if jcheck box menu item obj get state scene active light else scene disactive light if obj equals mi wireframe if jcheck box menu item obj get state wireframe mode on else wireframe mode off
listener behavior if an event come this methods invoke
private void set start position main class s foot set value start values foot main class s arm set value start values arm main class s arm2 set value start values arm2 main class s pivot set value start values pivot main class s pivot2 set value start values pivot2 main class s hand set value start values hand
move the robot into first stored position start
private void go to stop position foot animate arm animate arm2 animate pivot animate pivot2 animate hand animate
animate the movements one piece at time
private void quit int answer joption pane show confirm dialog this are you sure do you want to quit if answer joption pane yes option system exit 0
display an exits confirmation dialog
private void help new help dialog new frame
display a new frame containig some help informations
private void store position if first set first set true animator store first position else b store set enabled false b anim set enabled true b clear set enabled true animator store last position
store the position of each part of the robot
private void remove position clear all positions b store set enabled true b clear set enabled false b anim set enabled false first set false animator clear positions
remove from memory the previously stored positions
private void animate movement animator animate
animate the movement from the first position to the
public document j tidy parse input stream source output stream destination throws java io ioexception properties config new properties config load get class get resource as stream com totsp conf jtidy properties tidy tidy new tidy tidy set configuration from props config tidy set quote ampersand true tidy set xml out true tidy set xhtml true return tidy parse dom source destination
parses a html document with j tidy and writes and xhtml document
public bean array list get chunk int chunk size int current chunk return new bean array list chunk size current chunk this
gets a chunk of this array list
public void set element at t obj int index t old null if this index property name null this changes null old this get index super set index obj if old null changes fire indexed property change this index property name index old obj
overrides the parent to support property change events
public number get mean of property string property name throws java lang illegal access exception java beans introspection exception java lang reflect invocation target exception double mean this get sum of property property name double value this size return new double mean
this method returns the average value of a numerical property
public int get median index string property name throws java lang illegal access exception java beans introspection exception java lang reflect invocation target exception bean array list bv new bean array list this size 0 this bv sort on property property name int ordered index bv size 2 object o bv get ordered index return this index of o
this method returns the index of the bean with the median value
public int get next chunk return this next chunk
returns 1 or the the index of the next chunk after the current
public int get number of chunks return this number of chunks
returns the number of chunks in the array list
public int get previous chunk return this previous chunk
returns 1 or the the index of the previous chunk before the
public void add int index t element t old null if this index property name null this changes null old this to typed array super add index element if old null changes fire property change this index property name old this to typed array
inserts the specified element at the specified position in this array list
public boolean add t o boolean ret value ret value super add o if this index property name null this changes null changes fire indexed property change this index property name this size 1 null o return ret value
appends the specified element to the end of this array list
public void set context desklet context context this context context
set the desklet context
public boolean add all collection extends t c boolean ret value t old null if this index property name null this changes null old this to typed array ret value super add all c if ret value old null changes fire property change this index property name old this to typed array return ret value
appends all of the elements in the specified collection to the end of
public boolean add all int index collection extends t c boolean ret value t old null if this index property name null this changes null old this to typed array ret value super add all index c if ret value old null changes fire property change this index property name old this to typed array return ret value
inserts all of the elements in the specified collection into this
public boolean remove object o boolean ret value t old null if this index property name null this changes null old this to typed array ret value super remove o if ret value old null changes fire property change this index property name old this to typed array return ret value
removes the first occurrence of the specified element in this array list
public t remove int index t ret value t old null if this index property name null this changes null old this to typed array ret value super remove index if ret value null old null changes fire property change this index property name old this to typed array return ret value
removes the element at the specified position in this array list
public void remove all elements t old null if this index property name null this changes null old this to typed array super clear if old null changes fire property change this index property name old this to typed array
removes all components from this array list and sets its size to zero
public boolean remove element object obj boolean ret value t old null if this index property name null this changes null old this to typed array ret value super remove obj if ret value old null changes fire property change this index property name old this to typed array return ret value
removes the first lowest indexed occurrence of the argument
public void remove element at int index t old null if this index property name null this changes null old this to typed array super remove index if old null changes fire property change this index property name old this to typed array
deletes the component at the specified index
public boolean retain all collection c boolean ret value t old null if this index property name null this changes null old this to typed array ret value super retain all c if ret value old null changes fire property change this index property name old this to typed array return ret value
retains only the elements in this array list that are contained in the
public t set int index t element t ret value ret value super set index element if this index property name null this changes null changes fire indexed property change this index property name index ret value element return ret value
replaces the element at the specified position in this array list with the
protected void remove range int from index int to index t old null if this index property name null this changes null old this to typed array super remove range from index to index if old null changes fire property change this index property name old this to typed array
removes from this list all of the elements whose index is between
public string get count return count
gets the the number of retrieved elements
public string get offset return offset
gets the value of the offset property
public string getfield1 return field1
gets the value of the field1 property
public void setfield1 string value this field1 value
sets the value of the field1 property
public alias create alias return new alias
create an instance of
public alias list create alias list return new alias list
create an instance of
public artist list create artist list return new artist list
create an instance of
public label create label return new label
create an instance of
public label list create label list return new label list
create an instance of
public string getfield2 return field2
gets the value of the field2 property
public metadata create metadata return new metadata
create an instance of
public void setfield2 string value this field2 value
sets the value of the field2 property
public puid list create puid list return new puid list
create an instance of
public rating create rating return new rating
create an instance of
public void set count string value this count value
sets the value of the field1 property
public relation create relation return new relation
create an instance of
public void set offset string value this offset value
sets the value of the field2 property
public relation list create relation list return new relation list
create an instance of
public release create release return new release
create an instance of
public artist list getfield3 if artist list null artist list new artist list return this artist list
gets the value of the field3 property
public release event list create release event list return new release event list
create an instance of
public release list create release list return new release list
create an instance of
public tag list create tag list return new tag list
create an instance of
public track create track return new track
create an instance of
public track list create track list return new track list
create an instance of
public user rating create user rating return new user rating
create an instance of
public user tag create user tag return new user tag
create an instance of
public user tag list create user tag list return new user tag list
create an instance of
public string getfield10 return field10
gets the value of the field10 property
public string getfield13 return field13
gets the value of the field13 property