input
stringlengths
10
828
output
stringlengths
5
107
public response delete record value object persistent object throws exception response response client utils get data delete detail new value object persistent object if response is error grid frame reload data return response
method called by the form panel to delete existing data
public void load data property grid control grid do something e g test vo vo new test vo vo set date value new java sql date system current time millis 86400000 vo set int value new integer 100 vo set numeric value new java math big decimal 1234 56 grid set properties vo
callback method invoked by the property grid control for loading data property values
public response delete record value object persistent object throws exception prepared statement stmt null try stmt conn prepare statement delete from customers where customer code detail test vo vo detail test vo persistent object stmt set string 1 vo get customer code stmt execute this instruction is no more needed the grid has been linked to the form see form link grid method grid frame reload data return new voresponse vo catch sqlexception ex ex print stack trace return new error response ex get message finally try stmt close conn commit catch sqlexception ex1
method called by the form panel to delete existing data
public void post handle http servlet request request http servlet response response object handler model and view model throws exception command command command request get attribute command attribute name object answer model get model get open swing view resolver response property name if answer null answer model get model values iterator next if answer null answer instanceof response string session id command get session id if session id null session id system current time millis math random if response answer get session id null response answer set session id session id model set view resolver
set session identifier to the answer
public void send message string xml message throws jmsexception queue connection connection null matrix change close session for jboss 3 2 1 session unclosed exception queue session session null try connection queue factory create queue connection session connection create queue session false session auto acknowledge queue sender queue sender session create sender queue text message message session create text message message set text xml message queue sender send message finally try if session null session close if connection null connection close catch exception exception exception print stack trace system err return
sends a jms message to a queue
public collection get all items collection li coll get line items if li coll null return null array list ret val new array list iterator it li coll iterator while it null it has next line item local loc line item local it next ret val add loc get data return ret val
method gets a collection of all line items for this po
private void do transition string completed order throws transition exception transition info info new transition info completed order transition delegate do transition info
send a completed order message to the customer relations so that
private void do transition string order mail throws transition exception transition info info new transition info order mail transition delegate do transition info
send a mail message to mailer service so customer gets an email
private void do transition string xml order approval throws transition exception if xml order approval null transition info info new transition info xml order approval transition delegate do transition info
send an order approval to the order approval queue since the work
private void do transition string xml mail throws transition exception transition info info new transition info xml mail transition delegate do transition info
send a mail message to mailer service so customer gets an email
private boolean can iapprove purchase order purchase order locale locale purchase order get locale if locale equals locale us if purchase order get total price 500 return true else if locale equals locale japan if purchase order get total price 50000 return true return false
just a stub for converting currency
private void do transition collection supplier po list string xml mail order approvals throws transition exception transition info info new transition info xml mail order approvals supplier po list transition delegate do transition info
send purchase orders to supplier to fulfill a customer order and
public void init servlet context context context set attribute petstore keys web controller this
constructor for an http client
private void do transition collection mailing list throws transition exception transition info info new transition info mailing list transition delegate do transition info
send a mail message to mailer service so customer gets an email
private void do transition string xml message throws transition exception transition info info new transition info xml message transition delegate do transition info
this method does the transition if the order was shipped
public object get sirius object return this sirius object
get sirius object returns the sirius object that fired the radio event
public void set tuner data sirius tuner data structure tuner data this sirius tuner data tuner data
sets the tuner data when this event is fired
public sirius tuner data structure get tuner data if this sirius tuner data null return this sirius tuner data else return empty sirius tuner data
retruns the tuner data that has changed
public void set channel data sirius channel data structure channel data this sirius channel data channel data
sets the channel data when this event is fired
public sirius channel data structure get channel data if this sirius channel data null return this sirius channel data else return empty sirius channel data
retruns the channel data that has changed
public void set song data sirius song info data structure song data this sirius song data song data
sets the channel data when this event is fired
public sirius song info data structure get song data if this sirius song data null return this sirius song data else return empty sirius song data
retruns the channel data that has changed
public void add string name string value props put name value
adds a the property with the given name and value
public void add string name boolean value props put name value true false
adds the boolean property
public void add string name int value props put name integer to string value
adds the integer property
public void add string name double value props put name double to string value
adds the double property
public void add string name int value props put name value
adds the int array property
public string get string name return string props get name
returns the value of the property with the
public string get string name string default value object value props get name return value null string value default value
returns the value of the property with the
public boolean get boolean string name object value props get name return value null value equals true false
returns the value of the property with the given name
public boolean get boolean string name boolean default value object value props get name return value null value equals true default value
returns the value of the property with the given name
public int get int string name try return integer parse int string props get name catch exception e return 1
returns the value of the property with the given name
public int get int string name int default value try return integer parse int string props get name catch exception e return default value
returns the value of the property with the given name
public double get double string name try return new double string props get name double value catch exception e return 1d
returns the value of the property with the given name
public void load string configfile config file name configfile load
loads configuration for the specified file
public double get double string name double default value try return new double string props get name double value catch exception e return default value
returns the value of the property with the given name
public void remove string name props remove name
removes the property with the given name
public void remove all props clear
removes all the properties
public boolean load if config file null config url null return false loads from url if config url null try return load new buffered reader new input stream reader config url open stream catch ioexception e e print stack trace return false loads from file else if config file exists return false try return load new buffered reader new file reader config file catch ioexception e e print stack trace return false
loads the property list from the configuration file
public boolean save if config url null return false try print writer out new print writer new file writer config file return save out catch ioexception e e print stack trace return false
saves the property list to the config file
private byte get buffer char string buffer string string s get buffer string buffer string 1 return byte integer parse int s
returns the first character of the supplied string as a byte
public void power on command command new cmd power on add to command queue command
turn the module on
public void power off if this sirius tuner data sirius power return command command new cmd power off add to command queue command
tuen the module off
public boolean is powered return this power
is powered returns true if the device is powered
public void close dispose if this my serial port null this my serial port close this my serial port null
close is used to close all ties with the sirius device
public void set mute boolean mute if this sirius tuner data sirius power return if mute command command new cmd mute on add to command queue command else command command new cmd mute off add to command queue command
sets the mute state on the sirius device
public boolean is muted return this sirius tuner data muted
is muted returns the mute state of the sirius device
public sirius channel data structure get channel data return this sirius channel data
returns the channel data
public sirius tuner data structure get tuner data return this sirius tuner data
returns the tuner data
public sirius song info data structure get song info return this sirius song data
returns the song info
public boolean test if channel valid int channel number if channel number 0 this sirius tuner data number of channels 0 channel number this sirius tuner data number of channels return false for int i 1 i this sirius tuner data number of channels i if this sirius tuner data sirius channel list i channel number return true return false
used to test if a channel is valid
public void tune down if this sirius tuner data sirius power return command command new cmd tune down add to command queue command
tune down one channel
public void tune to channel int channel number if this sirius tuner data sirius power return if this test if channel valid channel number command command new cmd tune to channel channel number add to command queue command
tune to a channel
public void tune to channel via service id byte service id if this sirius tuner data sirius power return service idtune true command command new cmd tune to channel sid service id add to command queue command
tune to a channel
private byte calculate check sum string command string int check sum 0 if command string null command string equals check sum string tobyte arr command string length 1 add one for the checksum it s self println check sum byte 0x100 check sum return byte 0x100 check sum
generates the checksum byte
public double get double value double bounded range model dbrm double bounded range model this get model return dbrm get double value
returns the double value of the slider
public void set value double v double bounded range model dbrm double bounded range model this get model dbrm set double value v
sets the double value of the slider
public void set major tick spacing double ts double bounded range model dbrm double bounded range model this get model super set major tick spacing int ts dbrm get multiplier
sets the major tick spacing for the slider from a double
public double get double major tick spacing double bounded range model dbrm double bounded range model this get model return double super get major tick spacing double dbrm get multiplier
returns the major tick spacing for the slider as a double
public void set minor tick spacing double ts double bounded range model dbrm double bounded range model this get model super set minor tick spacing int ts dbrm get multiplier
sets the minor tick spacing from a double
public double get double minor tick spacing double bounded range model dbrm double bounded range model this get model return double super get minor tick spacing double dbrm get multiplier
returns the minor tick spacing as a double
public void set extent double e double bounded range model dbrm double bounded range model this get model super set extent int e dbrm get multiplier
sets the extend from a double
public double get double extent double bounded range model dbrm double bounded range model this get model return double super get extent double dbrm get multiplier
returns the extent as a double
private void do set range props double v double e double minimum double maximum int p double dbl value if minimum maximum maximum minimum if maximum minimum minimum maximum if v e maximum v maximum e if v minimum v minimum precision p multiplier new double math pow 10 p int value dbl minimum minimum set minimum int dbl minimum multiplier dbl maximum maximum set maximum int dbl maximum multiplier dbl value v set value int dbl value multiplier dbl extent e set extent int dbl extent multiplier
changes the set range properties
public void set range properties double v double e double minimum double maximum int precision boolean new value is adjusting do set range props v e minimum maximum precision set value is adjusting new value is adjusting fire state changed
changes the set range properties and fires events to alert listeners of
public string to string string buffer sb new string buffer double bounded range model value sb append new double double get value double multiplier to string sb append extent sb append new double dbl extent to string sb append minimum sb append new double dbl minimum to string sb append maximum sb append new double dbl maximum to string sb append precision sb append new integer precision to string sb append multiplier sb append new integer multiplier to string sb append adj sb append new boolean get value is adjusting to string sb append return sb to string
creates a human readable string describing the range model
public double get double value return double get value double multiplier
returns the currently stored value as a double
public void set double value double v if v dbl extent dbl maximum v dbl maximum dbl extent if v dbl minimum v dbl minimum double dbl value v set value int dbl value multiplier
sets the value from a double
public void sleep int num seconds final int num ms random next int num seconds 250 750 num seconds try logger info sleeping for num ms ms num ms 1000 60 min synchronized this this wait num seconds 1000 catch interrupted exception e e print stack trace
sleep for around the given amount of seconds
private double get mock probability boolean state int netted neighbors int i int j 0 if state i 1 else i 0 switch netted neighbors case 4 if state j 0 else j 4 break case 2 if state j 1 else j 3 break case 0 j 2 break case 2 if state j 3 else j 1 break case 4 if state j 4 else j 0 break return probability transitions i 5 j
this is a mock probability as it may return a value 1
public void do get http servlet request request http servlet response response throws servlet exception ioexception request set attribute message request get session set attribute sign null request get request dispatcher index jsp forward request response
the do get method of the servlet
public string check u string username string password string ipaddress db db new db result set r set null string sign integer try string sql new string select sign from jd userinfo where username username and password password r set db execute query sql if r set next log line log log line log level normal ipaddress login ok username password sign integer r set get string 1 else log line log log line log level error ipaddress login error username password sign integer catch exception exception log line log exception exception return sign integer
the do post method of the servlet
public country get country int country id try query q em create query select c from country c where c id country id q set parameter country id country id return country q get single result catch no result exception ex throw new illegal argument exception
get country by id
public user organization get user organization long user org id query q em create query select org from user organization org where org id org id q set parameter org id user org id try return user organization q get single result catch no result exception ex throw new illegal argument exception my organization service myorg not found
looks up organization by its id
public void delete user user long user org id authorize user user db user database service get security service get user user get user name user get password checking permission boolean permission database service get security service has permission db user user org id constants act userorg delete if permission throw new illegal argument exception my organization service my delete not permitted get and set inactive status to the organization user organization old myorg get user organization user org id old myorg set status id constants status deleted
delete user organization
public void destroy em clear em close em null general service null
clean up instance
private element do countries document doc database service service list country countries service get general service get countries element root doc create element countries country skin skin new country skin for country country countries root append child skin convert doc country return root
select countries list
private element do inspections document doc database service service list inspection inspections service get general service get inspections element root doc create element inspections inspection skin skin new inspection skin for inspection inspection inspections root append child skin convert doc inspection return root
select inspections list
public element do select document doc database service db http servlet request req extract user string user name utils get string req user name string password utils get string req password user user new user user set user name user name user set password password create root element root doc create element userorgs getting myorgs list user organization userorgs db get user organization service get user organizations user sending user organization skin skin new user organization skin for user organization userorg userorgs root append child skin convert doc userorg return root
select all user organizations
public element do delete document doc database service db http servlet request req throws exception extract user string user name utils get string req user name string password utils get string req password user user new user user set user name user name user set password password get myorg id long userorg id utils get long req id try db begin transaction db get user organization service delete user userorg id db commit transaction return new success skin convert doc deleted catch exception ex db rollback transaction throw ex
delete user organization
private element do select http servlet request req database service service document doc user user new user user set user name req get parameter user name user set password req get parameter password long userorg id utils get long req userorg id list monthly vat declaration declarations service get monthly vat declaration service get declarations user userorg id element root doc create element monthly vat declarations monthly vat declaration skin skin new monthly vat declaration skin for monthly vat declaration decl declarations root append child skin convert doc decl return root
select all monthly vat declarations
public monthly vat declaration get declaration long decl id query q em create query select d from monthly vat declaration d where d id decl id q set parameter decl id decl id try return monthly vat declaration q get single result catch no result exception ex throw new illegal argument exception
find declaration by its id
private void validate report generation permission user user long myorg id int code database service db user db user db get security service get user user get user name user get password if db get security service has permission db user myorg id code throw new illegal argument exception
validates permission on specified action
public void delete facturas user user list monthly vat declaration factura facturas int year long user org id check permissions user db user database get security service get user user get user name user get password validate select permission db user user org id validate factura select permission db user user org id boolean has permission database get security service has permission db user user org id constants act monthly vat decl delete factura if has permission throw new illegal argument exception delete each factura for monthly vat declaration factura factura facturas delete factura factura year user org id
delete list of facturas
private boolean has special unit select permission user user long user org id return database get security service has permission user user org id constants act spec unit select
has the user select permission for the special units of given organization
private boolean has special category select permission user user long user org id return database get security service has permission user user org id constants act spec category select
has the user select permission for the special categories of given organization
public special category get special category long id query q em create query select u from special category u where u id cat id q set parameter cat id id try return special category q get single result catch no result exception ex throw new illegal argument exception not found
get special category
public monthly vat declaration other service type get other service type int id query q em create query select t from monthly vat declaration other service type t where t id type id q set parameter type id id try return monthly vat declaration other service type q get single result catch no result exception ex throw new illegal argument exception not found
get service type by id
public monthly vat declaration other service get other service long id query q em create query select s from monthly vat declaration other service s where s id service id q set parameter service id id try return monthly vat declaration other service q get single result catch no result exception ex throw new illegal argument exception
get service by id
public sqlbean column get join field1 return join field1
get the value of join field1
public sqlbean column get join field2 return join field2
get the value of join field2
public string get current error return current error
get the value of current error
public string get prepared statement return prepared statement
get the value of prepared statement
public void setps string v prepare for this statement this prepared statement v prepared statement objects new vector
set the value of prepared statement
public vector get prepared statement objects return prepared statement objects
get the value of prepared statement objects
public string get start request var return start request var
get the value of start request var
public string get size request var return size request var
get the value of size request var
public void set query string v this query v
set the value of query
public void set prepared statement string v this prepared statement v
set the value of prepared statement
public void set name string v this name v start request var classname name start size request var classname name size
set the value of name