input
stringlengths
10
828
output
stringlengths
5
107
public void set channel string c information put key channel c
set channel type
public void set channel string chanel this channel chanel
sets the channel of the cluster
public void set cluster cluster c owner c
set the tmp name
public void set gender string c this gender c
set the gender of the cluster
public turn set get turns turn set turns new turn set cluster old cluster null turn current turn null for segment segment get segments cluster current cluster segment get cluster if current cluster old cluster current turn new turn turns add current turn current turn add segment old cluster current cluster return turns
gets a turn set instance
public void set environment string c information put key environment c
set environment type coming from str env
public void put information string key object value information put key value
puts information key information
public void put information string key string value information put key value
put information key information
public void set length int c length c
set the length of a segment in number of features
public cluster create anew cluster string key if contains cluster key system err println cluster set t add cluster cluster exist key key cluster map put key new cluster key return get cluster key
create a new cluster with key as name
public void set score double c information put key score c
sets the score of the segment
public void set sorted user data object sorted user data this sorted user data sorted user data
sets the sorted user data
public void set show name string c show name c
set show name
public void write output stream writer dos throws ioexception string line get informations if line line cluster name get informations n dos write line for segment segment segment set line segment get show name segment get channel segment get start line segment get length gender segment get band line segment get env name segment get informations n dos write line
write the cluster and the segments to a e file
public void set start int c start index c
set start of the segment ie a feature index
protected boolean is empty line string line char linechar line char at 0 if linechar n return true if linechar return true if linechar line char at 1 return true return false
checks if line is empty
public void set used feature int idx boolean value for int i used features size i idx i used features add true used features set idx value
sets the used feature
protected void write gztxt string filename throws ioexception file f test new file filename if f test is directory buffered writer buffered writer new buffered writer new output stream writer new gzipoutput stream new file output stream filename string line for int i 0 i current data size i float frame current data get i for float element frame line string format locale us 8 6f element buffered writer write line buffered writer new line line buffered writer close
write gziped text format
public void set used features array list boolean used features this used features used features
sets the used features
public void read xml epac file f charset encoding throws exception xml epacinput output xml epac new xml epacinput output xml epac read xml this f encoding
read xml for epac format
public void set used features active boolean used features active this used features active used features active
sets the used features active
public void read xml media file f charset encoding throws exception xml mediainput output xml media new xml mediainput output xml media read xml this f encoding
read xml for media format
public void set word list string c information put key words c
set the word list
public void read file f charset encoding throws exception buffered reader buffered reader new buffered reader new input stream reader new file input stream f encoding read buffer buffered reader
read a segmentation file
protected link set get link set return transcription get link set
get the sausage set of the segment
public void read bck file f todo a impl menter system out println read bck to be implemented system exit 1
read bck format file
protected void set link set link set link set transcription set link set link set
sets the link set
protected entity set get entities return transcription get entity set
gets the entities
protected void set entities entity set entity set transcription set entity set entity set
sets the entities
public void remove cluster string key cluster map remove key
erase a cluster
public canvas surface get canvas surface return canvas surface
returns the canvas surface associated with this paint session
public void begin session anchor position x 1 drag in progress false
activates the tool
public void reset session get canvas surface clear rubberband selection anchor position x 1 drag in progress false
resets the tool
public void mouse up mouse event event if event button 1 reset session abort if right or middle mouse button pressed return if drag in progress return spurious event drag in progress false if anchor position x 1 return spurious event get canvas surface commit rubberband selection
handles a mouse up event
public void mouse move mouse event event final canvas surface ps get canvas surface if drag in progress return ps clear rubberband selection temp position x event x temp position y event y ps add rubberband selection create figure anchor position temp position
handles a mouse move event
public string get display name return testttt paint example get resource string tool line label
returns name associated with this tool
public string get display name return test paint example get resource string tool ellipse label
returns name associated with this tool
public void create part control composite frame try instance new rdfschema control frame catch ioexception e e print stack trace catch parser configuration exception e e print stack trace catch saxexception e e print stack trace
this is a callback that will allow us
public resource get input return input
gets the input
public void set input resource input this input input
sets the input
public resource open create the dialog window shell shell new shell get parent get style shell set text get text create contents shell shell pack shell open display display get parent get display while shell is disposed if display read and dispatch display sleep return the entered value or null return input
opens the dialog and returns the input
public shell get shell return canvas get shell
returns the shell in which the paint surface resides
public void set paint session paint session paint session if this paint session null if this paint session paint session return this paint session end session this paint session paint session if paint session null paint session begin session
sets the current paint session
public void clear rubberband selection if is rubberband hidden region region new region rubberband add damaged region display fdc region rectangle r region get bounds canvas redraw r x r y r width r height true region dispose rubberband clear
clears the active rubberband selection
public void hide rubberband if rubberband hidden nesting count 0 region region new region rubberband add damaged region display fdc region rectangle r region get bounds canvas redraw r x r y r width r height true region dispose
hides the rubberband but does not eliminate it
public void scroll horizontally scroll bar scroll bar if image null return if image width visible width final int old offset display fdc x offset final int new offset math min scroll bar get selection image width visible width if old offset new offset canvas update display fdc x offset new offset canvas scroll math max old offset new offset 0 0 math max new offset old offset 0 0 visible width visible height false
handles a horizontal scroll event
public void scroll vertically scroll bar scroll bar if image null return if image height visible height final int old offset display fdc y offset final int new offset math min scroll bar get selection image height visible height if old offset new offset canvas update display fdc y offset new offset canvas scroll 0 math max old offset new offset 0 0 math max new offset old offset 0 visible width visible height false
handles a vertical scroll event
public void set focus gui set focus
grabs input focus
public void reset swing components this list model remove all elements global variable list model remove all elements
removes all logging entries from the ui elements
public void set lookup dao paging lookup dao paging dao super dao paging dao this paging dao paging dao
method that allows setting the dao to talk to the data store with
public void start app display set current chooser
create the color chooser and make it current
public boolean set palette index int index if index palette length return false pndx index set color palette index return true
select which entry in the palette to use for the current color
public int get palette index return ndx
get the current palette index
public void set color int red int green int blue red red 0 0 red 0xff green green 0 0 green 0xff blue blue 0 0 blue 0xff set color red 16 green 8 blue
sets the current color to the specified rgb values
public void command action command c displayable s if c exit command destroy app true notify destroyed else if c about command about show about display
respond to a commands issued on any screen
public void set color int rgb rgb color rgb 0x00ffffff
sets the current color to the specified rgb values
public int get color return rgb color
gets the current color
public void set color int rgb rgb color rgb 0x00ffffff palette pndx rgb color update gray
sets the current color to the specified rgb values
public void key repeated int key key pressed key
handle repeat as in pressed
protected void key pressed int key int action get game action key int dir 0 switch action case right dir 1 break case left dir 1 break case up ndx 1 break case down ndx 1 break default return nothing we recognize exit limit selection to r g b and palette if ndx 0 ndx 0 if ndx 2 ndx 2 if ndx 0 int v rgb color ndx 8 0xff v dir 0x20 if v 0 v 0 if v 255 v 255 int mask 0xff ndx 8 rgb color rgb color mask v ndx 8 repaint
left and right are used to change which color bar to change
public void set foreground color int color fgcolor color
set the color of font to display
public int get foreground color return fgcolor
get the color of font currently being displayed
public void start app display set current sample
create the font chooser and make it current
public void set background color int color bgcolor color
set the color of font to display
public int get background color return bgcolor
get the color of font currently being displayed
protected void paint graphics g int w get width int h get height fill the background g set color bgcolor g fill rect 0 0 w h g set color fgcolor font font font get font face style size g set font font g draw string text 2 border graphics left graphics top
paint the canvas with the current color and controls to change it
public int get red component return rgb color 16 0xff
gets the red component of the current color
public int get green component return rgb color 8 0xff
gets the green component of the current color
public int get blue component return rgb color 0xff
gets the blue component of the current color
public void set radix int rad if rad 10 rad 16 throw new illegal argument exception radix rad repaint
set the radix used to display numbers
public void set delta int delta if delta 0 delta 128 this delta delta
set the delta used to increment decrement
public boolean matches byte candidate if candidate length 4 if price 0 return true string c new string candidate if symbol equals c substring 0 c index of if price integer value of c substring c index of 1 c length int value return true return false
p returns true if the candidate matches the symbol and price p
public boolean matches byte candidate return candidate length 5 true false
returns true if the candidate is less than 5 characters
public int compare byte rec1 byte rec2 system out println new string rec1 new string rec2 string record1 new string rec1 string record2 new string rec2 if record1 equals record2 return record comparator equivalent return integer max value
p checks to see if rec1 matches rec2 p
public int compare byte rec1 byte rec2 string name1 stock get name new string rec1 string name2 stock get name new string rec2 int result name1 compare to name2 if result 0 return record comparator precedes else if result 0 return record comparator equivalent else return record comparator follows
checks to see if rec1 matches rec2
public int get num records throws record store not open exception return database get num records
p return the number of records in the database p
public void start app use the specified url is overriden in the descriptor string u get app property http test url if u null url u main screen
start creates the thread to do the timing
public void start app new thread this start
start a thread to run the examples
public void start app if url list size 0 display set current url list else alert set string no url s configured display set current alert url list
start creates the thread to do the timing
public void run try gauge set label get using content connection gauge set value 2 get via content connection url gauge set label get using stream connection gauge set value 4 get via stream connection url gauge set label get using http connection gauge set value 6 get via http connection url gauge set label post using http connection gauge set value 8 post via http connection url catch exception e system out println e e print stack trace gauge set value 10 notify destroyed
run the examples
public void destroy app boolean unconditional thread null
destroy must cleanup everything
private void set alert string sprice try alerts add new string buffer append stock get name stocks search stock symbol append append stock make int sprice to string catch exception e error failed to add alert 2000
p set an alert for the selected stock at the specified price p
private string make ticker string the example ticker tape string string buffer ticker tape new string buffer try record enumeration re stocks enumerate records while re has next element string the stock new string re next record ticker tape append stock get name the stock append append stock get string price the stock append catch exception e return error accessing database return ticker tape to string
p generate a string which concatenates all of the stock names and
private void error string message int time if display get current instanceof alert alert a new alert error message null alert type error a set timeout time display set current a display get current
p display a message onscreen for a specified period of time p
private void main menu display set current menu current menu main
p display the main menu of the program p
private void what if form string tkr symbol display set current whatif current menu what if form stock symbol tkr symbol
p show the what if form to investigate a hypothetical stock deal p
private void alert menu boolean show alert display set current alert list current menu alert menu if show alert alert a new alert n n n saved null null a set timeout 2000 display set current a alert list
p show the alert management menu p
private void alert form string tkr symbol display set current alert price box current menu alert form stock symbol tkr symbol
p show the form to add an alert p
private void remove alert string choose data try separate the symbol and price from the data string symbol choose data substring 0 choose data index of 1 int s price stock make int choose data substring choose data index of 3 choose data length system out println remove alert symbol s price remove the alert alerts delete symbol s price catch exception e error failed to remove alert 2000
p remove the alert from our record store referenced by index p
private void settings boolean show alert display set current settings list current menu settings if show alert alert a new alert n n n saved null null a set timeout 1500 display set current a settings list
p show the settings menu p
private void updates display set current updates form current menu updates
p show the updates choices p
private void add stock stock symbol box set string display set current stock symbol box current menu add stock
p show the screen to add a stock p
private void delete stock string tkr symbol try stocks delete tkr symbol alerts remove useless alerts tkr symbol stock ticker set string make ticker string catch record store exception rs error failed to delete tkr symbol 2000
p remove the stock from the code stock database code p
private void about runtime runtime runtime get runtime example about show about display
p show the about box with copyright info and image p
public void command action command c displayable d synchronized this if command thread null process only one command at a time return current command c current displayable d command thread new thread this command thread start
p the method to determine what action to take p
public void set event event interface event this event event
sets the event
private void remove person from location event interface my event person person set person voters if my event get locations null for location location my event get locations voters location get voters if voters null try for person voter voters if we find the person remove them if voter get id equals person get id voters remove person catch concurrent modification exception e e print stack trace
called by the attendees servlet
public void render http servlet request request http servlet response response throws ioexception out response get writer service my service new service try user id long parse long request get parameter parameters fb sig user event id long parse long request get parameter parameters event id person my person my service get person by facebook uid user id event my event event my service load event class event id service remove participant my event my person catch more than one person exception e e print stack trace out println fb redirect url http apps facebook com plotmyevent
second page user never actually sees
public void validate string string parameter string par name if parameter null parameter equals errors add div align center style color ff0000 par name was not entered div
this method ensures that the string given is not null otherwise it
private void build element string str out println td str td
build elements to fill table