com.wles.util
Class Time

java.lang.Object
  extended byjava.util.Date
      extended bycom.wles.util.Time
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, java.io.Serializable

public class Time
extends java.util.Date

Used to represent ALES time values. This class extends java.util.Date but only the time portion is utilized. java.util.Date can be used directly to specify ALES date values, but the time portion will not be utilized.

See Also:
Serialized Form

Constructor Summary
Time()
          Constructs a Time object with the current time.
Time(java.util.Date date)
          Constructs a Time object with the specified time.
Time(long time)
          Constructs a Time object with the specified time.
 
Method Summary
 boolean after(java.util.Date when)
          Compares a java Date object to this Time object.
 boolean before(java.util.Date when)
          Compares a java Date object to this Time object.
 int compareTo(java.util.Date when)
          Compares a java Date object to this Time object.
 int compareTo(Time when)
          Compares a java Date object to this Time object.
 boolean equals(java.lang.Object othat)
           
 void setTime(long time)
          Sets the time.
 java.lang.String toString()
          Returns the time as a string in ALES time format.
 
Methods inherited from class java.util.Date
clone, compareTo, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, hashCode, parse, setDate, setHours, setMinutes, setMonth, setSeconds, setYear, toGMTString, toLocaleString, UTC
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Time

public Time()
Constructs a Time object with the current time.


Time

public Time(java.util.Date date)
Constructs a Time object with the specified time.

Parameters:
date - the Java time value to copy the time from, date information will not be copied

Time

public Time(long time)
Constructs a Time object with the specified time.

Parameters:
time - seconds since epoch, January 1, 1970, 00:00:00 GMT
Method Detail

after

public boolean after(java.util.Date when)
Compares a java Date object to this Time object. The date data is ignored, only the time portion is considered.

Parameters:
when - time to compare against.
Returns:
true this is after when

before

public boolean before(java.util.Date when)
Compares a java Date object to this Time object. The date data is ignored, only the time portion is considered.

Parameters:
when - time to compare against.
Returns:
true this is before when

compareTo

public int compareTo(java.util.Date when)
Compares a java Date object to this Time object. The date data is ignored, only the time portion is considered.

Parameters:
when - time to compare against.
Returns:
0 if equal, <1 if this is < when, >1 if this is > when

compareTo

public int compareTo(Time when)
Compares a java Date object to this Time object. The date data is ignored, only the time portion is considered.

Parameters:
when - time to compare against.
Returns:
0 if equal, <1 if this is < when, >1 if this is > when

equals

public boolean equals(java.lang.Object othat)

setTime

public void setTime(long time)
Sets the time.

Parameters:
time - second since epoch, January 1, 1970, 00:00:00 GMT

toString

public java.lang.String toString()
Returns the time as a string in ALES time format.



Copyright © 2004-2008, Oracle and/or its affiliates. All rights reserved.