input
stringlengths
10
828
output
stringlengths
5
107
public triple a first b second c third super first second this third third
constructs a new triple with the given objects
public viper sub tree get removed nodes return removed
gets the subtree that was removed
public string to string return get first get second get third
uses the to string method to concatenate the elements together
public c get third return third
gets a reference to the third element
public boolean equals object o if this o return true else if o instanceof triple triple that triple o return super equals o third null null that third third equals that third else return false
compares the elements of the triple with the elements of the target
public int hash code return super hash code third null 0 third hash code
the xor of the three elements of this
public chronicle marker model get marker model return get markers node get model
gets the marker model associated with this viewer
public void add node node n if n null return if selections add new node box n fire change event null
adds a new node to the set of selected nodes
public void clear if selections is empty selections clear fire change event null
removes any selection
public void remove node node n if selections remove new node box n fire change event null
removes the given node from the set of selected nodes
public void set to set set boolean same selections size set size if same iterator iter set iterator while iter has next if is selected node iter next same false break if same selections clear iterator iter set iterator while iter has next selections add new node box node iter next fire change event null
replaces the current set of selections with the given set
public string to string return this get start this get end
gets a string version of the interval
public boolean equals object o if this o return true else if o instanceof interval interval that interval o return this get start equals that get start this get end equals that get end else return false
tests to see if this refers to the same interval
public int hash code return get start hash code get end hash code
gets a hash code
public boolean is char return char wise
determines if the error message contains data about where the error
public boolean intersects set s if s instanceof interval return intersects interval s else if s instanceof range return range s intersects this else for iterator iter s iterator iter has next object curr iter next if curr instanceof interval this intersects interval curr return true else if curr instanceof comparable this contains comparable curr return true return false
assuming s contains instants or spans of the same type time or frame
public boolean intersects interval other double diff start end this get start compare to other get end if diff start end 0 return false double diff end start this get end compare to other get start if diff end start 0 return false return true
tests to see if this interval intersects
public boolean contains object o hideous code necessary to handle multiple cases i really miss multimethods or whatever those things are called that handle this sort of thing if o instanceof comparable return contains comparable o else if o instanceof interval return contains interval o else if o instanceof set return contains set o else return false
tests to see if the given object is contained within
public boolean contains comparable i return this get start compare to i 0 this get end compare to i 0
tests to see if the given item is within the interval
public boolean contains interval other return this contains other get start this get end compare to other get end 0
tests to see if the other interval is a subset
public void focus changed event object e xxx should only redo what s changed instead of everything focus change indicates need to redo markers but only whole view if focus interval changed reset view get overlay redo length get overlay redo height
calls reset view
public boolean contains set s for iterator iter s iterator iter has next object curr iter next if curr instanceof comparable if this contains comparable curr return false else if curr instanceof interval if this contains interval curr return false else return false return true
tests to see that all elements of the set are contained
public object clone lengthwise encoded list nl new lengthwise encoded list nl values put all values return nl
copies the list does not copy the references
public interval change comparable start comparable stop throw new unsupported operation exception
not implemented throws unsupported operation exception
public void fire selection changed viper sub tree changed event e super fire change event e
this should be used instead of fire change event
public object get comparable index sorted map m values tail map index if m is empty m first key equals index return lel node m get index get value m values head map index if m is empty lel node v lel node m get m last key if v get end compare to index 0 return v get value return null
get the value at the specified index in the list
public iterator get selection beneath final node n return new mapping iterator new mapping iterator mapping functor public object map object o return node box o n new except iterator new except iterator except functor public boolean check object o return util beneath n node box o n selections iterator
returns the nodes in the selection set that are
public string to string string buffer sb new string buffer append final class classes new class sourcefile class config class attr config class descriptor class attribute class for int i 0 i classes length i if is filtered by classes i iterator iter get selected by classes i sb append append classes i get name append while iter has next sb append append iter next sb append sb append return sb to string
prints out the subtree as a chain
public string to string string buffer sb new string buffer for iterator iter values entry set iterator iter has next map entry curr entry map entry iter next comparable curr start comparable curr entry get key comparable curr end lel node curr entry get value get end object curr value lel node curr entry get value get value sb append curr start append append curr end sb append append string help backslashify curr value to string append if iter has next sb append return sb to string
gets a list in the form code n item n item
public iterator iterator return new lengthwise encoded list dynamic value iterator this
an iterator over all the
public comparable get end return comparable super get first
returns the end instant
public object get value return super get second
gets the value at the node
public void data changed event object e reset view get overlay redo length get overlay redo height
calls reset view
public void action performed action event event save
saves the current metadata
public static class pass through implements data matrices get cost gets the long value of the object param obj the object to determine the cost of return code number obj long value code throws class cast exception if code obj code doesn t implement number public long cost object obj return number obj long value
assumes object is an instance of number and calls its
public enum iterator enumeration enumeration this enumeration enumeration
constructs a new iterator wrapping the given enumeration
public long cost object obj return number obj long value
gets the long value of the object
public except iterator except functor ex iterator i iter i except ex help cache next
creates a new instance of except iterator
public boolean has next if dirty cache help cache next return cache null
tests to see if another element matching
public object next if dirty cache help cache next if cache null dirty cache true return cache else throw new no such element exception
gets the next valid element of the wrapped iterator
public boolean has previous return is empty
tests to see if there is another element
public void remove if dirty cache throw new illegal state exception else iter remove dirty cache false help cache next
this must be called directly after the call to next calling
public void add object o throw new unsupported operation exception
adds the value between current and next unimplemented
protected void fire change event change event e assert notifying listeners false notifying listeners true try object listeners cls get listener list for int i listeners length 2 i 0 i 2 if listeners i change listener class if e null e new change event this change listener listeners i 1 state changed e finally notifying listeners false
fire a change event to all registered listeners
public default single viper sub tree get primary return primary
gets the primary selection
public void tick ticks tick size process ticks
indicate a single tick
public void tick int times ticks tick size times process ticks
indicate multiple ticks
public void finish out println for iterator iter errs iterator iter has next out println iter next to string
print an end of line character
public void send error string err errs add err
sends the error message to the list of errors
public mapping iterator mapping functor map iterator i iter i this map map
creates a new instance of except iterator
public void set total int total unit original unit if total 0 size count else if total count tick size count total size tick size for int i 1 i tick size i this unit original unit else size total count
reset the expected number of calls to ticks
public object next return map map iter next
gets the next object corresponding to the next element of the
public action listener get save as action listener return save as listener
gets the save file as
public void action performed action event event save as
saves the file to a new file name
public void reset view recenter reset line layer reset markers if scroll views null scroll views reset cameras
refreshes the chronicle display
private void check hello world matrix iterator mi string temp get concatenated columnwise mi assert true testing concatenation hello world temp temp equals hello world
a step in running the matrix iterator test
public int size return spans size
gets the number of disconnected ranges of
private void check hello matrix iterator mi string temp get concatenated columnwise mi assert true testing concatenation hello temp temp equals hello
a step in running the matrix iterator test
private void check clean matrix iterator mi string temp get concatenated columnwise mi assert true testing concatenation null temp temp equals
a step in running the matrix iterator test
private void recenter pcamera c get proxy get camera find what the first and last pixel should be ignore this if focus is null or empty if model null model get focus null model get focus is empty return paffine transform cam transform c get view transform reference double curr xoffset cam transform get translate x double total xwidth get view length get view offset x double max xoffset total xwidth c get bounds reference get width if max xoffset curr xoffset c set view offset max xoffset cam transform get translate y
makes sure the current view contains the extents of the focus
public boolean within range interval s return within range s get start s get end
checks that this is
private string get concatenated columnwise matrix iterator mi string temp new string int prev col 1 int prev row 1 while mi has next column int x mi next column assert true x prev col n x prev col while mi has next in column temp string mi next in column int y mi curr row assert true y prev row n y prev row prev row y prev row 1 prev col x return temp
a step in running the matrix iterator test
public void set attribute attribute attribute if this attribute attribute write lock try this attribute attribute finally write unlock
sets the selected attribute
public boolean within range comparable s comparable e sorted map m spans head map e if m is empty thankfully range keeps contiguous spans merged so this is easy comparable start comparable m last key comparable end comparable m get start if end compare to s 0 return start compare to s 0 end compare to e 0 m spans tail map s if m is empty comparable s prime comparable m first key if s prime compare to s 0 return e compare to comparable m get s prime 0 return false
checks to see if the interval defined as s e
public void test assignment long data example from papadimitriou and steiglitz 7 2 1 9 4 9 6 9 5 5 3 8 3 1 8 7 9 4 2 2 8 4 7 4 8 assert true testing transpose test transpose data assert true testing assignment test assignment data 15
tests the hungarian assignment algorithm
public void action performed action event event if get curr file null try if import export get start directory null import export set start directory get last directory if import export export sourcefile as gtf get curr file set last directory import export get start directory catch ioexception e logger log level severe error while exporting e catch bad data exception e logger log level severe error while exporting e
exports the currently selected sourcefile as a
public object get comparable index if this contains index return positive value else return negative value
returns null if the moment is in the span otherwise returns
public void set comparable start comparable stop object value if value null value instanceof boolean value equals boolean false this remove start stop else this add start stop
since this is just a range this ignores the value object except
public int hash code return first null 0 first hash code second null 0 second hash code
gets a hashcode for the pair
public boolean equals object obj if this obj return true else if obj instanceof pair pair other pair obj return first null null other first first equals other first second null null other second second equals other second else return false
uses first and seconds
public void set root viper data root if this root root return if this root instanceof eventful node eventful node this root remove node listener vnl this root root last selected node null if root instanceof eventful node if null vnl vnl new watch for removals this eventful node this root add node listener vnl
sets the root of the selection
public interval get extrema if spans is empty return null else if spans size 1 comparable start comparable spans first key comparable end comparable spans get start return create interval start end else comparable start comparable spans first key comparable end comparable spans last key end comparable spans get end return create interval start end
gets the span that starts at the beginning
public boolean set spans collection s boolean changed false for iterator iter s iterator iter has next changed changed add iter next return changed
adds all of the span objects in the collection s
public action listener get export current file action listener return export current file listener
gets an action object for the export current file as a
public void select path to node n if n instanceof attribute set attribute attribute n else if n instanceof attr config set attr config attr config n else if n instanceof descriptor set descriptor descriptor n else if n instanceof config set config config n else if n instanceof sourcefile set sourcefile sourcefile n else if n instanceof viper data set root viper data n else set sourcefile null
select the path to the given node
public void set attribute attribute attribute if are different attribute this attribute last selected node attribute default single viper sub tree removed new default single viper sub tree null default single viper sub tree added new default single viper sub tree null copy into removed if attribute null added attribute attribute added descriptor descriptor attribute get parent added attr config attribute get attr config added config added descriptor get config added sourcefile added descriptor get sourcefile else copy into added added attribute null apply changes removed added fire selection changed new viper sub tree changed event this removed added
sets the attribute to select on
public boolean add all iterator iter boolean changed false while iter has next changed add iter next changed return changed
adds all the elements described by the iterator
public void set config config config if are different config this config last selected node config default single viper sub tree removed new default single viper sub tree null default single viper sub tree added new default single viper sub tree null copy into removed removed sourcefile null added config config apply changes removed added fire selection changed new viper sub tree changed event this removed added
sets the descriptor config to select on
public void fit in window instant i model get major moment if i null this set zoom 1 model get major moment
zoom out to fit the timelines in the window
public void set sourcefile sourcefile sourcefile if are different sourcefile this sourcefile last selected node sourcefile default single viper sub tree removed new default single viper sub tree null default single viper sub tree added new default single viper sub tree null copy into removed removed attr config null removed config null added sourcefile sourcefile apply changes removed added fire selection changed new viper sub tree changed event this removed added
sets the sourcefile to select on
public object next in column throws no such element exception if has next in column return data curr col curr row next row throw nsex
returns the next non empty cell in the matrix in the
public action listener get import xgtfaction listener return import xgtflistener
gets an action object for the import all data from an existing xgtf
public object next if has next throw new no such element exception instant s e if prev null s alpha else s instant prev get end if next null e omega else e instant next get start prev next if i has next next interval i next else next null if prev null i null return new span s e
gets the next instant in the interval
public void insert string prefix current prefix current if lines null lines size 0 lines set 0 prefix string lines get 0
this appends a string to the beginning of the current line
public string numbered if multi lines size 1 if lines size 2 return string help pad left 10 line number 1 lines get 0 n string help pad left 10 line number lines get 1 else return string help pad left 10 line number lines size 1 lines get 0 n n string help pad left 10 line number lines get lines size 1 else return string help pad left 10 line number current
this returns the current multiline with the line number appended to
public boolean has more tokens return cached nsex null
tests to see if more tokens remain
public string next token if cached nsex null throw no such element exception cached nsex fill in stack trace string curr token next token offset next offset end next end try next token super next token if returning tokes next offset next end next end next token length else while delim index of next token char at 0 0 next token super next token next offset next end next offset next end next end next token length catch no such element exception nsex cached nsex nsex return curr token
gets the next token
public boolean check object o return node o get node type node element node
checks to see that the node is an element
public action listener get import gtffile action listener return import gtffile listener
gets an action object for the import gtf into current media file menu
public boolean empty return current null current length 0
returns code true code if the current line contains no data
public void set orientation int new orientation if new orientation this orientation switch new orientation case adjustable horizontal case adjustable vertical invalidate break default string err not a valid orientation throw new illegal argument exception err int old orientation this orientation this orientation new orientation fire property change orientation old orientation new orientation
sets the orientation of the widget
public string to string string buffer sb new string buffer for iterator iter spans entry set iterator iter has next map entry curr map entry iter next sb append append curr get key append append curr get value append if iter has next sb append return sb to string
returns the list as a space delimited of s e pairs
public void set line num int line number this line number line number
set the current line number
public int get column int offset if multi int i 0 try while offset string lines get i length offset string lines get i length i catch index out of bounds exception ioobx throw new string index out of bounds exception column specified beyond end of line return offset
this returns what column in a multiline the specified character
public double get yzoom return line zoom
gets the y direction zoom ratio
private void clean parameters if data height 0 data width 0 double t new double 0 0 if data height 0 t 1 data height data height 1 if data width 0 t 0 data width data width 1 affine transform get rotate instance math to radians data rotation transform t 0 t 0 1 data x pos int t 0 data y pos int t 1 data rotation data rotation 360 if data rotation 0 data rotation 360
makes certain that width and height are non negative and
public boolean intersects set s if s instanceof interval return intersects interval s else if s instanceof range return intersects range s else for iterator iter s iterator iter has next object curr iter next if curr instanceof comparable comparable i comparable curr if this within range i i return true else if this intersects interval curr return true return false
tests to see if this range contains any element
public void set int x int y int width int height int rotation data new int x y width height rotation 360 clean parameters init poly
directly change the value of this oriented box
public void action performed action event event try if import export get start directory null import export set start directory get last directory if import export import config get viper data set last directory import export get start directory catch ioexception e logger log level severe error while attempting to import config from a file e
imports a user specified file into the current file
public string to string return data 0 data 1 data 2 data 3 data 4
gets a string representation of the oriented box