input
stringlengths 10
828
| output
stringlengths 5
107
|
|---|---|
public double get speed assert speeds size 0 no speed set assert next wp index 0 no waypoint asked if speeds size 1 return speeds get 0 else return speeds get next wp index 1
|
returns the speed towards the next waypoint asked with
|
public int compare map node node1 map node node2 double dist1 distances get node1 double dist2 distances get node2 if dist1 dist2 return 1 else if dist1 dist2 return 1 else return node1 compare to node2
|
compares two map nodes by their distance from the source node
|
protected double generate speed if rng null return 1 return max speed min speed rng next double min speed
|
generates and returns a speed value between min and max of the
|
public coord get meeting spot for id int id int index id meeting spots size coord loc meeting spots get index clone return loc
|
get the meeting spot for the node
|
public void delete message string id boolean drop this router delete message id drop
|
deletes a message from this host
|
public string to string string s for int i 0 n coords size i n i coord c coords get i s c if speeds size 1 s string format 2f speeds get i return s
|
returns a string presentation of the paths coordinates
|
public void set random number generator random rand this rng rand
|
sets the random number generator to be used
|
public boolean add node evening activity movement evening activity node if is full return false else evening activity nodes evening activity nodes in buffer evening activity node evening activity nodes in buffer return true
|
add an evening activity node to the group
|
public double get map node node double value map get node if value null return value else return infinity
|
returns the distance to a node
|
private string get property names string string name if this secondary namespace null return this secondary namespace name nor this namespace name else if this namespace null return this namespace name else return name
|
returns the setting name appended to namespace name s on a string
|
protected double generate wait time if rng null return 0 return max wait time min wait time rng next double min wait time
|
generates and returns a suitable waiting time at the end of a path
|
public void set path path path this path new path path
|
sets the shopping path for the group
|
public void put map node node double distance map put node distance
|
puts a new distance value for a map node
|
public boolean is active return ah is active
|
returns true if this node is active at the moment false if not
|
public double next path available return sim clock get time generate wait time
|
returns a sim time when the next path is available
|
public void set destination coord destination this destination destination
|
sets the destination square of the trip
|
protected double generate wait time if state state walking elsewhere if location equals latest bus stop state state waiting for bus if state state travelling on bus state state waiting for bus return 0
|
switches state between get path calls
|
public double get double string name return parse double get setting name name
|
returns a double valued setting
|
public int compare to dtnhost h return this get address h get address
|
compares two dtnhosts by their addresses
|
private void add location coord loc double time assert sampling interval 0 non positive sampling interval if loc equals latest location node didn t move if latest path null constructing path end constructing and put it in the queue path queue add new tuple double path latest path start time latest path latest path null this latest path start time time return if latest path null latest path new path double speed loc distance this latest location sampling interval latest path add waypoint loc speed this latest location loc
|
adds a new location with a time to this models move pattern
|
private double parse double string value string setting double number int multiplier 1 if value ends with k multiplier 1000 else if value ends with m multiplier 1000000 else if value ends with g multiplier 1000000000 if multiplier 1 take the suffix away before parsing value value substring 0 value length 1 try number double parse double value multiplier catch number format exception e throw new settings error invalid numeric setting value for setting n e get message return number
|
parses a double value from a string valued setting
|
private void inc state if state probabilities length 1 state
|
call when a stop has been passed
|
public int get int string name return convert to int get double name name
|
returns an integer valued setting
|
private void reset state state 0
|
call when node has finished its trip
|
private int convert to int double double value string name int number int double value if number double value throw new settings error expected integer value for setting name got double value return number
|
converts a double value that is supposedly equal to an integer value
|
public boolean get boolean string name string string value get setting name boolean value if string value equals ignore case true string value equals 1 value true else if string value equals ignore case false string value equals 0 value false else throw new settings error not a boolean value string value for setting name return value
|
returns a boolean valued setting
|
public object create intialized object string class name class args class settings class object args this return load object class name args class args
|
creates and dynamically loads the class of an object that
|
public object create object string class name return load object class name null null
|
creates and dynamically loads the class of an object using the
|
public string value fill string string input if input contains fill delimiter return input nothing to fill settings s new settings don t use any namespace string result scanner scan new scanner input scan use delimiter fill delimiter if input starts with fill delimiter result s get setting scan next while scan has next result scan next if scan has next break result s get setting scan next return result
|
fills a string formatted in a special way with values from settings
|
private void load directories ipreference store store filesystem plugin get default get preference store string dirs list preference page get preference as array store filesystem templatesource preference page p directories directories remove all elements for int i 0 i dirs length i log fine loading dirs i internal add directories directories dirs i false todo or true or preference log fine directories size directories added
|
loads configured directories into the directories vector
|
public string get url contents string url throws http exception ioexception string ret null get method get new get method url host configuration hc get get host configuration fill proxy data hc client execute method hc get ret get get response body as string log finer response n ret return ret
|
gets the contents of an url with the configuration selected by the user
|
private void add templates vector v icontainer cont try iresource childs cont members for int i 0 i childs length i if childs i get type iresource file if name manager is filename ok childs i get name v add new workspace template ifile childs i else log fine childs i skipped since file extension is not vm else add templates v icontainer childs i catch core exception e e print stack trace log severe error adding templates from cont e
|
adds templates in container to the vector
|
private void iterate extensions string xpid iterator callback cb iextension registry registry platform get extension registry iextension point extension point registry get extension point xpid if extension point null iextension extensions extension point get extensions for int i 0 i extensions length i iextension extension extensions i iconfiguration element elements extension get configuration elements cb on extension extension for int j 0 j elements length j iconfiguration element element elements j cb on configuration element element else log severe extension point xpid not found
|
iterate over extensions and call methods on the iterator callback
|
public void set buffer input stream is throws ioexception int c string buffer sb new string buffer while c is read 1 sb append char c log finer setting buffer sb buffer sb to string
|
sets the template content from an input stream
|
public map get template engines map string xpid net sf javadocbuilder core templateengines template engine callback cb new template engine callback iterate extensions xpid cb return cb engines
|
gets all extensions of net
|
public boolean has property string key if properties null properties contains key key log fine property key found return true log fine no such property key return false
|
tells if the property file contains the given key
|
public list sort tags by named parameter doclet tag doclet tags array string parameter name boolean reverse list doclet tags new vector if doclet tags array null doclet tags array length 0 for int i 0 i doclet tags array length i doclet tags add doclet tags array i doclet named parameter comparator d new doclet named parameter comparator if reverse d reverse 1 d param name parameter name collections sort doclet tags d return doclet tags
|
sorts the doclet tags array by the parameter name specified
|
public void run iaction action manager m new manager itemplate source ts m get template sources string msg extensions n for int i 0 i ts length i msg msg concat source ts i get name message dialog open information window get shell javadoc builder core msg
|
the action has been activated
|
private java source get java source for final iresource resource log fine resource resource get name for int i 0 i source length i final string source name source i get file get name if source i get file get path ends with resource get full path to string log fine resource fullpath resource get full path log fine source path source i get file get path log fine resource candidate resource get full path return source i return null
|
gets the java source for a given iresource or null if not found
|
private void create parents if needed final icontainer cont throws core exception if log is loggable level finer log finer container cont get name if cont exists if cont get type iresource folder create parents if needed cont get parent final ifolder f ifolder cont log finer about to create f get name f create true false monitor f set local true ifile depth infinite monitor else log severe container cont type is not folder else log fine cont already exists
|
creates all neccesary parents for the given file
|
private ifile get output ifile final string out name throws core exception log fine out name out name final ifile file resources plugin get workspace get root get file new path out name log fine file file return file
|
gets the ifile for the filename
|
public string get out dir if out dir null out dir ends with return out dir return out dir
|
returns the output directory
|
private void do multiple output throws exception log fine multiple output files to process source length for int i 0 i source length monitor is canceled i monitor sub task writing file i source length build file source i
|
perform the build when multiple output files are generated
|
private boolean has class with tag final java source src final string tag name final java class c src get classes for int i 0 c null i c length i if c i get tag by name tag name null return true return false
|
tells if the given javasource has at least class with the specified tag
|
private void swap list int i int j string s string list get item i string list set item i string list get item j string list set item j s
|
swaps to items on the
|
public string get values string buffer sb new string buffer string arr string list get items for int i 0 arr null i arr length i if i 0 sb append sb append arr i log fine returning sb return sb to string
|
gets a string with values in list separated by comma
|
private string run template engine final java source src final java class clazz throws exception final map system context get system context src clazz final map user context get user context return engine run system context user context
|
this method invokes the template engine
|
public string get source directories string string buffer sb new string buffer if source directories null source directories size 0 for int i 0 i source directories size i string s string source directories get i sb append s if i source directories size sb append if sb char at sb length 1 sb delete char at sb length 1 return sb to string
|
gets a comma separated string with source directories
|
private void create remove button composite buttons button remove button new button buttons swt none remove button set text remove remove button set layout data new grid data grid data fill horizontal remove button add selection listener new selection listener public void widget selected selection event e int selected current builders list get selection index if selected 0 if message dialog open confirm get shell remove are you sure you want to remove this builder remove builder selected else no selected builder public void widget default selected selection event e no op
|
creates the remove builder button for the property page
|
private string get output filename for final java source src string ret null final string out pattern cfg get out pattern if cfg is single output ret out pattern log finer single output ret ret else ret substitute variables src out pattern ret cfg get out dir ret log fine out filename ret return ret
|
gets the output filename for the given java source
|
public void set source directories string string string tokenizer st new string tokenizer string log fine setting source directories string source directories clear while st has more elements string s string st next element log finer adding s add source dir s trim
|
sets source directories from a comma separated list
|
private string substitute variables final java source src final string string string ret null log finer doing variable substitutions on string final java class clazz src get classes 0 ret string replace all class name clazz get name log finest ret ret string pkg clazz get package if pkg null pkg ret ret replace all package dir pkg replace all log finest ret ret ret ret replace all package name pkg log finest ret ret this means null package if ret char at 0 ret ret substring 1 log finer multi output ret ret return ret
|
perform variable substitutions on the string for the given java source
|
private void create name tab item composite parent grid layout layout new grid layout layout num columns 1 parent set layout layout name text new text parent swt single name text set layout data new grid data grid data fill horizontal description text new text parent swt multi swt v scroll swt wrap description text set layout data new grid data grid data fill both enabled button new button parent swt check enabled button set text enabled enable by default enabled button set selection true enabled button set layout data new grid data grid data fill horizontal
|
creates the tab with builder name and description
|
private void create rebuild button composite buttons button rebuild button new button buttons swt none rebuild button set text rebuild now rebuild button set layout data new grid data grid data fill horizontal rebuild button add selection listener new selection listener public void widget selected selection event e try todo disable button while building progress monitor dialog p new progress monitor dialog get shell p open project build incremental project builder full build p get progress monitor catch core exception ex handle exception building project ex public void widget default selected selection event e todo auto generated method stub
|
creates the rebuild button
|
private void create templates composite parent grid layout layout new grid layout layout num columns 2 layout make columns equal width true parent set layout layout templates list new list parent swt single swt v scroll swt h scroll templates list set layout data new grid data grid data fill both templates list add selection listener templates list selection listener template info new label parent swt shadow in swt wrap template info set text click on a template template info set layout data new grid data grid data fill both
|
creates the ui area of the templates list and info
|
private void edit builder int selected icommand command builders set selected command refresh builders
|
updates the build command at specified position
|
private void remove builder int selected builders remove selected refresh builders
|
remove the builder from the commands
|
private string get default out dir string ret ijava project jp java core create project if jp null try ret jp get output location to string log fine default out dir is ret catch java model exception e log info e to string e print stack trace else log info could not create java project for project return ret
|
gets the default out directory
|
private void read builders log finer reading builders iproject description desc null try desc get project get description log finer calling read configuration builders clear builder configuration cmds null ifile f get project get file javadocbuilder cmds builder configuration read configurations f log fine cmds cmds length for int i 0 i cmds length i log fine adding build command cmds i builders add cmds i catch exception e handle exception reading builders in project e
|
reads build commands configured in the project into the
|
private iproject get project if project null iproject p null iworkbench w platform ui get workbench iadaptable a get element if a instanceof iproject p iproject a log fine ok is prj p get name else throw new runtime exception a project was expected but something else was found project p return project
|
gets the project we are dealing with
|
private void select template name boolean found false for int i 0 i templates length i if templates i get id equals builder configuration get template id templates list select i found true if found fixme elog log new status istatus error ui plugin get default get descriptor get unique identifier istatus ok template with id builder configuration get template id not found null
|
select in the
|
public void fire table changed table model event e final object listeners listener list get listener list process the listeners last to first notifying those that are interested in this event for int i listeners length 2 i 0 i 2 if listeners i table model listener class table model listener listeners i 1 table changed e
|
forward the given notification event to all table model listeners that registered
|
private jprogress bar get jprogress bar lines if j progress bar lines null j progress bar lines new jprogress bar j progress bar lines set string painted true return j progress bar lines
|
this method initializes j progress bar lines
|
private jprogress bar get jprogress bar inserted if j progress bar inserted null j progress bar inserted new jprogress bar j progress bar inserted set string painted true return j progress bar inserted
|
this method initializes j progress bar inserted
|
private jprogress bar get jprogress bar updated if j progress bar updated null j progress bar updated new jprogress bar j progress bar updated set string painted true return j progress bar updated
|
this method initializes j progress bar updated
|
private jprogress bar get jprogress bar ignored if j progress bar ignored null j progress bar ignored new jprogress bar j progress bar ignored set string painted true return j progress bar ignored
|
this method initializes j progress bar ignored
|
private jtext field get jtext field error log file name if j text field error log file name null j text field error log file name new jtext field j text field error log file name set editable false j text field error log file name set enabled true return j text field error log file name
|
this method initializes j text field error log file name
|
private jtext field get jtext field current action if j text field current action null j text field current action new jtext field j text field current action set editable false return j text field current action
|
this method initializes j text field current action
|
private jbutton get jbutton cancel if j button cancel null j button cancel new jbutton j button cancel set text import abbrechen j button cancel set enabled false j button cancel add action listener new action listener public void action performed action event e importer abort return j button cancel
|
this method initializes j button cancel
|
private jradio button get jradio button user defined if j radio button user defined null j radio button user defined new jradio button j radio button user defined set text messages get string delimiter config panel userdefined non nls 1 return j radio button user defined
|
this method initializes j radio button user defined
|
private jtext field get jtext field user defined delimiter if j text field user defined delimiter null j text field user defined delimiter new jtext field j text field user defined delimiter set enabled false j text field user defined delimiter get document add document listener new document listener public void changed update document event e fire item change performed public void insert update document event e fire item change performed public void remove update document event e fire item change performed return j text field user defined delimiter
|
this method initializes j text field user defined delimiter
|
private void initialize this set jmenu bar get import config menu bar this set content pane get jcontent pane this set title messages get string import configurator frame title pack
|
this method initializes this
|
private jpanel get jcontent pane if j content pane null j content pane new jpanel j content pane set layout new border layout j content pane add create jpanel source file border layout north j content pane add get jtabbed pane border layout center j content pane add create jpanel start stop buttons border layout south return j content pane
|
this method initializes j content pane
|
public void close throws ioexception raf close raf null
|
code close code closes the underlying code random access file code
|
public long length throws ioexception return raf length
|
code length code returns the length of the underlying
|
public int read char cbuf int off int len throws ioexception int remainder buffer end buffer pos if there are enough chars in the buffer to handle this call use those if len remainder system arraycopy buffer buffer pos cbuf off len buffer pos len return len otherwise start getting more chars from the delegate for int i 0 i len i read from out own method which checks the buffer first int c read if c 1 cbuf off i char c else return i return len
|
code read code reads from the underlying code random access file code
|
public long get file pointer throws ioexception return ra ptr pos buffer end buffer pos
|
code get file pointer code returns the effective position of the pointer
|
private int fill throws ioexception if raf null throw new ioexception random access file closed read bytes from random access delegate int b raf read bytes 0 default buffer size copy and cast bytes read to char buffer for int i b i 0 buffer i char bytes i if read any bytes if b 0 ra ptr pos b buffer pos 0 buffer end b return number bytes read return b
|
code fill code fills the buffer from the code random access file code
|
private void reset buffer throws ioexception buffer pos 0 buffer end 0 ra ptr pos raf get file pointer
|
code reset buffer code resets the buffer when the pointer leaves its
|
public void set row data object row data if logger is debug enabled logger debug set row data row data if row data instanceof string this row data string row data data get chars this row data else if row data null throw new illegal argument exception row data must be a string else this row data null data get chars null
|
sets the data of a dataset row
|
public string extract data between delimiters int field num throws parser exception return extract data at delimiter field num 0
|
retrieves a value between delimierts
|
public void set delimiter string delimiter if logger is debug enabled logger debug set delimiter delimiter this field delimiter delimiter delimiter chars get chars field delimiter
|
delimiter to be used for field separations
|
public logger create logger string source file name file f new file source file name logger local logger logger get logger get class get name f get name return local logger
|
creates a logger with name class name source file name
|
public void set enclosure string enclosure this enclosure enclosure enclosure chars get chars enclosure
|
sets the text enclosure e
|
public logger setup logger as static class logger instance logger static logger return instance logger
|
use the static class logger as local logger
|
private jpanel create jpanel progress jpanel j panel progress new jpanel j panel progress set layout new grid bag layout grid bag constraints gbc new grid bag constraints gbc gridx 0 gbc fill grid bag constraints both gbc weightx 1 0 gbc weighty 1 0 gbc gridy 0 j panel progress add get import progress panel gbc return j panel progress
|
this method initializes j panel progress
|
private jcheck box get jcheck box aggregate values if j check box aggregate values null j check box aggregate values new jcheck box j check box aggregate values set text messages get string description editor aggregatevalues non nls 1 return j check box aggregate values
|
this method initializes j check box aggregate values
|
private jcheck box get jcheck box not null if j check box not null null j check box not null new jcheck box j check box not null set text messages get string description editor notnull non nls 1 return j check box not null
|
this method initializes j check box not null
|
private jcheck box get jcheck box ignore dataset if invalid if j check box ignore dataset if invalid null j check box ignore dataset if invalid new jcheck box j check box ignore dataset if invalid set text messages get string description editor ignore dataset if invalid non nls 1 return j check box ignore dataset if invalid
|
this method initializes j check box not null
|
private jtext field get jtext field generator start value if j text field generator start value null j text field generator start value new jtext field return j text field generator start value
|
this method initializes j text field generator start value
|
private jbutton get jbutton start import if j button start import null j button start import new jbutton j button start import set text messages get string import configurator frame startimport non nls 1 j button start import add action listener new action listener public void action performed action event e button start action performed return j button start import
|
this method initializes j button start import
|
private jtext field get jtext field regex if j text field regex null j text field regex new jtext field return j text field regex
|
this method initializes j text field regex
|
private jpanel get jcontent pane if j content pane null j content pane new jpanel j content pane set layout new border layout must be initialized before create panel connection details j content pane add create panel list connections border layout center j content pane add create panel connection details border layout north j content pane add create panel buttons border layout south return j content pane
|
this method initializes j content pane
|
private object extract data row row field description field boolean skip converting throws exception object value null if field get position type field description delimiter position field get position type field description delimiter position with length cell cell row get cell field get delim pos value get cell value cell field skip converting if value null if field get alternative field description null check if there is an alternative field value extract data row field get alternative field description skip converting if value null value convert string value field field get default value return value
|
use the given row data see constructor
|
private jbutton get jbutton cancel import if j button cancel import null j button cancel import new jbutton j button cancel import set enabled false j button cancel import set text messages get string import configurator frame cancelimport non nls 1 j button cancel import add action listener new action listener public void action performed action event e if importer null importer interrupt j button cancel import set enabled false j button start import set enabled true return j button cancel import
|
this method initializes j button cancel import
|
private void initialize this set default close operation javax swing window constants dispose on close this set title base64 transcoder this set content pane get jcontent pane this pack this set visible true
|
this method initializes this
|
private jscroll pane get jscroll pane if j scroll pane null j scroll pane new jscroll pane j scroll pane set viewport view get jtext area j scroll pane set preferred size new dimension 400 100 return j scroll pane
|
this method initializes j scroll pane
|
private jpanel get jpanel if j panel null j panel new jpanel j panel set layout new grid bag layout grid bag constraints gb new grid bag constraints gb insets new insets 2 2 2 2 gb gridy 0 gb gridx 0 j panel add get jbutton encode gb gb gridy 0 gb gridx 1 j panel add get jcombo box char set gb gb gridy 0 gb gridx 2 j panel add get jbutton decode gb gb gridy 0 gb gridx 3 j panel add get jcheck box binary data gb return j panel
|
this method initializes j panel
|
private jbutton get jbutton decode if j button decode null j button decode new jbutton j button decode set text decode j button decode add action listener new java awt event action listener public void action performed java awt event action event e if j check box binary data is selected write binary data else string text j text area get text if text null text length 0 try j text area set text base64 get text text string j combo box char set get selected item catch unsupported encoding exception ex ex print stack trace return j button decode
|
this method initializes j button
|
private jcheck box get jcheck box binary data if j check box binary data null j check box binary data new jcheck box j check box binary data set text binary data return j check box binary data
|
this method initializes j check box
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.