input
stringlengths
10
828
output
stringlengths
5
107
public unique task id copy return new unique task id graph id task id
copy returns a new unique task id that is equal to this one
public relative node field copy return new relative node field bind arg offset arg field alias
copy creates a copy of the fields instance variables in a new object
public void add field relative node field field if field cursor fields length this fields field cursor field field cursor else system err println error relative address too many field added
add field allows the post instantiation a field to the fields
public relative node field get field string alias for int i 0 i this fields length i if this get field i get alias equals ignore case alias return this get field i system err println error address field alias does not exist return null
get field by string alias
public boolean dec address field int field id if this address get field field id get offset arg 0 try try to open the non existent fred txt here throw new ioexception catch ioexception e you handle the exception here e print stack trace system err println error header flit field field id is already 0 return true if thi...
dec address field decrements an address field based on its id
public int dec offset arg if this offset arg 0 this offset arg this offset arg 1 this offset arg this offset arg 1 return this offset arg
dec offset arg for minimal routing we need to only decrement offsets
public flit view int index if index 0 return this header flit else if index 1 payload flit vector size return payload flit vector element at index 1 else return null invalid flit index
views the ith flit of the packet
public boolean dec address field int field id if this address get field field id dec offset arg 0 return true system err println error header flit field field id is already 0 return false
dec address field decrements an address field based on its id
public void back if my index 0 my index 1
back up one character
public boolean more return my index my source length
determine if the source string still contains characters that next
public char next char c more my source char at my index 0 my index 1 return c
get the next character in the source string
public string next int n throws parse exception int i my index int j i n if j my source length throw syntax error substring bounds error my index n return my source substring i j
get the next n characters
public char skip to char to char c int index my index do c next if c 0 my index index return c while c to back return c
skip characters until the next character is the requested character
public void skip past string to my index my source index of to my index if my index 0 my index my source length else my index to length
skip characters until past the requested string
public parse exception syntax error string message return new parse exception message to string my index
make a parse exception to signal a syntax error
public string to string return at character my index of my source
make a printable string of this jsontokener
public string join string separator int i object o string buffer sb new string buffer for i 0 i my array list size i 1 if i 0 sb append separator o my array list get i if o null sb append null else if o instanceof string sb append jsonobject quote string o else if o instanceof character sb append jsonobject quote o to ...
make a string from the contents of this jsonarray
public string to string iterator keys keys object o null string s string buffer sb new string buffer sb append while keys has next if o null sb append s keys next to string o my hash map get s if o null sb append quote s sb append s sb append if o instanceof string sb append quote string o else if o instanceof characte...
make an json external form string of this jsonobject
public long to consistent hash long hash code return hash code 0xffffffff l
hash code hash 0 2 32 0 4294967295
public memcached client proxy get backend proxy string session id return locator locate session id
session id memcached
public void update views for view v views values update view v for control c children c update views
update all the associated views and the children
public void draw shape s affine transform at new affine transform at scale scale x scale y at translate x view port y view port g draw at create transformed shape s
draw a shape
public void fill shape s affine transform at new affine transform at scale scale x scale y at translate x view port y view port g fill at create transformed shape s
fill a shape
public void draw line double x double y double x2 double y2 g draw line int x x view port scale x int y view port y scale y int x2 x view port scale x int y view port y2 scale y
draw a line
protected void calculate view port scale x get width width view port scale y get height height view port x view port preferred xview port y view port preferred yview port if flag orthonormal if scale x scale y scale x scale y x view port preferred xview port double get width scale x width view port 2 0 else scale y sca...
calculate the view port based on what you want to see
public void add object2 d object2 d object synchronized objects objects add object collections sort objects zvalue comparator get instance
add an object2 d
public void remove object2 d object2 d object synchronized objects objects remove object
remove an object2 d
public rectangle2 d get view port return new rectangle2 d double x view port y view port height view port width view port height view port
rectangle of view port
public void set snap byte snap this snap snap image im image create image snap 0 snap length image set image create thumbnail im
sets the image to post
public void run try clear way dolog log flag get string trim length 0 check and set debug flag if log flag get string trim length 0 dolog true else dolog false to do provide for other connection types also connection con new smtpconnection this dolog con post sub get string mesg get string snap log set text log get tex...
thread run method that posts the message using the appropriate connection
public void pause app if cam form null cam form pause app
called when this midlet is paused
public void open string host int port boolean ssl throws ioexception string protocol ssl ssocket socket socket stream connection connector open protocol host port connector read write true input socket open input stream output socket open output stream
opens a connection with the given host on the given port
private void handle update try config config config get config config set pwd password chars config store catch record store exception rsex if error null error new text field error rsex to string 150 text field any else error set string rsex to string append error
update the changes
public void start if player null return try player start catch exception e system err println e close
start media player
public void set scan line spacing int scan line spacing this scan line spacing scan line spacing
set the scan line spacing
public void expand all boolean expand traverse tree from root expand all new tree path root expand
expanding or collapsing all nodes in a jtree component
private void gain readed entry number xmldocument factory xml new xmldocument factory xml build general utils get local channel name get feed name false true element root xml get root element string n root get attribute value xmltable model number attribute name readed integer parse int n
get readed entries number
public int get row count if entries null return 0 return entries size return data size
returns the number of rows in this data table
public int get column count if list null return 0 return list size
returns the number of columns in this data table
public void expand all tree node root boolean expand traverse tree from root expand all new tree path root expand
expanding or collapsing all nodes in a jtree component
public int add dialog wdialog dialog dialogs add element dialog dialog init by engine this return dialogs size 1
add a dialog to this engine and initialize the dialog
public void start wizard if dialogs size 0 wdialog dialog wdialog dialogs element at 0 get the first dialog in this wizard display set current dialog
start the wizard screen flow
public int users get logged in user throws facebook exception ioexception document d this call method facebook method users get logged in user return integer parse int d get first child get node value get text content
retrieves the user id of the user logged in to this api session
public string to text final string buffer sb new string buffer to text sb return sb to string
translate to plain text
protected void handle font add text pos 6 skip over font int end next non literal string s new string msg pos end pos add new message element message element font s pos end
handler for each type of data
public void stop me quit true
stops the thread from running
private void process ymsg9 packet pkt throws exception a null packet is sent when the input stream closes if pkt null quit true return process header if pkt session id 0 some chat packets send zero log trace received a packet status pkt status service pkt service get value packet pkt update session id in outer class pa...
switch on packet type to handler code
public void add roster listener final roster listener listener if listener null throw new illegal argument exception argument listener cannot be null synchronized listeners listeners add listener log debug added new roster listener
adds a listener that will be notified of any roster changes
private boolean process error ymsg9 packet pkt throws exception jump to service specific code switch pkt service case authresp parent session receive auth resp pkt return true case chatjoin parent session receive chat join pkt return true case logoff parent session receive logoff pkt return true default parent session ...
called when status 1
public void set host string host this host host try close catch exception ex silently fail
allow changing the host to open a new connection
private boolean starts with string s for int i 0 i s length i exit if we run out of msg half way through a successful match if pos i msg length return false otherwise check next char in pattern char c msg pos i if c a c z c character to lower case c if c s char at i return false return true
low level util methods
public void add element string key string value throws unsupported encoding exception ioexception if key null key trim length 0 throw new illegal argument exception argument key cannot be null or an empty string add string key add string value
add key value pair to buffer
private boolean exists string username for yahoo user user users if user get id equals username return true return false
does a user exist uses
public string get game if is game throw new illegal state exception this is not a gaming typed notification return get message
returns the game that is being played
public boolean contains object user if user null throw new null pointer exception if user instanceof yahoo user throw new class cast exception this method needs a yahoo user value return users by id contains key yahoo user user get id
checks if the provided object is a user on this roster
public boolean is typing return type null type equals ignore case status constants notify typing
checks if this notification regards a typing event
public boolean is game return type null type equals ignore case status constants notify game
checks if this notification regards a game event
public string get filename string s location get file if s last index of 0 s s substring s last index of 1 if s index of 0 s s substring 0 s index of return s
unqualified name of file sent
public contact list type get type return type
returns the type of the list
public fire event wait for event int seconds service type type try int nt seconds 10 for int i 0 i 100 i fire event ret events poll nt time unit milliseconds if ret null ret get type equals type return ret return null catch interrupted exception e log error exception wait for event will return null e return null
return the specific event based on type waiting for max seconds time
public yahoo chat lobby create lobby int lobby number final yahoo chat lobby lobby new yahoo chat lobby raw name id lobby number add lobby lobby return lobby
creates a new lobby inside this room
public void add lobby yahoo chat lobby lobby lobbies add lobby
adds the provided lobby to this room
public yahoo chat lobby get lobby string network name final yahoo chat category root roots get locale prefix if root null throw new illegal state exception root category for this locale locale prefix has not been loaded yet return root get lobby network name
returns the lobby as returned by
public boolean contains lobby yahoo chat lobby lobby return lobbies contains lobby
checks if this room contains the provided lobby
public int lobby count return lobbies size
returns the number of lobbies in this room
public void add subcategory yahoo chat category category subcategories add category
adds a new subcategory to this category
public yahoo chat lobby get lobby string network name return chat by net name get network name
package level methods get lobby object based upon network name
public void add user yahoo chat user yahoo chat user if yahoo chat user null throw new illegal argument exception argument yahoo chat user cannot be null users put yahoo chat user get id yahoo chat user
adds a new user to this lobby
public void remove user yahoo chat user yahoo chat user users remove yahoo chat user get id
removes the user from this lobby if it was in the lobby
public boolean exists yahoo chat user yahoo chat user return users contains key yahoo chat user get id
checks if the user exists in this lobby
public yahoo chat user get user string id return users get id
retrieves the user of this lobby matching the provided id
public int get lobby number return lobby number
returns the lobby number of this object
public string get network name return network name
returns the network name of this lobby
public void set reported users int reported users this reported users reported users
sets the number of reported users in this lobby
public ymsg9 packet get packet return packet
returns the packet that caused this exception
public void set reported voices int reported voices this reported voices reported voices
sets the number of reported users that support voice in this lobby
public void set reported webcams int reported webcams this reported webcams reported webcams
sets the number of reported users that have webcams in this lobby
public boolean add all collection extends yahoo user c throw new unsupported operation exception
this bulk change set operation is not supported in the roster implementation
public string get id return user id
returns the user id of this instance
public void reset m l bit count 0 m i len w 0 init h init w
resets the internal state to its initial values
public void set custom final string message final string status custom status message message custom status status
sets a custom presence status and status message
private void init h m h 0 0x67452301 m h 1 0xefcdab89 m h 2 0x98badcfe m h 3 0x10325476 m h 4 0xc3d2e1f0
initialize the h and w buffers
public int get stealth return stealth
gets the stealth modus of this user
public void add group id final string group id group ids add group id
adds this user to an additional user
public url get web page return location
returns the url that is included in the exception
public void kill quit flag true interrupt
gracefully stops this thread after sending out all currently queued events
private int read buffer byte buff throws ioexception int p 0 r 0 while p buff length r super read buff p buff length p if r 0 return p 1 1 p r return p
reads an entire buffer of data allowing for blocking
public void append final service type type append null type
add an event to the dispatch queue
public void append final session event event final service type type if type null throw new illegal argument exception argument type cannot be null if quit flag throw new illegal state exception no new events can be queued because the dispatcher is being closed queue add new fire event event type
add an event to the dispatch queue
public void remove session listener session listener session listener if session listener null throw new illegal argument exception argument session listener cannot be null if session listeners remove session listener log warn session listener not found to be removed new throwable
removes the listener from the collection of listeners to which events are dispatched
public void update status new status string new visibility this is the new version where 13 combined pager chat final int i visibility new visibility null 0 integer parse int new visibility update new status i visibility 2 0 i visibility 1 0
updates the yahoo user with the new values
public void update status new status boolean new on chat boolean new on pager this is the old version when 13 pager and 17 chat update new status this on chat new on chat this on pager new on pager
updates the yahoo user with the new values
public void update status new status this is the old version when 13 pager and 17 chat this status new status if this status status custom custom status message null custom status null
updates the yahoo user with the new values
public connection handler get connection handler return network
returns the handler used to send receive messages from the network
public void reset event count event count 0
sets the event counter to 0
public void reset friend id null group id null method null
resets the data by setting them to tt null tt
public string send message string to string message throws illegal state exception ioexception return send message to message login id
send a chat message
public void send buzz string to throws illegal state exception ioexception send message to network constants buzz
send a buzz message
public session state get session status return session status
get the status of the session ie unstarted authenticating etc
public void refresh stats throws illegal state exception ioexception check status transmit user stat
ask server to return refreshed stats for this session