input
stringlengths
10
828
output
stringlengths
5
107
private object create remote ejb axis service axis service string bean jndi name string home name throws exception get the ejb home object from jndi object ejb home get ejbhome axis service bean jndi name class cls get context class loader load class home name object ehome javax rmi portable remote object narrow ejb home cls return ehome
create an ejb using a remote home object
public void receive resultadd values for measurement
auto generated axis2 call back method for add values for measurement method
public void receive erroradd values for measurement java lang exception e
auto generated axis2 error handler override this method for handling
public void receive resultset measurement tables
auto generated axis2 call back method for set measurement tables method
public void receive errorset measurement tables java lang exception e
auto generated axis2 error handler override this method for handling
public void receive resultlogin edu hs karlsruhe mep store api common mep input service stub login response result
auto generated axis2 call back method for login method override this
public void receive resultget units edu hs karlsruhe mep store api common mep input service stub get units response result
auto generated axis2 call back method for get units method override this
public void receive errorget units java lang exception e
auto generated axis2 error handler override this method for handling
public void receive resultlogout edu hs karlsruhe mep store api common mep input service stub logout response result
auto generated axis2 call back method for logout method override this
public void on module load singleton this set screen set login screen
this is the entry point method
public void set home screen string user home screen home screen new home screen user clear whatever is on the screen root panel get clear replace it with this home screen root panel get add home screen
method to set the home page
protected void validate return unit data impl param
validate the array for return
public void set return unit data impl param validate return param if param null update the setting tracker local return tracker true else local return tracker true this local return param
auto generated setter method
public void add return unit data impl param if local return null local return new unit data impl update the setting tracker local return tracker true java util list list org apache axis2 databinding utils converter util to list local return list add param this local return unit data impl list to array new unit data impl list size
auto generated add method for the array for convenience
protected void validate param1 long param
validate the array for param1
public void set param1 long param validate param1 param if param null update the setting tracker local param1 tracker true else local param1 tracker false this local param1 param
auto generated setter method
protected void validate param2 double param
validate the array for param2
public void set param2 double param validate param2 param if param null update the setting tracker local param2 tracker true else local param2 tracker false this local param2 param
auto generated setter method
public integer distance from planet system planet integer d x planet get x this get x integer d y planet get y this get y double d z math sqrt d x 2 d y 2 return int math floor d z
calculate the distance to another planet rounded down to an int
public void update observers todo do ars need to be passed at all set changed this notify observers
notify all observers that the model has changed
public void remove mercenary has mercenary false mercenary null
removes the mercenary from the planet
public planet system get target system return target system
the system the commander is currently examining or warping to
public void prepare for warp credits get wages pay yer maties credits get interest pay the thieves er loan interest days next day
weve been cleared for warp things to do before we go to warp
public void set credits integer credits if credits 0 credits 0 else this credits credits
sets the credits can not have negative credits the galactic bank
public void cleanup display dispose
release allocated resources
public void test add crew member pilot test pilot new pilot testpilot 3 4 5 6 ship test ship new ship test pilot set engineer skill 3 test pilot set fighter skill 4 test pilot set pilot skill 5 test pilot set trade skill 6 test ship add crew member test pilot assert true result 5 0
when a crew member is added the ships piloting fighting trading
public void test remove crew member
when a crew member is removed the ships piloting fighting trading
public jbutton get buy all button tgtypes tg return buy all button tg ordinal
gets the specified control for the trade good type
public void test add crew member fail not yet implemented todo
test method for
private void init model add observer this for tgtypes tg tgtypes values view get cargo panel get buy all button tg add action listener new buy all button handler
sets up all the action listeners for the view controls and starts
public void test add shield fail not yet implemented todo
test method for
public jbutton get buy button tgtypes tg return buy button tg ordinal
gets the specified control for the trade good type
public void test add weapon fail not yet implemented todo
test method for
public void test calc ship total skills fail not yet implemented todo
test method for
public jspinner get buy spinner tgtypes tg return buy spinner tg ordinal
gets the specified control for the trade good type
public jlabel get buy value tgtypes tg return buy value tg ordinal
gets the specified control for the trade good type
public jbutton get sell all button tgtypes tg return sell all button tg ordinal
gets the specified control for the trade good type
public jbutton get sell button tgtypes tg return sell button tg ordinal
gets the specified control for the trade good type
public jspinner get sell spinner tgtypes tg return sell spinner tg ordinal
gets the specified control for the trade good type
public jlabel get sell value tgtypes tg return sell value tg ordinal
gets the specified control for the trade good type
public jlabel get ts credit diff tgtypes tg return ts credit diff tg ordinal
gets the specified control for the trade good type
public jlabel get ts percent diff tgtypes tg return ts percent diff tg ordinal
gets the specified control for the trade good type
public jlabel get ts price tgtypes tg return ts price tg ordinal
gets the specified control for the trade good type
public jlabel get ts total profit tgtypes tg return ts total profit tg ordinal
gets the specified control for the trade good type
private xstream build xstream for get config xstream xs get stream xs alias get conf get config class xs use attribute for id string class xs alias param param class xs use attribute for name string class xs use attribute for order integer class xs use attribute for value type string class return xs
get config xstream
private xstream build xstream for form xstream xs get stream xs alias form form class xs use attribute for id string class xs alias data data class xs use attribute for type string class xs use attribute for column string class xs use attribute for name string class return xs
get config xstream
public response play with final toy toy if toy m recent toy return new tantrum m recent food null m recent toy toy switch toy case book m toy count book break case game controller m toy count game controller break case weights m toy count weights break case instrument m toy count instrument break return new playing toy m toy count instrument
play with the pet using a toy
public int get size return m food count meat m food count sweets m food count vegetable 2
get the current size of the pet
public view create image only indicator view group tab widget drawable drawable view tab indicator layout inflater from this inflate r layout tab indicator image tab widget false no inflate params final image view iv image view tab indicator find view by id r id icon iv set image drawable drawable return tab indicator
create a tab indicator that has only a centered image
public view create text only indicator view group tab widget int resid view tab indicator layout inflater from this inflate r layout tab indicator text tab widget false no inflate params final text view tv text view tab indicator find view by id r id title tv set text resid return tab indicator
create a tab indicator that has only centered text
private void toggle tabs collapsed if m tabs collapsed set tabs collapsed false m tab host set current tab by tag fun tab else set tabs collapsed true
collapse tabs as per
private void set tabs collapsed boolean collapsed m tabs collapsed collapsed if collapsed m tab host set current tab by tag expand collapse tab m tab open close indicator select drawable 0 else m tab open close indicator select drawable 1
collapse or expand the tabbed content area of the screen
private void add food click listener final int button id final food food find view by id button id set on click listener new view on click listener override public void on click view v m pet feed food run m effects m pet view show pet m pet set tabs collapsed true
add action for food buttons
private void add fun click listener final int button id final toy toy find view by id button id set on click listener new view on click listener override public void on click view v m pet play with toy run m effects m pet view show pet m pet set tabs collapsed true
add action for toy buttons
public array list get maneuvers return maneuvers
returns all the maneuvers in the route
public void set model node model t model check state xml reader null model was changed while parsing is underway this model model
set the node model used by this parser
public void start parsing reader reader t data throws xmlstream exception check state model null no model was set init reader data is incremental true
begin incremental parsing of a data stream represented by a reader
public boolean has more events check state xml reader null start parsing was never called check state is incremental start parsing was never called return xml reader has next
check to see if more xml remains to be processed
public xmlevent process event throws xmlstream exception snaxuser exception check state xml reader null start parsing was never called check state is incremental start parsing was never called return process event xml reader next event
consumes the next xml event
public void start element start element element t data throws snaxuser exception
called when a selected element starts
public void end element end element element t data throws snaxuser exception
called when a selected element ends
public void characters start element parent characters contents t data throws snaxuser exception
called when a selected element contains text content
public void parse reader reader t data throws xmlstream exception snaxuser exception todo this needs to catch concurrent parse attempts init reader data for xmlevent event xml reader next event xml reader has next event xml reader next event process event event
parse a data stream represented by a reader to completion
public void build node model builder t builder
called once during the model building phase prior to parsing
public void attach element handler t handler node state t state build state context add element handler state handler
attach an element handler to this selector or chain of selectors
public string process string recv string throws exception system out println socket server process process system out println recv string recv string for int i 0 i 10000 i new string asdf return
to be override by subclass
public void before perform
to be override by subclass
public void after perform
to be override by subclass
public throwable get cause return this cause this null this cause
return the nested cause or null if none
public string get message even if you cannot set the cause of this exception other than through the constructor we check for the cause being this here as the cause could still be set to this via reflection for example by a remoting deserializer like hessian s if this cause null this cause this return super get message else return super get message nested exception is this cause get class get name this cause get message
return the detail message including the message from the nested exception
public void print stack trace print stream ps if this cause null this cause this super print stack trace ps else ps println this this cause print stack trace ps
print the composite message and the embedded stack trace to the specified stream
public void print stack trace print writer pw if this cause null this cause this super print stack trace pw else pw println this this cause print stack trace pw
print the composite message and the embedded stack trace to the specified writer
public boolean contains class ex class if ex class null return false throwable ex this while ex null if ex class is instance ex return true if ex instanceof nested runtime exception cast is necessary on jdk 1 3 where throwable does not provide a get cause method itself ex nested runtime exception ex get cause else ex null return false
check whether this exception contains an exception of the given class
public boolean contains class ex class if ex class null return false throwable ex this while ex null if ex class is instance ex return true if ex instanceof nested checked exception cast is necessary on jdk 1 3 where throwable does not provide a get cause method itself ex nested checked exception ex get cause else ex null return false
check whether this exception contains an exception of the given class
public void commit string session id string pool name throws exception 1 find all the pool tx cap txc get tx if txc null session id txc get session id orconnection pool pool this get connection pool pool name if pool null throw new exception pool name connection conn pool get connection used session id if conn null throw new exception session id session id pool name pool name conn commit if logger is debug enabled logger debug sid session id commit pool free one connection session id
the transaction with session id want to commit
public void set transaction timeout int duration throws exception ormanager set transaction timeout this session id this connection pool name duration
2003 11 5 16 22
public dyna bean new instance throws illegal access exception instantiation exception dyna form dyna bean new dyna form dyna bean set dyna action form class this for int i 0 i properties length i dyna bean set properties i get name null return dyna bean
p instantiate and return a new
public string buffer to xml return this to xml true false return this to xml true true true
xml data data item
public element get unique item string item name array list al get item this xml tree item name if null al al size 0 return element al get 0 return null
p item name
public xmldata object get xdo string node path throws xml parser exception return get xdo node path 0
node path xmldata object
public int operate int current loop simulator type type sent the message to the following node node sender this path get position this path next rcv packet message current loop type sender count the size of the message broadcated except if for the first step the source create the message nothing is broadcast return this path get status path path status starting 0 this message get size
make the message go forward in its logical way
private boolean answer as destination message msg node destination msg get body iterator next get owner if destination equals this for each rs requested sent our information for resource state rs msg get body rs set data current state get rs get type return true return false
try to answer the message as the destination node
private boolean answer using rslist message msg boolean found all false hash set resource state answer new hash set resource state for resource state askedrs msg get body found all false for resource state myrs this resource list key set if askedrs equals myrs if we have the requested rs answer add myrs found all true break if found all break if found all if every rs requested are found then set the answer in the message msg set body answer return true else return false
answer the message using our rslist
protected void write meta data print writer pw throws ioexception
write meta data code
protected void write serializer print writer pw throws ioexception
write serializer getter code and pass in meta data to avoid
protected void write deserializer print writer pw throws ioexception
write deserializer getter code and pass in meta data to avoid
public void generate throws ioexception set generators post set generators if interface writer null interface writer generate if service writer null service writer generate if skel writer null skel writer generate if impl writer null impl writer generate generate
write all the binding bindings stub skeleton and impl
protected void post set generators if emitter is deploy interface writer null service writer null skel writer null impl writer null
set the writer based on the other condition after generate is called
protected string get file name return namespaces to dir package name class name as get file name
return the file name as a string of the form
protected void register file string file final string pkg get package string fq class if pkg null pkg length 0 fq class pkg get class name else fq class get class name emitter get generated file info add file fq class type system out println file register file
you should not need to override this method
protected void write header comments print writer pw throws ioexception string local file get file name int last sep char local file last index of file separator char if last sep char 0 local file local file substring last sep char 1 pw println pw println local file pw println pw println this file was auto generated by wsdl2 as3 pw println pw println write header comments
write the header comments
protected void add definition generators add generator definition class as3 definition writer class for faults add generator definition class java deploy writer class for deploy wsdd add generator definition class java undeploy writer class for undeploy wsdd add generator definition class as3 build file writer class add a build file writer add definition generators
method add definition generators
public generator get generator binding binding symbol table symbol table if include binding get qname generator writer new as3 binding writer emitter binding symbol table binding entry b entry symbol table get binding entry binding get qname binding writers add stuff writer b entry symbol table return binding writers else return new noop generator get generator
method get generator
public generator get generator service service symbol table symbol table if include service get qname generator writer new as3 service writer emitter service symbol table service entry s entry symbol table get service entry service get qname service writers add stuff writer s entry symbol table return service writers else return new noop generator get generator
method get generator
public generator get generator type entry type symbol table symbol table if include type get qname generator writer new as3 type writer emitter type symbol table type writers add stuff writer type symbol table return type writers else return new noop generator get generator
method get generator
protected void sanity check symbol table symbol table iterator it symbol table get hash map values iterator while it has next vector v vector it next for int i 0 i v size i sym tab entry entry sym tab entry v element at i string namespace entry get qname get namespace uri string package name org apache axis wsdl to as3 utils make package name namespace string local name entry get qname get local part if local name equals package name package name equals namespaces get create namespace package name pkg namespaces put namespace package name
method sanity check
public boolean has children if children null return true else return false
return true if the node has children
public boolean put float lat float lon object obj return top put lat lon obj
add a object into the tree at a location
public double border distance float lat float lon double nsdistance double ewdistance if south lat lat north nsdistance 0 else nsdistance math min math abs lat north math abs lat south if west lon lon east ewdistance 0 else ewdistance math min math abs lon east math abs lon west double distance math sqrt math pow nsdistance 2 0 math pow ewdistance 2 0 return distance
a utility method to figure out the closest distance of a border
public object remove float lat float lon object obj return top remove lat lon obj
remove a object out of the tree at a location