edu.iris.Fissures.model
Class MicroSecondDate

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

public class MicroSecondDate
extends java.util.Date
implements java.io.Serializable

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

See Also:
Serialized Form

Field Summary
protected  LeapSecondHistory leapHistory
           
protected  int leapSecondVersion
           
protected  long microseconds
           
 
Constructor Summary
MicroSecondDate()
           
MicroSecondDate(java.util.Date d)
           
MicroSecondDate(long microseconds)
           
MicroSecondDate(long microseconds, int leapSeconds)
           
MicroSecondDate(MicroSecondDate d)
           
MicroSecondDate(java.lang.String isoTimeString)
           
MicroSecondDate(edu.iris.Fissures.Time t)
           
MicroSecondDate(java.sql.Timestamp ts)
           
MicroSecondDate(java.sql.Timestamp ts, int leapSeconds)
           
 
Method Summary
 MicroSecondDate add(TimeInterval interval)
           
 boolean after(java.util.Date otherDate)
           
 boolean before(java.util.Date otherDate)
           
 TimeInterval difference(MicroSecondDate otherDate)
          Returns the TimeInterval between the two times.
 boolean equals(java.lang.Object otherDate)
           
 edu.iris.Fissures.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()
           
 java.sql.Timestamp getTimestamp()
           
 int hashCode()
           
 TimeInterval subtract(MicroSecondDate otherDate)
          Returns the timewidth of this - otherDate.
 MicroSecondDate subtract(TimeInterval interval)
           
 java.lang.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(java.util.Date d)

MicroSecondDate

public MicroSecondDate(MicroSecondDate d)

MicroSecondDate

public MicroSecondDate(java.sql.Timestamp ts,
                       int leapSeconds)

MicroSecondDate

public MicroSecondDate(java.sql.Timestamp ts)

MicroSecondDate

public MicroSecondDate(edu.iris.Fissures.Time t)

MicroSecondDate

public MicroSecondDate(java.lang.String isoTimeString)
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 java.sql.Timestamp getTimestamp()

getFissuresTime

public edu.iris.Fissures.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(java.lang.Object otherDate)
Overrides:
equals in class java.util.Date

hashCode

public int hashCode()
Overrides:
hashCode in class java.util.Date

after

public boolean after(java.util.Date otherDate)
Overrides:
after in class java.util.Date

before

public boolean before(java.util.Date otherDate)
Overrides:
before in class java.util.Date

toString

public java.lang.String toString()
Overrides:
toString in class java.util.Date