- java.lang.Object
-
- javax.print.attribute.DateTimeSyntax
-
- All Implemented Interfaces:
- Serializable, Cloneable
- Direct Known Subclasses:
- DateTimeAtCompleted, DateTimeAtCreation, DateTimeAtProcessing, JobHoldUntil
public abstract class DateTimeSyntax extends Object implements Serializable, Cloneable
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 (seegetValue()
). 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 ajava.util.Date
object, then use thejava.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 ajava.util.Calendar
object and set it to thejava.util.Date
from the date-time attribute. Class DateTimeSyntax stores its value in the form of ajava.util.Date
rather than ajava.util.Calendar
because it typically takes less memory to store and less time to compare ajava.util.Date
than ajava.util.Calendar
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor and Description protected
DateTimeSyntax(Date value)
Construct a new date-time attribute with the givenjava.util.Date
value.
-
Method Summary
Methods Modifier and Type Method and Description boolean
equals(Object object)
Returns whether this date-time attribute is equivalent to the passed in object.Date
getValue()
Returns this date-time attribute'sjava.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.
-
-
-
Constructor Detail
-
DateTimeSyntax
protected DateTimeSyntax(Date value)
Construct a new date-time attribute with the givenjava.util.Date
value.- Parameters:
value
-java.util.Date
value.- Throws:
NullPointerException
- (unchecked exception) Thrown iftheValue
is null.
-
-
Method Detail
-
getValue
public Date getValue()
Returns this date-time attribute'sjava.util.Date
value.- Returns:
- the Date.
-
equals
public boolean equals(Object object)
Returns whether this date-time attribute is equivalent to the passed in object. To be equivalent, all of the following conditions must be true:-
object
is not null. -
object
is an instance of class DateTimeSyntax. -
This date-time attribute's
java.util.Date
value andobject
'sjava.util.Date
value are equal.
- Overrides:
equals
in classObject
- Parameters:
object
- Object to compare to.- Returns:
- True if
object
is equivalent to this date-time attribute, false otherwise. - See Also:
Object.hashCode()
,HashMap
-
-
hashCode
public int hashCode()
Returns a hash code value for this date-time attribute. The hashcode is that of this attribute'sjava.util.Date
value.- Overrides:
hashCode
in classObject
- Returns:
- a hash code value for this object.
- See Also:
Object.equals(java.lang.Object)
,System.identityHashCode(java.lang.Object)
-
-
Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-javax/print/attribute/datetimesyntax.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.