com.metsci.glimpse.plot.timeline.data
Class Epoch

java.lang.Object
  extended by com.metsci.glimpse.plot.timeline.data.Epoch

public class Epoch
extends java.lang.Object

A class encapsulating the conversion between absolute time specified as a TimeStamp and values on an Axis1D representing time.

Values on an Axis1D representing time are usually seconds since an epoch chosen to be close to the times of interest (in order to avoid numerical precision issues, particularly with OpenGL painters which deal with axis values as floats ).

Times Axis1D timeline are stored as seconds.

Author:
ulman

Constructor Summary
Epoch(TimeStamp epoch)
           
 
Method Summary
static Epoch currentTime()
           
 double fromTimeStamp(TimeStamp time)
          Converts a TimeStamp to a value along an Axis1D.
 TimeStamp getTimeStamp()
           
static Epoch posixEpoch()
           
 TimeStamp toTimeStamp(double axisValue)
          Converts a value along an Axis1D into an absolute time by interpreting the values along the Axis1D as offsets in seconds from the point in time represented by this Epoch.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Epoch

public Epoch(TimeStamp epoch)
Method Detail

posixEpoch

public static Epoch posixEpoch()

currentTime

public static Epoch currentTime()

getTimeStamp

public TimeStamp getTimeStamp()

toTimeStamp

public TimeStamp toTimeStamp(double axisValue)
Converts a value along an Axis1D into an absolute time by interpreting the values along the Axis1D as offsets in seconds from the point in time represented by this Epoch.

Parameters:
axisValue - a value returned by an Axis1D
Returns:
a TimeStamp representing an absolute time

fromTimeStamp

public double fromTimeStamp(TimeStamp time)
Converts a TimeStamp to a value along an Axis1D.

Parameters:
time - an absolute TimeStamp
Returns:
an Axis1D value
See Also:
toTimeStamp( double )


Copyright © 2012 Metron, Inc.. All Rights Reserved.