org.at4j.support.util
Class WinNtTime

java.lang.Object
  extended by org.at4j.support.util.WinNtTime
All Implemented Interfaces:
Serializable, Comparable<WinNtTime>

public class WinNtTime
extends Object
implements Serializable, Comparable<WinNtTime>

This object represent Windows NT time. The time value is an unsigned 64-bit value (an UnsignedLong) that counts all 100 nanosecond intervals that have passed since midnight January 1, 1601 UTC.

Instances of this class are immutable.

Since:
1.0
Author:
Karl Gustafsson
See Also:
Serialized Form

Constructor Summary
WinNtTime(Date d)
          Create a new WinNtTime from the Date value.
WinNtTime(UnsignedLong t)
          Create a new WinNtTime from the numerical value.
 
Method Summary
 int compareTo(WinNtTime t2)
           
 boolean equals(Object o)
           
 Date getDate()
          Get this Windows NT time value as a Date value.
 UnsignedLong getTime()
          Get the time as an unsigned long.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WinNtTime

public WinNtTime(UnsignedLong t)
Create a new WinNtTime from the numerical value.

Parameters:
t - The time value.

WinNtTime

public WinNtTime(Date d)
Create a new WinNtTime from the Date value.

Parameters:
d - The date.
Method Detail

getTime

public UnsignedLong getTime()
Get the time as an unsigned long.

Returns:
The time as an unsigned long.

getDate

public Date getDate()
             throws UnableToConvertException
Get this Windows NT time value as a Date value.

Returns:
A Date value.
Throws:
UnableToConvertException - If the Windows NT time value is outside the range of Java's Date.

compareTo

public int compareTo(WinNtTime t2)
Specified by:
compareTo in interface Comparable<WinNtTime>

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object