APIdia Launch Partner
Top Description Fields Constructors Methods
javax.print.attribute

public abstract Class DateTimeSyntax

extends Object
implements Serializable, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, java.io.Serializable
Known Direct Subclasses
javax.print.attribute.standard.DateTimeAtCompleted, javax.print.attribute.standard.DateTimeAtCreation, javax.print.attribute.standard.DateTimeAtProcessing, javax.print.attribute.standard.JobHoldUntil
Imports
java.io.Serial, .Serializable, java.util.Date

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 getValue(). A date-time attribute's Date value is established when it is constructed (see DateTimeSyntax(Date)). Once constructed, a date-time attribute's value is immutable.

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.

Author
Alan Kaminsky

Field Summary

Modifier and TypeField and Description
private static final long
serialVersionUID

Use serialVersionUID from JDK 1.4 for interoperability.

private Date
value

This date-time attribute's java.util.Date value.

Constructor Summary

AccessConstructor and Description
protected
DateTimeSyntax(Date
java.util.Date value
value
)

Construct a new date-time attribute with the given java.util.Date value.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if object is equivalent to this date-time attribute, false otherwise
equals
(Object
Object to compare to
object
)

Overrides java.lang.Object.equals.

Returns whether this date-time attribute is equivalent to the passed in object.

public Date

Returns:

the Date
getValue
()

Returns this date-time attribute's java.util.Date value.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this date-time attribute.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string value corresponding to this date-time attribute.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Use serialVersionUID from JDK 1.4 for interoperability.

Annotations
@Serial
valueback to summary
private Date value

This date-time attribute's java.util.Date value.

Constructor Detail

DateTimeSyntaxback to summary
protected DateTimeSyntax(Date value)

Construct a new date-time attribute with the given java.util.Date value.

Parameters
value:Date

java.util.Date value

Exceptions
NullPointerException:
if value is null

Method Detail

equalsback to summary
public boolean equals(Object object)

Overrides java.lang.Object.equals.

Returns whether this date-time attribute is equivalent to the passed in object. To be equivalent, all of the following conditions must be true:

  1. object is not null.
  2. object is an instance of class DateTimeSyntax.
  3. This date-time attribute's java.util.Date value and object's java.util.Date value are equal.
Parameters
object:Object

Object to compare to

Returns:boolean

true if object is equivalent to this date-time attribute, false otherwise

Annotations
@Override
getValueback to summary
public Date getValue()

Returns this date-time attribute's java.util.Date value.

Returns:Date

the Date

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this date-time attribute. The hashcode is that of this attribute's java.util.Date value.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string value corresponding to this date-time attribute. The string value is just this attribute's java.util.Date value converted to a string.

Annotations
@Override