kiwi.util
Class DateHolder

java.lang.Object
  extended bykiwi.util.HolderObject
      extended bykiwi.util.DateHolder

public class DateHolder
extends HolderObject

A mutable holder for a Date value.

Author:
Mark Lindner, PING Software Group

Field Summary
protected  java.util.Date value
          The current value.
 
Fields inherited from class kiwi.util.HolderObject
subtype
 
Constructor Summary
DateHolder()
          Construct a new DateHolder with an initial value of the current date and time, and a default subtype of FormatConstants.DATE_FORMAT.
DateHolder(java.util.Date value)
          Construct a new DateHolder with a specified initial value, and a default subtype of FormatConstants.DATE_FORMAT.
DateHolder(java.util.Date value, int subtype)
          Construct a new DateHolder with a specified initial value and subtype.
 
Method Summary
 int compareTo(HolderObject other)
          Compare this holder object to another.
 java.util.Date getValue()
          Get the DateHolder's value.
 void setValue(java.util.Date value)
          Set the DateHolder's value.
 java.lang.String toString()
          Get a string representation for this object.
 
Methods inherited from class kiwi.util.HolderObject
getSubtype, setSubtype
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

protected java.util.Date value
The current value.

Constructor Detail

DateHolder

public DateHolder()
Construct a new DateHolder with an initial value of the current date and time, and a default subtype of FormatConstants.DATE_FORMAT.

See Also:
kiwi.text.FormatConstants

DateHolder

public DateHolder(java.util.Date value)
Construct a new DateHolder with a specified initial value, and a default subtype of FormatConstants.DATE_FORMAT.

Parameters:
value - The initial value.

DateHolder

public DateHolder(java.util.Date value,
                  int subtype)
Construct a new DateHolder with a specified initial value and subtype. A subtype is particularly useful for a Date object, since it may be used to specify which part of the value is significant (such as the date, the time, or both).

Parameters:
value - The initial value.
Method Detail

setValue

public final void setValue(java.util.Date value)
Set the DateHolder's value.

Parameters:
value - The new value.

getValue

public final java.util.Date getValue()
Get the DateHolder's value.

Returns:
The current value.

toString

public java.lang.String toString()
Get a string representation for this object.


compareTo

public int compareTo(HolderObject other)
Compare this holder object to another.

Specified by:
compareTo in class HolderObject
Parameters:
other - The HolderObject to compare against.
Returns:
-1 if this object is "less than" the other object; 1 if this object is "greater than" the other object, and 0 if the objects are "equal."