com.timeindexing.appl
Class TimeParser

java.lang.Object
  extended bycom.timeindexing.appl.TimeParser

public class TimeParser
extends java.lang.Object

Parses a time from a given input.


Constructor Summary
TimeParser()
          Construct a TimeParser.
 
Method Summary
 Timestamp parse(java.lang.String timeArg, boolean absolute)
          Parse timestamps given as a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeParser

public TimeParser()
Construct a TimeParser.

Method Detail

parse

public Timestamp parse(java.lang.String timeArg,
                       boolean absolute)
Parse timestamps given as a String. Absolute or relative timestamps can be specified.

The timestamps are of the format "time.subseconds" Formats processed for time are:

The returned Timestamp is at a resolution based on the resolution of the passed in string. Formats for subseconds can resolve down to nanoseconds. e.g. .2 is 2/10ths of a seconds, .200 is 200 milliseconds, .25000 is 25000 microseconds, and so on.

Parameters:
absolute - should the timestamp be parsed as an absolute time or a relative time.
Returns:
a Timestamp object if the input is valid, null otherwise.