edu.iris.Fissures.model
Class MicroSecondDate

java.lang.Object
  extended by java.util.Date
      extended by edu.iris.Fissures.model.MicroSecondDate
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Date>

public class MicroSecondDate
extends Date
implements Serializable

subclass of the java.util.Date class to extend the precision to microseconds and to eventually handle leap seconds.

Author:
H. Philip Crotwell
See Also:
Serialized Form

Field Summary
protected  LeapSecondHistory leapHistory
           
protected  int leapSecondVersion
           
protected  long microseconds
           
 
Constructor Summary
MicroSecondDate()
           
MicroSecondDate(Date d)
           
MicroSecondDate(long microseconds)
           
MicroSecondDate(long microseconds, int leapSeconds)
           
MicroSecondDate(MicroSecondDate d)
           
MicroSecondDate(Time t)
           
MicroSecondDate(Timestamp ts)
           
MicroSecondDate(Timestamp ts, int leapSeconds)
           
 
Method Summary
 MicroSecondDate add(TimeInterval interval)
           
 boolean after(Date otherDate)
           
 boolean before(Date otherDate)
           
 TimeInterval difference(MicroSecondDate otherDate)
          Returns the TimeInterval between the two times.
 boolean equals(Object otherDate)
           
 Time getFissuresTime()
           
 int getLeapSecondVersion()
           
 long getMicroSeconds()
          Returns the microseconds as a number between 0 and 999, the milliseconds are kept in the Date superclass.
 long getMicroSecondTime()
           
 Timestamp getTimestamp()
           
 int hashCode()
           
 TimeInterval subtract(MicroSecondDate otherDate)
          Returns the timewidth of this - otherDate.
 MicroSecondDate subtract(TimeInterval interval)
           
 String toString()
           
 
Methods inherited from class java.util.Date
clone, compareTo, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, parse, setDate, setHours, setMinutes, setMonth, setSeconds, setTime, setYear, toGMTString, toLocaleString, UTC
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

microseconds

protected long microseconds

leapSecondVersion

protected int leapSecondVersion

leapHistory

protected LeapSecondHistory leapHistory
Constructor Detail

MicroSecondDate

public MicroSecondDate()

MicroSecondDate

public MicroSecondDate(long microseconds)

MicroSecondDate

public MicroSecondDate(long microseconds,
                       int leapSeconds)

MicroSecondDate

public MicroSecondDate(Date d)

MicroSecondDate

public MicroSecondDate(MicroSecondDate d)

MicroSecondDate

public MicroSecondDate(Timestamp ts,
                       int leapSeconds)

MicroSecondDate

public MicroSecondDate(Timestamp ts)

MicroSecondDate

public MicroSecondDate(Time t)
Method Detail

getMicroSecondTime

public long getMicroSecondTime()

getMicroSeconds

public long getMicroSeconds()
Returns the microseconds as a number between 0 and 999, the milliseconds are kept in the Date superclass.

Returns:
the microseconds as a number between 0 and 999.

getTimestamp

public Timestamp getTimestamp()

getFissuresTime

public Time getFissuresTime()

getLeapSecondVersion

public int getLeapSecondVersion()

add

public MicroSecondDate add(TimeInterval interval)

subtract

public MicroSecondDate subtract(TimeInterval interval)

subtract

public TimeInterval subtract(MicroSecondDate otherDate)
Returns the timewidth of this - otherDate.


difference

public TimeInterval difference(MicroSecondDate otherDate)
Returns the TimeInterval between the two times. It is always positive regardless of which time comes before the other.


equals

public boolean equals(Object otherDate)
Overrides:
equals in class Date

hashCode

public int hashCode()
Overrides:
hashCode in class Date

after

public boolean after(Date otherDate)
Overrides:
after in class Date

before

public boolean before(Date otherDate)
Overrides:
before in class Date

toString

public String toString()
Overrides:
toString in class Date


Copyright © 1999-2007 The IRIS Consortium. All Rights Reserved.