com.ail.core
Class VersionEffectiveDate

java.lang.Object
  extended by com.ail.core.Type
      extended by com.ail.core.VersionEffectiveDate
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class VersionEffectiveDate
extends Type

VersionEffectiveDates are used to select the configuration a CoreUser should be using. Configurations are stored with date stamps, when a client (CoreUser) requests some information from configuration their VersionEffectiveDate is used to select the appropriate version from those stored.

VersionEffectiveDates are always based on the UTC timezone.

Version:
$Revision: 1.2 $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ail.core.Type
jXPathContext, NOT_PERSISTED
 
Constructor Summary
VersionEffectiveDate()
          Construct a VersionEffectiveDate representing the time now.
VersionEffectiveDate(java.util.Date ved)
          Create a VersionEffectiveDate based on another Date object.
VersionEffectiveDate(long time)
          Create a VersionEffectiveDate based on a time.
 
Method Summary
 boolean after(VersionEffectiveDate when)
          Tests if this date is after the specified date.
 boolean before(VersionEffectiveDate when)
          Tests if this date is before the specified date
 int compareTo(VersionEffectiveDate that)
          Compare this VEDs with another.
 boolean equals(java.lang.Object o)
          Compares two dates for equality.
 java.util.Date getDate()
          Get the Date object represented by this VersionEffectiveDate.
 long getTime()
          Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this VersionEffectiveDate object.
 void setTime(long time)
          Set the time property.
 java.lang.String toString()
           
 
Methods inherited from class com.ail.core.Type
addAttribute, clone, deleteLock, deleteSerialVersion, fetchJXPathContext, getAttribute, getAttribute, getAttributeCount, getForeignSystemId, getLock, getSerialVersion, getSystemId, hasLock, hasSerialVersion, hasSystemId, isPersisted, markAsNotPersisted, mergeWithDataFrom, removeAttribute, removeAttribute, setAttribute, setForeignSystemId, setLock, setSerialVersion, setSystemId, xpathGet, xpathGet, xpathIterate, xpathSet
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VersionEffectiveDate

public VersionEffectiveDate()
Construct a VersionEffectiveDate representing the time now.


VersionEffectiveDate

public VersionEffectiveDate(java.util.Date ved)
Create a VersionEffectiveDate based on another Date object. The date supplied is used "as is" - no attempt is made to adjust it to UTC.

Parameters:
ved - Date to base this VersionEffectiveDate on.

VersionEffectiveDate

public VersionEffectiveDate(long time)
Create a VersionEffectiveDate based on a time. Where time is milliseconds since epoc.

Parameters:
time -
Method Detail

before

public boolean before(VersionEffectiveDate when)
Tests if this date is before the specified date

Parameters:
when - A date
Returns:
true if and only if the instant of time represented by this VersionEffectiveDate object is strictly earlier than the instant represented by when; false otherwise.

after

public boolean after(VersionEffectiveDate when)
Tests if this date is after the specified date.

Parameters:
when - A date
Returns:
true if and only if the instant represented by this VersionEffectiveDate object is strictly later than the instant represented by when; false otherwise.

getTime

public long getTime()
Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this VersionEffectiveDate object.

Returns:
the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this VersionEffectiveDate.

setTime

public void setTime(long time)
Set the time property. This represents the number of milliseconds since epoc.

Parameters:
time - milliseconds since epoc

getDate

public java.util.Date getDate()
Get the Date object represented by this VersionEffectiveDate.

Returns:
Date object.

equals

public boolean equals(java.lang.Object o)
Compares two dates for equality. The result is true if and only if the argument is not null and is a VersionEffectiveDate object that represents the same point in time, to the millisecond, as this object.

Thus, two VersionEffectiveDate objects are equal if and only if the getTime method returns the same long value for both.

Overrides:
equals in class java.lang.Object
Parameters:
o - The object to compare with.
Returns:
true if the objects are the same; false otherwise.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a string representation of this VersionEffectiveDate
See Also:
Date.toString()

compareTo

public int compareTo(VersionEffectiveDate that)
Compare this VEDs with another.

Parameters:
that - VED to compare with.
Returns:
the value 0 if the argument Date is equal to this Date; a value less than 0 if this Date is before the Date argument; and a value greater than 0 if this Date is after the Date argument.