input
stringlengths
10
828
output
stringlengths
5
107
public void set tag string tag string tag tag string
set the tag for this document filter
private void set body class string css class body class css class
set the html class for the body of the document
public string to tag string string builder buf new string builder set string tags new hash set string for doc filter term terms if term get tag null tags add term get tag else if term instanceof tree clause tree clause term is and tags add term to string else tags add term to string for string tag tags buf append tag buf append and and or buf set length buf length 5 return buf to string
return a string representation replacing any clauses with their tags
public void add key string key keys put key null
adds a key to the document metadata
public void add key string key object value keys put key value
adds a key to the document metadata with an associated value
public void set body tag string tag body tag tag
set the body tag
public void add key map map string extends object key map keys put all key map
add a group of keys with values to this doc data object
public int calculate similarity doc data doc set string my keys new hash set string keys key set my keys retain all doc get keys return my keys size
calculate similarity between this doc data and another doc data object
public void clear keys keys clear
clears the keys associated with this doc data object
public void set strict flag boolean flag strict flag
set the strict flag
public void set body tag string tag string tag class body tag tag body class tag class
set the body tag and class
public int compare to time span span int comp 0 date span start span get start date date span stop span get stop date comp start compare to span start if comp 0 comp stop compare to span stop return comp
compares two different time spans
public boolean contains date test date return test date equals start test date after start test date before stop
tests whether the given date is within this time span
public object get value for key string key return keys get key
gets the value associated with a key
public long get duration return stop get time start get time
calculates the duration of this time span
public void set section tag string tag section tag tag
set the section tag
public boolean load content return true
loads the content keys and other fields for this document
public date get stop date return stop
returns the stop date of the time span
public boolean matches key string key return keys contains key key
determines if this doc data matches the specified key
public time span intersect time span span date new start start before span get start date span get start date start date new stop stop after span get stop date span get stop date stop time span new span new start after new stop null new time span new start new stop return new span
finds when this time span and another time span are both active
public void set body string doc body body doc body
set the document body
public boolean is instantaneous return start equals stop
return whether this time span is instantaneous
public void set link string link string link link string
set the link associated with this record
public void set summary string doc summary summary doc summary
sets the summary
public void set center geo coord coord center coord
sets the center
public void set name string loc name name loc name
sets the name
public void set time stamp date date time stamp date
set the timestamp for the document
public void set radius double loc radius radius loc radius
set the radius of the geographic entity
public void add time segment date start date stop spans add new time span start stop
add a time segment to this record specifying start and stop times
public void add time segment date start long duration add time segment start new date start get time duration
add a time segment to this record specifying start time and duration
public void add time span time span span spans add span
add a time span to this record
public date get active start time date time time span active null for time span span spans if span contains time active span return active get start date
gets the start time of the time segment that includes tt time tt
public date get active stop time date time time span active null for time span span spans if span contains time active span return active get stop date
gets the stop time of the time segment that includes tt time tt
public date get earliest time return spans first get start date
get the earliest time that this record is active
public url get thumbnail return thumbnail
get the url for the thumbnail for this rss item
public date get latest time return spans last get stop date
get the latest time that this record is active
public boolean is active date test date boolean active false for time span span spans active span contains test date return active
determine whether the record is active at a particular time
public boolean is active long millis return is active new date millis
determine whether the record is active at a particular time
public int compare to measure other if other get measure type equals get measure type throw new class cast exception mismatch of unit types get measure type and other get measure type both measuring the same type eg both are distamce unit other unit other get unit double base value unit get convert factor double comp other get value other unit get convert factor return base compare to comp
return if the object is greater than less than or equal to this
public measure convert to unit other unit if other unit get class equals unit get class throw new illegal argument exception other unit incompatible with unit double new value value unit get convert factor other unit get convert factor return new measure new value other unit
convert to another compatible unit of measure
public string get measure type string class name unit get class get name if class name ends with unit class name class name substring 0 class name length 4 return class name
gets the measure type
public void add time segment date start long duration spans add new time span start new date start get time duration
adds a time segment a start stop time to the sequences list of
public void set title tag string tag title tag tag
set the title tag
public boolean is equal to measure other unit other unit other get unit both measuring the same type eg both are distamce double base value unit get convert factor double comp other get value other unit get convert factor return base comp other get class equals unit get class
checks this measure is equal to another measure
public date get active start time date time date start date null for time span span spans if span contains time start date span get start date return start date
gets the start time of the time segment that includes tt time tt
public date get active stop time date time date stop date null for time span span spans if span contains time stop date span get stop date return stop date
gets the stop time of the time segment that includes tt time tt
public date get earliest time the earliest time should be the first time span s start date time span early spans first return early null early get start date null
returns the earliest time that this sequence is active
public date get latest time the latest time should be the first time span s stop date time span late spans last return late null late get stop date null
returns the latest time that this sequence is active
public void add enum field value string field name string field value validate field type field name data type enum if enm data null enm data new multi value map string enm data add field value field name field value
add an enumerated value to the given field
public html doc data template doc data url url html doc data new data new html doc data url new data set title tag title tag new data set body tag body tag new data set body class body class new data set section tag section tag new data set time stamp tag time stamp tag ts formats return new data
create a new html doc data object from the provided url using this
public color get draw color return draw color
gets the draw color
public marker icon get marker icon return marker icon
get the icon for representing markers
public shape get marker shape return marker shape
gets the marker shape
public string get name return style name
gets the name
public void set draw color color color draw color color
sets the draw color
public void add int field value string field name integer field value validate field type field name data type int if int data null int data new multi value map integer int data add field value field name field value
add an integer value to the given field
public void set marker icon marker icon icon marker icon icon
set the icon for representing markers
public void set marker shape shape shape marker shape shape
sets the marker shape
public double get azimuth geo coord target point double dist get distance radians target point double azimuth 0 if dist 0 double dlon target point get lon radians lon rad double lat2 target point get lat radians azimuth math atan2 math cos lat rad math cos lat2 math sin dlon math sin lat2 math cos dist math sin lat rad if azimuth 0 azimuth math pi 2 return azimuth deg2 rad
returns the azimuth measured from true north to the target point
private int calculate resolution long span get duration int resolution 1 if span 94608000000 l resolution calendar year else if span 7776000000 l resolution calendar month else if span 1814400000 resolution calendar week of year else if span 259200000 resolution calendar date else if span 10800000 resolution calendar hour else if span 180000 resolution calendar minute else if span 1000 resolution calendar second return resolution
calculate the time interval based upon the start and stop time
public void add location field value string field name location field value validate field type field name data type location if loc data null loc data new multi value map location loc data add field value field name field value
add a location value to the given field
public geo coord get bearing point double distance double azimuth double dist distance earth radius in earth radii double azi azimuth deg2 rad return get bearing point radians dist azi
returns a new geo coord at the specified distance and azimuth from this
private void generate segments segments clear if interval 1 calendar rolling calendar get instance rolling set time start time while rolling get time before stop time date start rolling get time rolling add interval 1 date stop new date rolling get time get time time span segment new time span start stop segments add segment else if seg millis 0 date rolling new date start time get time while rolling before stop time date next new date rolling get time seg millis time span segment new time span rolling next segments add segment rolling next
generate the segments
public geo coord get bearing point radians double dist double azi double sin bear math sin lat rad math cos dist math cos azi math cos lat rad math sin dist double lat2 math asin sin bear double lon2 math atan2 math sin azi math sin dist math cos lat rad math cos dist math sin lat rad sin bear math sin lat rad math sin lat2 lon2 lon rad if lon2 math pi lon2 math pi 2 else if lon2 math pi lon2 math pi 2 return new geo coord lat2 deg2 rad lon2 deg2 rad
returns a new geo coord at the specified distance and azimuth from this
public void add measure field value string field name measure field value validate field type field name data type measure if msr data null msr data new multi value map measure msr data add field value field name field value
add a measure value to the given field
public double get distance geo coord target point return get distance radians target point earth radius
returns the distance from this coordinate to the target point
public time span get containing segment date date time span containing null for time span segment segments if segment contains date containing segment return containing
return the segment containing the specified date
public double get distance radians geo coord target point double dlon target point get lon radians lon rad double lat2 target point get lat radians use cosine rule for sides to compute arc distance double cos er math sin lat rad math sin lat2 math cos lat rad math cos lat2 math cos dlon return math acos cos er
returns the distance from this coordinate to the target point
public time span get containing segment time span span time span containing null for time span segment segments if segment contains span get start date containing segment return containing
return the segment containing the start time of the span
public void add text field value string field name string field value validate field type field name data type text if str data null str data new multi value map string str data add field value field name field value
add a text value to the given field
private string buffer get dmsstring double value double sec val math abs value 3600 0 long secs math round sec val long degrees secs 3600 secs degrees 3600 long minutes secs 60 secs minutes 60 string buffer deg str new string buffer deg str append degrees if minutes 10 deg str append 0 minutes else deg str append minutes if secs 10 deg str append 0 secs else deg str append secs return deg str
converts the value to a string in ddmmss format
public date get segment start date return start time
return the start date of the set of time segments
public void add time field value string field name time span field value validate field type field name data type time if tim data null tim data new multi value map time span tim data add field value field name field value
add a time value to the given field
public date get segment stop date return stop time
return the stop date of the set of time segments
public double get lat radians return lat rad
returns the latitude in radians
public void set segment size long millis seg millis millis interval 1 calculate span generate segments
set the segment size explicitly
public string get lat string string buffer deg str get dmsstring lat if lat 0 deg str append s else deg str append n return deg str to string
returns the latitude of this coordinate in ddmmss format with either n
public string get enum field string field name string value null if enm data null set string vals enm data get field name if vals null value vals iterator next return value
gets the value for a particular enumerated value field
public void set time interval int time interval interval time interval seg millis 1 calculate span generate segments
set the time interval explicitly
public double get lon radians return lon rad
returns the longitude in degrees
public string get lon string string buffer deg str get dmsstring lon if lon 0 deg str append w else deg str append e return deg str to string
returns the longitude of this coordinate in dddmmss format with either
public data type get field type string field name return field types get field name
get the type of data for this field
public void set altitude double altitude alt altitude
set the altitude of this geo coord
public double get float field string field name measure value null if msr data null value msr data get field field name if value null throw new illegal argument exception field not set field name return value get value
gets the value for a particular floating point field
private integer parse string string string val throws parse exception long value null try value new long string val catch number format exception exc if value null try value long cardinal parse string val catch exception exc if value null try value long mixed parse string val catch exception exc if value null throw new parse exception cannot parse string string val into an integer 0 return value int value
use the different number formats sequentially to try to parse the string
public void set lenient boolean flag lenient flag
set whether this field descriptor enforces strict or lenient parsing
public void set altitude measure altitude if altitude get measure type equals length alt altitude get value altitude get unit get convert factor
set the altitude of this geo coord using a linear measurement
public element to xml document doc element elem doc create element grid elem set attribute name name string buffer cell buf new string buffer for string cls name cell classes if cell buf length 0 cell buf append cell buf append cls name elem set attribute cell class cell buf to string return elem
convert this specification into xml format
public int get int field string field name integer value null if int data null value int data get field field name if value null throw new illegal argument exception field not set field name return value
gets the value for a particular integer field
public location get location field string field name location value null if loc data null value loc data get field field name return value
gets the value for a particular location field
public measure get measure field string field name measure value null if msr data null value msr data get field field name return value
gets the value for a particular measure field
public string get date pattern return format to pattern
get the date format pattern string used to parse or format dates
public string get duration field return duration field
get the field to be used to identify the duration field within the
public string get text field string field name string value null if str data null value str data get field field name return value
gets the value for a particular text field
public simple date format get format return format
return the format used to parse and write values
public rdf thing get object return object
get the object for this triple
public time span get time field string field name time span value null if tim data null value tim data get field field name return value
gets the value for a particular time field
public boolean is span field return src start field null src stop field null duration field null
return whether this field specifies a span
public rdf thing get subject return subject
get the subject for this triple
public triple type get type return type
get the relationship type