com.timeindexing.time
Class MPEGPresentationTimestamp

java.lang.Object
  extended bycom.timeindexing.time.MPEGPresentationTimestamp
All Implemented Interfaces:
NanosecondScale, Relative, RelativeTimestamp, Scale, java.io.Serializable, Timestamp, UnitBasedTimestamp, Value

public class MPEGPresentationTimestamp
extends java.lang.Object
implements RelativeTimestamp, UnitBasedTimestamp, NanosecondScale, java.io.Serializable

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

See Also:
Serialized Form

Field Summary
 
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
 
Constructor Summary
MPEGPresentationTimestamp()
          Construct a MPEGPresentationTimestamp with 'now' as the timestamp.
MPEGPresentationTimestamp(long valueTS)
          Construct a MPEGPresentationTimestamp from a number of units
MPEGPresentationTimestamp(long seconds, int nanoseconds)
          Construct a MPEGPresentationTimestamp from a number of seconds and a number of nanoseconds.
 
Method Summary
 int getNanoSeconds()
          Get the number of nanoseconds for this timestamp
 long getSeconds()
          Get the number of seconds
 long getUnits()
          Get the no of units that have elapsed.
 long getUnitsPerSecond()
          Get the no of units per second, for this kind of timestamp.
 boolean isNegative()
          Is the Timestamp negative.
 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
 

Constructor Detail

MPEGPresentationTimestamp

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


MPEGPresentationTimestamp

public MPEGPresentationTimestamp(long valueTS)
Construct a MPEGPresentationTimestamp from a number of units


MPEGPresentationTimestamp

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

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

getUnits

public long getUnits()
Get the no of units that have elapsed.

Specified by:
getUnits in interface UnitBasedTimestamp

getUnitsPerSecond

public long getUnitsPerSecond()
Get the no of units per second, for this kind of timestamp.

Specified by:
getUnitsPerSecond in interface UnitBasedTimestamp

toString

public java.lang.String toString()
Get the toString() version of a NanosecondTimestamp.


value

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

Specified by:
value in interface Value

isNegative

public boolean isNegative()
Is the Timestamp negative.