kiwi.util
Class DateHolder
java.lang.Object
|
+--kiwi.util.HolderObject
|
+--kiwi.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. |
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 java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
value
protected java.util.Date value
- The current value.
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.
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.
- Overrides:
toString
in class java.lang.Object
compareTo
public int compareTo(HolderObject other)
- Compare this holder object to another.
- Overrides:
compareTo
in class HolderObject
- Following copied from class:
kiwi.util.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."