input
stringlengths
10
828
output
stringlengths
5
107
protected void add class property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui expressions class feature get string ui property descriptor description ui expressions class feature ui expressions type eclipse jadex package literals expressions class true false false item property descriptor generic value image null null
this adds a property descriptor for the class feature
protected void add value property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui expressions value feature get string ui property descriptor description ui expressions value feature ui expressions type eclipse jadex package literals expressions value true false false item property descriptor generic value image null null
this adds a property descriptor for the value feature
protected void add type property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui goals type feature get string ui property descriptor description ui goals type feature ui goals type eclipse jadex package literals goals type true false false item property descriptor generic value image null null
this adds a property descriptor for the type feature
protected void add name property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui goals name feature get string ui property descriptor description ui goals name feature ui goals type eclipse jadex package literals goals name true false false item property descriptor generic value image null null
this adds a property descriptor for the name feature
protected void add type property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui events type feature get string ui property descriptor description ui events type feature ui events type eclipse jadex package literals events type true false false item property descriptor generic value image null null
this adds a property descriptor for the type feature
protected void add name property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui events name feature get string ui property descriptor description ui events name feature ui events type eclipse jadex package literals events name true false false item property descriptor generic value image null null
this adds a property descriptor for the name feature
protected void add name property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui agent name feature get string ui property descriptor description ui agent name feature ui agent type eclipse jadex package literals agent name true false false item property descriptor generic value image null null
this adds a property descriptor for the name feature
protected void add beliefs property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui agent beliefs feature get string ui property descriptor description ui agent beliefs feature ui agent type eclipse jadex package literals agent beliefs true false true null null null
this adds a property descriptor for the beliefs feature
protected void add name property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui plans name feature get string ui property descriptor description ui plans name feature ui plans type eclipse jadex package literals plans name true false false item property descriptor generic value image null null
this adds a property descriptor for the name feature
protected void add capabilities property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui agent capabilities feature get string ui property descriptor description ui agent capabilities feature ui agent type eclipse jadex package literals agent capabilities true false true null null null
this adds a property descriptor for the capabilities feature
protected void add configuratios property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui agent configuratios feature get string ui property descriptor description ui agent configuratios feature ui agent type eclipse jadex package literals agent configuratios true false true null null null
this adds a property descriptor for the configuratios feature
protected void add events property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui agent events feature get string ui property descriptor description ui agent events feature ui agent type eclipse jadex package literals agent events true false true null null null
this adds a property descriptor for the events feature
protected void add expressions property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui agent expressions feature get string ui property descriptor description ui agent expressions feature ui agent type eclipse jadex package literals agent expressions true false true null null null
this adds a property descriptor for the expressions feature
protected void add goals property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui agent goals feature get string ui property descriptor description ui agent goals feature ui agent type eclipse jadex package literals agent goals true false true null null null
this adds a property descriptor for the goals feature
protected void add imports property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui agent imports feature get string ui property descriptor description ui agent imports feature ui agent type eclipse jadex package literals agent imports true false true null null null
this adds a property descriptor for the imports feature
protected void add plans property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui agent plans feature get string ui property descriptor description ui agent plans feature ui agent type eclipse jadex package literals agent plans true false true null null null
this adds a property descriptor for the plans feature
public void create package contents if is created return is created true create classes and their features project eclass create eclass project create ereference project eclass project agents agent eclass create eclass agent create eattribute agent eclass agent name
creates the meta model objects for the package
protected void add properties property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui agent properties feature get string ui property descriptor description ui agent properties feature ui agent type eclipse jadex package literals agent properties true false true null null null
this adds a property descriptor for the properties feature
public adapter create beliefs adapter return null
creates a new adapter for an object of class
public adapter create capabilities adapter return null
creates a new adapter for an object of class
public adapter create configurations adapter return null
creates a new adapter for an object of class
public adapter create events adapter return null
creates a new adapter for an object of class
public adapter create expressions adapter return null
creates a new adapter for an object of class
public adapter create goals adapter return null
creates a new adapter for an object of class
public adapter create plans adapter return null
creates a new adapter for an object of class
public iproperty sheet page get property sheet page if property sheet page null property sheet page new extended property sheet page editing domain override public void set selection to viewer list selection eclipse jadex editor this set selection to viewer selection eclipse jadex editor this set focus override public void set action bars iaction bars action bars super set action bars action bars get action bar contributor share global actions this action bars property sheet page set property source provider new adapter factory content provider adapter factory return property sheet page
this accesses a cached version of the property sheet
public iproperty sheet page get property sheet page if property sheet page null property sheet page new extended property sheet page editing domain override public void set selection to viewer list selection jadex editor this set selection to viewer selection jadex editor this set focus override public void set action bars iaction bars action bars super set action bars action bars get action bar contributor share global actions this action bars property sheet page set property source provider new adapter factory content provider adapter factory return property sheet page
this accesses a cached version of the property sheet
public boolean supports type final class type return true
supports every type for now
public boolean has entity return this equals post this equals put
determines if the http method should have an entity body in the request
public boolean is status set return status 1
determines if the status has been set or not
public void set headers final header headers validate no null elements headers if this headers null throw new illegal state exception headers have already been set this headers headers
sets the headers to be sent back with the response
public void set status final int status validate is true status 0 if is status set throw new illegal state exception status has already been set this status status
sets the status to be sent back with the response
public boolean supports type final class type if this type null return this type equals type return true
equates to the set supported type via
public void add final k key final v value find any existing inner list list v inner list super get key create new inner list if one doesn t exist yet if inner list null inner list new array list v super put key inner list add to the inner list inner list add value
add a value to the current list of values for the supplied key
public v get first final k key get the inner list list v inner list super get key make sure an inner list exists at all if inner list null inner list is empty return null just return the first item in the list return inner list iterator next
a shortcut to get the first value of the supplied key
public boolean send message byte msg int length output stream out try out serial port get output stream for is need because null byte for int i 0 i length i out write msg i out flush return true catch ioexception e e print stack trace return false
this function will send a message to nxt comport
public boolean command reader string command string command parts command parts command split if command parts 0 equals cmd if command parts 1 equals tune return play tone short parse short command parts 2 short parse short command parts 3 return true else return false
this function will translate a string in a function
private void keep alive connection check if is conneted loop once through all ports for int i config nxtport range 0 i config nxtport range 1 i if connect com string value of i break schedule repeat function timer timer new timer timer schedule new timer task public void run keep alive connection config keep alive interval 1000
will keep connection open en reconnect if needed
public boolean is conneted try if communication interface null system out println not connected return false if keep alive return true system out println not connected return false catch exception e system out println not connected error return false
will check the connection status
public boolean stop program byte command new byte 2 command 0 byte nxtcommand type direct command nxtcommand type command 1 byte nxtdirect command stop program nxtdirect command if send command command 2 null return false return false
will stop any program running on nxt
public boolean get battery level byte command new byte 2 command 0 byte nxtcommand type direct command nxtcommand type command 1 byte nxtdirect command get battery level nxtdirect command byte result send command command 2 if result null return false read voltage input in m v convert to v battery voltage double unsigned byte to int result 3 unsigned byte to int result 4 256 1000 0 return false
get voltage of battery and save it to double nxt control
public boolean stop sound byte command new byte 2 command 0 byte nxtcommand type direct command nxtcommand type command 1 byte nxtdirect command stop sound nxtdirect command if send command command 2 null return false return true
this function will stop the sound play back
public boolean keep alive byte command new byte 2 command 0 byte nxtcommand type direct command nxtcommand type command 1 byte nxtdirect command keep alive nxtdirect command byte result send command command 2 if result null return false return true
this function will prevent from loosing the connection and turning off
public boolean run program string name int len name length if len 15 len 15 byte command new byte len 7 int i command 0 byte nxtcommand type direct command nxtcommand type command 1 byte nxtdirect command program nxtdirect command for i 0 i name length i 15 i command i 2 byte name char at i command i 2 byte command i 3 byte r command i 4 byte x command i 5 byte e command i 6 byte 0 if send command command len 7 null return false return false
this will run a nxt program
public boolean play sound string name int len name length if len 15 len 15 byte command new byte len 8 int i command 0 byte nxtcommand type direct command nxtcommand type command 1 byte nxtdirect command play sound nxtdirect command command 2 0 false for loop for i 0 i name length i 15 i command i 3 byte name char at i command i 3 byte command i 4 byte r command i 5 byte s command i 6 byte o command i 7 byte 0 if send command command len 8 null return false return false
this will play a nxt sound
public boolean move string motor todo let it work with input return move string2motor motor power 90
translate function degree fixed to 90
public boolean read message string message box number byte command new byte 5 command 0 nxtcommand type direct command nxtcommand type command 1 nxtdirect command read msg nxtdirect command command 2 byte byte parse byte message box number byte 9 command 3 byte byte parse byte message box number 1 command 4 1 remove execute command byte result send command command 5 if result null return false result 4 size string msg for int i 0 i result 4 1 i msg char result i 5 msg boxs byte parse byte message box number 1 msg return true
this function will read a message from nxt mailbox and remove it
public boolean move string motor string degrees return move string2motor motor power int long parse long degrees
translate function degree fixed to 90
public boolean reset motor string motor return reset motor string2motor motor
translate function will reset the motor position
public boolean reset motor motor motors byte command new byte 4 prepare command command 0 byte nxtcommand type direct command nxtcommand type command 1 byte nxtdirect command reset motor position nxtdirect command command 2 is set below command 3 0 for motor motor motors command 2 byte motor motor if motor null if send command command 4 null return false return true
this will reset motor position
public boolean motor off string motors return motor off string2motor motors
translate string to motor
public boolean set speed string motors string speed for motor motor string2motor motors if motor motor a power 0 byte parse byte speed if motor motor b power 1 byte parse byte speed if motor motor c power 2 byte parse byte speed if motor motor all power 0 byte parse byte speed return true
this function will set the motor speed br
public void finalize instance flag false finalize
set the instance flag back to false so that another instance of the
private void parse page load element root element list page load elements root element get children iterator i page load elements iterator while i has next element page load element element i next page load element vector add page load element parse page load
from the root element parse out all the page load tags
public vector get test scripts vector return test scripts vector
get the vector containing all the pageload tags
public vector get page load element vector return page load element vector
get the vector containing all the pageload tags
public int get repeat times return repeat times
get the number of times the testscript must be repeated
private void read properties string path to properties web walker properties web walker props web walker properties get instance path to properties test suite location web walker props get test suite location read properties
read the properties to configure the program from a properties file
public string get test suite location return test suite location
get contents of testsuite
private void parse sleep load type sleep sleep time integer parse int page element get attribute value time
pull out the sleep parameters
public boolean is htmlsave enabled return is htmlsave enabled
get contents htmlsave
private string get current date time format the current time simple date format formatter formatter new simple date format mm dd yyyy hh mm ss a zzz date current time 1 new date string date string formatter format current time 1 return date string
get the current date time in a nicely formatted way
private void parse load type load type page element get attribute value type if load type equals ignore case url parse url else if load type equals ignore case link parse link else if load type equals ignore case form parse form else if load type equals ignore case altimage parse alt image else log warn page instruction class cannot find the correct page loading type found load type instead parse load type
determine the type of pageload test this will be
public string get html save location return html save location
get contents of htmlsave
private void open url page instruction page inst try request new get method web request page inst get url response conversation get response request catch http not found exception httpe log warn action dispatch class httpe get message stat vault add page not returned page inst get url return catch ioexception ioe log warn action dispatch class io error trying to load url page inst get link ioe return catch saxexception saxe log warn action dispatch class sax error trying to load url page inst get link saxe return open url
open the url address
public void add correct string result correct pages vector add result add correct
add to the vector containing the correctly pages
public boolean is console html logging enabled return is console html logging enabled
get contents of console
private void parse url element url element page element get child url url url element get text log info page instruction class page load type url url parse url
get the url to load
public void add incorrect string result incorrect pages vector add result add incorrect
add to the vector containing the incorrect pages
public void add page not returned string result page not returned vector add result
add to the vector containing the failed pages http 404
private void parse link element link element page element get child link link link element get text log info page instruction class page load type link link parse link
get the link to click
public int get correct size return correct pages vector size
get the size of the vector of correctly loaded pages
private void click link page instruction page inst try web link link last visited page get link with page inst get link request link get request response conversation get response request catch ioexception ioe log warn action dispatch class io error trying to click link page inst get link ioe return catch saxexception saxe log warn action dispatch class sax error trying to click link page inst get link saxe return click link
click a link on the page
public int getincorrect size return incorrect pages vector size
get the size of the vector of incorrectly loaded pages
private void parse alt image element alt image element page element get child alttext alt image alt image element get text log info page instruction class page load type alt image alt image
click on image with alt text
public int get page not returned size return page not returned vector size
get the size of the vector of failed pages
private void parse form element form element page element get child form form num integer parse int form element get attribute value num form button form element get child form button get attribute value name list form field list form element get children field iterator i form field list iterator string field name string field value while i has next element field element element i next field name field element get attribute value fieldname field value field element get text form fields put field name field value log info page instruction class page load type form form button parse form
get the form and related elements
private void parse confirm text element confirm text element page element get child confirm text if confirm text element null confirm text else confirm text confirm text element get text parse confirm text
get the text to check for on the resulting page
private void click alt image page instruction page inst try web link link last visited page get link with image text page inst get alt image request link get request response conversation get response request catch ioexception ioe log warn action dispatch class io error trying to click link page inst get link ioe return catch saxexception saxe log warn action dispatch class sax error trying to click link page inst get link saxe return click alt image
click an image with alt text
private void log response log response web page log response
log the response with a generic filename
private void save string to file string string to write string file name try string save location web walker properties get instance get html save location file a file new file save location system get property file separator count pages file name html a file create new file file writer a writer new file writer a file a writer write string to write a writer close count pages catch exception e log warn action dispatch class exception action dispatch save string to file ensure the path to where the file is being saved exists e return save string to file
write the html response to a file
public index color model get colourmap int cache id throws rdesktop exception index color model map null if cache id colourcache length map colourcache cache id if map null return map throw new rdesktop exception could not get colourmap with cache id cache id
retrieve the indexed colour model from the specified cache
public cursor get cursor int cache idx throws rdesktop exception cursor cursor null if cache idx cursorcache length cursor cursorcache cache idx if cursor null return cursor throw new rdesktop exception cursor not found
retrieve a cursor object from the cache
public void put font glyph glyph throws rdesktop exception if glyph get font fontcache length glyph get character fontcache 0 length fontcache glyph get font glyph get character glyph else throw new rdesktop exception could not put font
add a font to the cache
public int get order type return this order type
get the id of the current order type
public void save state int id idx for id 0 id bitmapcache length id if pst cache is persistent id for idx 0 idx bitmapcache id length idx pst cache touch bitmap id idx bitmapcache id idx usage
update the persistent bitmap cache mru information on exit
public void set order type int order type this order type order type
set the id of the current order type
public bounds order get bounds return this bounds
retrieve the bounds order stored within this state
public glyph get font int font int character throws rdesktop exception if font fontcache length character fontcache 0 length glyph glyph fontcache font character if glyph null return glyph throw new rdesktop exception could not get font font character
retrieve a glyph for a specified character in a specified font
public dest blt order get dest blt return this destblt
retrieve the dest blt order stored within this state
public pat blt order get pat blt return this patblt
retrieve the pattern blit order stored within this state
public data blob get text int cache id throws rdesktop exception data blob entry null if cache id textcache length entry textcache cache id if entry null if entry get data null return entry throw new rdesktop exception could not get text cache id
retrieve text stored in the cache
public screen blt order get screen blt return this screenblt
retrieve the screen blit order stored within this state
public line order get line return this line
retrieve the line order stored within this state
public void put text int cache id data blob entry throws rdesktop exception if cache id textcache length textcache cache id entry else throw new rdesktop exception could not put text
store text in the cache
public rectangle order get rectangle return this rect
retrieve the rectangle order stored within this state
public desk save order get desk save return this desksave
retrieve the desktop save order stored within this state
public mem blt order get mem blt return this memblt
retrieve the memory blit order stored within this state
public tri blt order get tri blt return this triblt
retrieve the tri blit order stored within this state
public rdp packet localised init int length rdp packet localised data new rdp packet localised length 7 get memory length 7 data increment position 7 data set start data get position return data
initialise an iso pdu