javax.print.attribute
Class DateTimeSyntax

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.print.attribute.DateTimeSyntax
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable
Direct Known Subclasses:
DateTimeAtCompleted sample code for javax.print.attribute.standard.DateTimeAtCompleted definition code for javax.print.attribute.standard.DateTimeAtCompleted , DateTimeAtCreation sample code for javax.print.attribute.standard.DateTimeAtCreation definition code for javax.print.attribute.standard.DateTimeAtCreation , DateTimeAtProcessing sample code for javax.print.attribute.standard.DateTimeAtProcessing definition code for javax.print.attribute.standard.DateTimeAtProcessing , JobHoldUntil sample code for javax.print.attribute.standard.JobHoldUntil definition code for javax.print.attribute.standard.JobHoldUntil

public abstract class DateTimeSyntax
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Cloneable sample code for java.lang.Cloneable definition code for java.lang.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() sample code for javax.print.attribute.DateTimeSyntax.getValue() definition code for javax.print.attribute.DateTimeSyntax.getValue() . A date-time attribute's Date value is established when it is constructed (see DateTimeSyntax(Date) sample code for javax.print.attribute.DateTimeSyntax.DateTimeSyntax(java.util.Date) definition code for javax.print.attribute.DateTimeSyntax.DateTimeSyntax(java.util.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.Dateobject 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:
Serialized Form

Constructor Summary
protected DateTimeSyntax sample code for javax.print.attribute.DateTimeSyntax.DateTimeSyntax(java.util.Date) definition code for javax.print.attribute.DateTimeSyntax.DateTimeSyntax(java.util.Date) (Date sample code for java.util.Date definition code for java.util.Date  value)
          Construct a new date-time attribute with the given java.util.Date value.
 
Method Summary
 boolean equals sample code for javax.print.attribute.DateTimeSyntax.equals(java.lang.Object) definition code for javax.print.attribute.DateTimeSyntax.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  object)
          Returns whether this date-time attribute is equivalent to the passed in object.
 Date sample code for java.util.Date definition code for java.util.Date getValue sample code for javax.print.attribute.DateTimeSyntax.getValue() definition code for javax.print.attribute.DateTimeSyntax.getValue() ()
          Returns this date-time attribute's java.util.Date value.
 int hashCode sample code for javax.print.attribute.DateTimeSyntax.hashCode() definition code for javax.print.attribute.DateTimeSyntax.hashCode() ()
          Returns a hash code value for this date-time attribute.
 String sample code for java.lang.String definition code for java.lang.String toString sample code for javax.print.attribute.DateTimeSyntax.toString() definition code for javax.print.attribute.DateTimeSyntax.toString() ()
          Returns a string value corresponding to this date-time attribute.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

DateTimeSyntax sample code for javax.print.attribute.DateTimeSyntax(java.util.Date) definition code for javax.print.attribute.DateTimeSyntax(java.util.Date)

protected DateTimeSyntax(Date sample code for java.util.Date definition code for java.util.Date  value)
Construct a new date-time attribute with the given java.util.Date value.

Parameters:
value - java.util.Date value.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - (unchecked exception) Thrown if theValue is null.
Method Detail

getValue sample code for javax.print.attribute.DateTimeSyntax.getValue() definition code for javax.print.attribute.DateTimeSyntax.getValue()

public Date sample code for java.util.Date definition code for java.util.Date  getValue()
Returns this date-time attribute's java.util.Date value.

Returns:
the Date.

equals sample code for javax.print.attribute.DateTimeSyntax.equals(java.lang.Object) definition code for javax.print.attribute.DateTimeSyntax.equals(java.lang.Object)

public boolean equals(Object sample code for java.lang.Object definition code for java.lang.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 sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) in class Object sample code for java.lang.Object definition code for java.lang.Object
Parameters:
object - Object to compare to.
Returns:
True if object is equivalent to this date-time attribute, false otherwise.
See Also:
Object.hashCode() sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

hashCode sample code for javax.print.attribute.DateTimeSyntax.hashCode() definition code for javax.print.attribute.DateTimeSyntax.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 sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a hash code value for this object.
See Also:
Object.equals(java.lang.Object) sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

toString sample code for javax.print.attribute.DateTimeSyntax.toString() definition code for javax.print.attribute.DateTimeSyntax.toString()

public String sample code for java.lang.String definition code for java.lang.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 sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a string representation of the object.