TimeParser designed to quickly parse strings with a known format. This parser has been shown to perform around 20 times faster than the discovery parser. This class is not thread-safe, so clients must make sure that only one thread accesses the class at a time.
$Y-$m-$dT$H:$M:$S.$(subsec;places=3)Z
handy FieldHandler that ignores the contents. For example,
tp= TimeParser.create(sagg,"v", TimeParser.IGNORE_FIELD_HANDLER );
return the field handler for the id. For example, enum returns the field handler handling enumerations. Note there is currently only one field handler for each type, so for example two enumerations are not allowed.
return the field handler for the id. For example, enum returns the field handler handling enumerations. Note there is currently only one field handler for each type, so for example two enumerations are not allowed.
return the pad for the spec, like "underscore" "space" "zero" or "none" For "none", space is returned, and clients allowing special behavior should check for this.
return the parsed time in the given units. Here Autoplot
Jython code shows how this is used:
from org.virbo.dataset import SemanticOps
tp= TimeParser.create("$Y-$m-$dT$H")
u= SemanticOps.lookupTimeUnits("seconds since 2014-01-01T00:00")
print tp.parse("2014-01-06T02").getTime( u )
return the parsed time as a Datum. For years less than 1990, Units.us1980 is used, otherwise Units.us2000 is used.
return true if the string appears to be an ISO8601 time. This requires that the string contain a "T" or space and the hours and minutes components.
return true if each successive field is nested within the previous, e.g. $Y$m/$d is nested, but $Y$m/$Y$m$d is not because of the second $Y.
Provide standard means of indicating this appears to be a spec by looking for something that would assert the year.
true if the flag (startTimeOnly) was set in the spec. This is a hint to clients (FileStorageModel) using the time that it shouldn't infer that the time is bounded.
must contain T or space to delimit date and time.
set the digit with the integer part, and move the fractional part to the less significant digits. Format should contain just one field, see setDigit( String format, int value ) to break up fields.
force the parser to look for delimiters. This should be called immediately after
test time parsing when the format is known. This time parser is much faster than the time parser of Test009, which must infer the format as it parses.