|
Java™ Platform Standard Ed. 6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.print.attribute.DateTimeSyntax
public abstract class DateTimeSyntax
Class DateTimeSyntax is an abstract base class providing the common implementation of all attributes whose value is a date and time.
Under the hood, a date-time attribute is stored as a value of class
java.util.Date
. You can get a date-time attribute's Date value by
calling
. A date-time attribute's
Date value is established when it is constructed (see getValue()
). Once
constructed, a date-time attribute's value is immutable.
DateTimeSyntax(Date)
To construct a date-time attribute from separate values of the year, month,
day, hour, minute, and so on, use a java.util.Calendar
object to construct a java.util.Date
object, then use the
java.util.Date
object to construct the date-time attribute.
To convert
a date-time attribute to separate values of the year, month, day, hour,
minute, and so on, create a java.util.Calendar
object and
set it to the java.util.Date
from the date-time attribute. Class
DateTimeSyntax stores its value in the form of a java.util.Date
rather than a java.util.Calendar
because it typically takes
less memory to store and less time to compare a java.util.Date
than a java.util.Calendar
.
Constructor Summary | |
---|---|
protected |
DateTimeSyntax(Date value)
Construct a new date-time attribute with the given java.util.Date value. |
Method Summary | |
---|---|
boolean |
equals(Object object)
Returns whether this date-time attribute is equivalent to the passed in object. |
Date |
getValue()
Returns this date-time attribute's java.util.Date
value. |
int |
hashCode()
Returns a hash code value for this date-time attribute. |
String |
toString()
Returns a string value corresponding to this date-time attribute. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected DateTimeSyntax(Date value)
java.util.Date
value.
value
- java.util.Date
value.
NullPointerException
- (unchecked exception) Thrown if theValue
is null.Method Detail |
---|
public Date getValue()
java.util.Date
value.
public boolean equals(Object object)
object
is not null.
object
is an instance of class DateTimeSyntax.
java.util.Date
value and
object
's java.util.Date
value are
equal.
equals
in class Object
object
- Object to compare to.
object
is equivalent to this date-time
attribute, false otherwise.Object.hashCode()
,
Hashtable
public int hashCode()
java.util.Date
value.
hashCode
in class Object
Object.equals(java.lang.Object)
,
Hashtable
public String toString()
java.util.Date
value
converted to a string.
toString
in class Object
|
Java™ Platform Standard Ed. 6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.