< prev index next >

src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java

Print this page




  28 import javax.print.attribute.Attribute;
  29 import javax.print.attribute.DateTimeSyntax;
  30 import javax.print.attribute.PrintJobAttribute;
  31 
  32 /**
  33  * Class DateTimeAtProcessing is a printing attribute class, a date-time
  34  * attribute, that indicates the date and time at which the Print Job first
  35  * began processing.
  36  * <P>
  37  * To construct a DateTimeAtProcessing attribute from separate values of the
  38  * year, month, day, hour, minute, and so on, use a {@link java.util.Calendar
  39  * Calendar} object to construct a {@link java.util.Date Date} object, then use
  40  * the {@link java.util.Date Date} object to construct the DateTimeAtProcessing
  41  * attribute. To convert a DateTimeAtProcessing attribute to separate values of
  42  * the year, month, day, hour, minute, and so on, create a {@link
  43  * java.util.Calendar Calendar} object and set it to the {@link java.util.Date
  44  * Date} from the DateTimeAtProcessing attribute.
  45  * <P>
  46  * <B>IPP Compatibility:</B> The information needed to construct an IPP
  47  * "date-time-at-processing" attribute can be obtained as described above. The
  48  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  49  * name.
  50  *
  51  * @author  Alan Kaminsky
  52  */
  53 public final class DateTimeAtProcessing extends DateTimeSyntax
  54         implements PrintJobAttribute {
  55 
  56     private static final long serialVersionUID = -3710068197278263244L;
  57 
  58     /**
  59      * Construct a new date-time at processing attribute with the given {@link
  60      * java.util.Date Date} value.
  61      *
  62      * @param  dateTime  {@link java.util.Date Date} value.
  63      *
  64      * @exception  NullPointerException
  65      *     (unchecked exception) Thrown if <CODE>dateTime</CODE> is null.
  66      */
  67     public DateTimeAtProcessing(Date dateTime) {
  68         super (dateTime);
  69     }
  70 
  71     /**
  72      * Returns whether this date-time at processing attribute is equivalent to
  73      * the passed in object. To be equivalent, all of the following conditions
  74      * must be true:
  75      * <OL TYPE=1>
  76      * <LI>
  77      * <CODE>object</CODE> is not null.
  78      * <LI>
  79      * <CODE>object</CODE> is an instance of class DateTimeAtProcessing.
  80      * <LI>
  81      * This date-time at processing attribute's {@link java.util.Date Date}
  82      * value and <CODE>object</CODE>'s {@link java.util.Date Date} value
  83      * are equal.
  84      * </OL>
  85      *
  86      * @param  object  Object to compare to.
  87      *
  88      * @return  True if <CODE>object</CODE> is equivalent to this date-time
  89      *          at processing attribute, false otherwise.
  90      */
  91     public boolean equals(Object object) {
  92         return(super.equals (object) &&
  93                object instanceof DateTimeAtProcessing);
  94     }
  95 
  96     /**
  97      * Get the printing attribute class which is to be used as the "category"
  98      * for this printing attribute value.
  99      * <P>
 100      * For class DateTimeAtProcessing, the category is class
 101      * DateTimeAtProcessing itself.
 102      *
 103      * @return  Printing attribute class (category), an instance of class
 104      *          {@link java.lang.Class java.lang.Class}.
 105      */
 106     public final Class<? extends Attribute> getCategory() {
 107         return DateTimeAtProcessing.class;
 108     }
 109 
 110     /**
 111      * Get the name of the category of which this attribute value is an
 112      * instance.
 113      * <P>
 114      * For class DateTimeAtProcessing, the category name is
 115      * <CODE>"date-time-at-processing"</CODE>.
 116      *
 117      * @return  Attribute category name.
 118      */
 119     public final String getName() {
 120         return "date-time-at-processing";
 121     }
 122 
 123 }


  28 import javax.print.attribute.Attribute;
  29 import javax.print.attribute.DateTimeSyntax;
  30 import javax.print.attribute.PrintJobAttribute;
  31 
  32 /**
  33  * Class DateTimeAtProcessing is a printing attribute class, a date-time
  34  * attribute, that indicates the date and time at which the Print Job first
  35  * began processing.
  36  * <P>
  37  * To construct a DateTimeAtProcessing attribute from separate values of the
  38  * year, month, day, hour, minute, and so on, use a {@link java.util.Calendar
  39  * Calendar} object to construct a {@link java.util.Date Date} object, then use
  40  * the {@link java.util.Date Date} object to construct the DateTimeAtProcessing
  41  * attribute. To convert a DateTimeAtProcessing attribute to separate values of
  42  * the year, month, day, hour, minute, and so on, create a {@link
  43  * java.util.Calendar Calendar} object and set it to the {@link java.util.Date
  44  * Date} from the DateTimeAtProcessing attribute.
  45  * <P>
  46  * <B>IPP Compatibility:</B> The information needed to construct an IPP
  47  * "date-time-at-processing" attribute can be obtained as described above. The
  48  * category name returned by {@code getName()} gives the IPP attribute
  49  * name.
  50  *
  51  * @author  Alan Kaminsky
  52  */
  53 public final class DateTimeAtProcessing extends DateTimeSyntax
  54         implements PrintJobAttribute {
  55 
  56     private static final long serialVersionUID = -3710068197278263244L;
  57 
  58     /**
  59      * Construct a new date-time at processing attribute with the given {@link
  60      * java.util.Date Date} value.
  61      *
  62      * @param  dateTime  {@link java.util.Date Date} value.
  63      *
  64      * @exception  NullPointerException
  65      *     (unchecked exception) Thrown if {@code dateTime} is null.
  66      */
  67     public DateTimeAtProcessing(Date dateTime) {
  68         super (dateTime);
  69     }
  70 
  71     /**
  72      * Returns whether this date-time at processing attribute is equivalent to
  73      * the passed in object. To be equivalent, all of the following conditions
  74      * must be true:
  75      * <OL TYPE=1>
  76      * <LI>
  77      * {@code object} is not null.
  78      * <LI>
  79      * {@code object} is an instance of class DateTimeAtProcessing.
  80      * <LI>
  81      * This date-time at processing attribute's {@link java.util.Date Date}
  82      * value and {@code object}'s {@link java.util.Date Date} value
  83      * are equal.
  84      * </OL>
  85      *
  86      * @param  object  Object to compare to.
  87      *
  88      * @return  True if {@code object} is equivalent to this date-time
  89      *          at processing attribute, false otherwise.
  90      */
  91     public boolean equals(Object object) {
  92         return(super.equals (object) &&
  93                object instanceof DateTimeAtProcessing);
  94     }
  95 
  96     /**
  97      * Get the printing attribute class which is to be used as the "category"
  98      * for this printing attribute value.
  99      * <P>
 100      * For class DateTimeAtProcessing, the category is class
 101      * DateTimeAtProcessing itself.
 102      *
 103      * @return  Printing attribute class (category), an instance of class
 104      *          {@link java.lang.Class java.lang.Class}.
 105      */
 106     public final Class<? extends Attribute> getCategory() {
 107         return DateTimeAtProcessing.class;
 108     }
 109 
 110     /**
 111      * Get the name of the category of which this attribute value is an
 112      * instance.
 113      * <P>
 114      * For class DateTimeAtProcessing, the category name is
 115      * {@code "date-time-at-processing"}.
 116      *
 117      * @return  Attribute category name.
 118      */
 119     public final String getName() {
 120         return "date-time-at-processing";
 121     }
 122 
 123 }
< prev index next >