Class DateTimeSyntax

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 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.

See Also:
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Construct a new date-time attribute with the given java.util.Date value.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object object)
    Returns whether this date-time attribute is equivalent to the passed in object.
    Returns this date-time attribute's java.util.Date value.
    int
    Returns a hash code value for this date-time attribute.
    Returns a string value corresponding to this date-time attribute.

    Methods declared in class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    Modifier and Type
    Method
    Description
    protected Object
    Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    May cause performance issues, deadlocks and hangs.
    final Class<? extends Object>
    Answers the unique instance of java.lang.Class which represents the class of the receiver.
    final void
    Causes one thread which is waiting on the receiver to be made ready to run.
    final void
    Causes all threads which are waiting on the receiver to be made ready to run.
    final void
    Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated by notify or notifyAll).
    final void
    wait(long time)
    Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated by notify or notifyAll) or the expiration of the timeout.
    final void
    wait(long time, int frac)
    Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated by notify or notifyAll) or the expiration of the timeout.
  • Constructor Details

    • DateTimeSyntax

      protected DateTimeSyntax(Date value)
      Construct a new date-time attribute with the given java.util.Date value.
      Parameters:
      value - java.util.Date value
      Throws:
      NullPointerException - if value is null
  • Method Details

    • getValue

      public Date getValue()
      Returns this date-time attribute's java.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:
      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.
      Overrides:
      equals in class Object
      Parameters:
      object - Object to compare to
      Returns:
      true if object is equivalent to this date-time attribute, false otherwise
      See Also:
    • hashCode

      public int hashCode()
      Returns a hash code value for this date-time attribute. The hashcode is that of this attribute's java.util.Date value.
      Overrides:
      hashCode in class Object
      Returns:
      the receiver's hash.
      See Also:
    • toString

      public String 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.
      Overrides:
      toString in class Object
      Returns:
      String a printable representation for the receiver.