ostore.introspect
Class SimpleRealTime

java.lang.Object
  |
  +--ostore.introspect.SimpleRealTime
All Implemented Interfaces:
Comparable, QuickSerializable, Time

public class SimpleRealTime
extends Object
implements Time

Implements time with real time.

Version:
$Id: SimpleRealTime.java,v 1.5 2003/04/03 01:10:22 jeffpang Exp $
Author:
Jeff Pang

Nested Class Summary
static class SimpleRealTime.Distance
          Metric distance between two SimpleRealTimes.
 
Nested classes inherited from class ostore.introspect.Time
Time.NeverTime
 
Field Summary
 
Fields inherited from interface ostore.introspect.Time
NEVER
 
Constructor Summary
SimpleRealTime(Date time)
          Constructor.
SimpleRealTime(InputBuffer buffer)
           
SimpleRealTime(long time)
          Constructor.
SimpleRealTime(NodeId nodeId)
          Construct a time for now.
SimpleRealTime(QSDate time)
          Constructor.
 
Method Summary
 int compareTo(Object other)
           
 Distance difference(Time to)
          Distance from this Time to to time.
 boolean equals(Object other)
           
 void serialize(OutputBuffer buffer)
          Add the object to the buffer.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleRealTime

public SimpleRealTime(NodeId nodeId)
Construct a time for now.

Parameters:
nodeId - the id of the current node. This is required if we are using soss to simulate time. Otherwise it can be null or bogus (we just use the physical real time).

SimpleRealTime

public SimpleRealTime(QSDate time)
Constructor.

Parameters:
time - the time to construct this with

SimpleRealTime

public SimpleRealTime(Date time)
Constructor.

Parameters:
time - the time to construct this with

SimpleRealTime

public SimpleRealTime(long time)
Constructor.

Parameters:
time - the time to construct this with

SimpleRealTime

public SimpleRealTime(InputBuffer buffer)
               throws QSException
Method Detail

serialize

public void serialize(OutputBuffer buffer)
Description copied from interface: QuickSerializable
Add the object to the buffer.

Specified by:
serialize in interface QuickSerializable
Parameters:
buffer - the output buffer to add the object to

compareTo

public int compareTo(Object other)
Specified by:
compareTo in interface Comparable

equals

public boolean equals(Object other)
Overrides:
equals in class Object

difference

public Distance difference(Time to)
Description copied from interface: Time
Distance from this Time to to time.

Specified by:
difference in interface Time
Parameters:
to - next time
Returns:
|to - this| distance

toString

public String toString()
Overrides:
toString in class Object