com.timeindexing.time
Class NanosecondTimestamp

java.lang.Object
  extended bycom.timeindexing.time.NanosecondTimestamp
All Implemented Interfaces:
Absolute, AbsoluteTimestamp, NanosecondScale, Scale, java.io.Serializable, Timestamp, Value

public class NanosecondTimestamp
extends java.lang.Object
implements AbsoluteTimestamp, NanosecondScale, java.io.Serializable

A timestamp that only has significant data down to nanosecond level.

See Also:
Serialized Form

Field Summary
static long BEFORE_EPOCH
           
 
Fields inherited from interface com.timeindexing.time.Timestamp
ELAPSED_MICROSECOND, ELAPSED_MICROSECOND_SIGN, ELAPSED_MILLISECOND, ELAPSED_MILLISECOND_SIGN, ELAPSED_NANOSECOND, ELAPSED_NANOSECOND_SIGN, ELAPSED_SECOND, ELAPSED_SECOND_SIGN, ELAPSED_UNITS, ELAPSED_UNITS_SIGN, EXTENDED, EXTENDED_2, EXTENDED_3, EXTENDED_4, MICROSECOND, MICROSECOND_SIGN, MILLISECOND, MILLISECOND_SIGN, NANOSECOND, NANOSECOND_SIGN, SECOND, SECOND_SIGN, SPARE_3E, SPARE_3E_SIGN, SPARE_FD, SPARE_FD_SIGN, SPARE_FE, SPARE_FE_SIGN, TOP_2_MASK, TOP_4_MASK, TOP_6_MASK, TOP_8_MASK, ZERO
 
Fields inherited from interface com.timeindexing.time.NanosecondScale
SCALE
 
Constructor Summary
NanosecondTimestamp()
          Construct a NanosecondTimestamp with 'now' as the timestamp.
NanosecondTimestamp(java.util.Date date)
          Construct a NanosecondTimestamp from a Date object.
NanosecondTimestamp(long ts)
          Construct a NanosecondTimestamp from a number of nanoseconds.
NanosecondTimestamp(long seconds, int nanoseconds)
          Construct a NanosecondTimestamp from a number of seconds and a number of nanoseconds.
 
Method Summary
 int getNanoSeconds()
          Get the number of nanoseconds for this timestamp
 Scale getScale()
          Get the Scale.
 long getSeconds()
          Get the number of seconds
 boolean isAfterEpoch()
          Is the time after the Epoch.
 boolean isBeforeEpoch()
          Is the time before the Epoch.
 java.lang.String toString()
          Get the toString() version of a NanosecondTimestamp.
 long value()
          Get the raw value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BEFORE_EPOCH

public static final long BEFORE_EPOCH
See Also:
Constant Field Values
Constructor Detail

NanosecondTimestamp

public NanosecondTimestamp()
Construct a NanosecondTimestamp with 'now' as the timestamp. The Java runtime currently goes down to milliseconds, so these are a bit inaccurate.


NanosecondTimestamp

public NanosecondTimestamp(long ts)
Construct a NanosecondTimestamp from a number of nanoseconds.


NanosecondTimestamp

public NanosecondTimestamp(long seconds,
                           int nanoseconds)
Construct a NanosecondTimestamp from a number of seconds and a number of nanoseconds.


NanosecondTimestamp

public NanosecondTimestamp(java.util.Date date)
Construct a NanosecondTimestamp from a Date object. The Java runtime currently goes down to milliseconds, so these are a bit inaccurate.

Method Detail

getSeconds

public long getSeconds()
Get the number of seconds

Specified by:
getSeconds in interface Timestamp

getNanoSeconds

public int getNanoSeconds()
Get the number of nanoseconds for this timestamp

Specified by:
getNanoSeconds in interface Timestamp

getScale

public Scale getScale()
Get the Scale.

Specified by:
getScale in interface Timestamp

toString

public java.lang.String toString()
Get the toString() version of a NanosecondTimestamp. This formats the first day specially.


value

public long value()
Get the raw value. Used in other parts of the implementation.

Specified by:
value in interface Value

isAfterEpoch

public boolean isAfterEpoch()
Is the time after the Epoch.

Specified by:
isAfterEpoch in interface AbsoluteTimestamp

isBeforeEpoch

public boolean isBeforeEpoch()
Is the time before the Epoch.

Specified by:
isBeforeEpoch in interface AbsoluteTimestamp