< prev index next >

src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.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 DateTimeAtCompleted is a printing attribute class, a date-time
  34  * attribute, that indicates the date and time at which the Print Job completed
  35  * (or was canceled or aborted).
  36  * <P>
  37  * To construct a DateTimeAtCompleted 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 DateTimeAtCompleted
  41  * attribute. To convert a DateTimeAtCompleted 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 DateTimeAtCompleted attribute.
  45  * <P>
  46  * <B>IPP Compatibility:</B> The information needed to construct an IPP
  47  * "date-time-at-completed" 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 DateTimeAtCompleted extends DateTimeSyntax
  54     implements PrintJobAttribute {
  55 
  56     private static final long serialVersionUID = 6497399708058490000L;
  57 
  58     /**
  59      * Construct a new date-time at completed 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 DateTimeAtCompleted(Date dateTime) {
  68         super (dateTime);
  69     }
  70 
  71     /**
  72      * Returns whether this date-time at completed 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 DateTimeAtCompleted.
  80      * <LI>
  81      * This date-time at completed attribute's {@link java.util.Date Date} value
  82      * and <CODE>object</CODE>'s {@link java.util.Date Date} value are equal.
  83      * </OL>
  84      *
  85      * @param  object  Object to compare to.
  86      *
  87      * @return  True if <CODE>object</CODE> is equivalent to this date-time
  88      *          at completed attribute, false otherwise.
  89      */
  90     public boolean equals(Object object) {
  91         return(super.equals (object) &&
  92                object instanceof DateTimeAtCompleted);
  93     }
  94 
  95 // Exported operations inherited and implemented from interface Attribute.
  96 
  97     /**
  98      * Get the printing attribute class which is to be used as the "category"
  99      * for this printing attribute value.
 100          * <P>
 101          * For class DateTimeAtCompleted, the category is class
 102          * DateTimeAtCompleted itself.
 103          *
 104          * @return  Printing attribute class (category), an instance of class
 105          *          {@link java.lang.Class java.lang.Class}.
 106          */
 107     public final Class<? extends Attribute> getCategory() {
 108         return DateTimeAtCompleted.class;
 109     }
 110 
 111     /**
 112      * Get the name of the category of which this attribute value is an
 113      * instance.
 114      * <P>
 115      * For class DateTimeAtCompleted, the category name is
 116      * <CODE>"date-time-at-completed"</CODE>.
 117      *
 118      * @return  Attribute category name.
 119      */
 120     public final String getName() {
 121         return "date-time-at-completed";
 122     }
 123 
 124 }


  28 import javax.print.attribute.Attribute;
  29 import javax.print.attribute.DateTimeSyntax;
  30 import javax.print.attribute.PrintJobAttribute;
  31 
  32 /**
  33  * Class DateTimeAtCompleted is a printing attribute class, a date-time
  34  * attribute, that indicates the date and time at which the Print Job completed
  35  * (or was canceled or aborted).
  36  * <P>
  37  * To construct a DateTimeAtCompleted 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 DateTimeAtCompleted
  41  * attribute. To convert a DateTimeAtCompleted 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 DateTimeAtCompleted attribute.
  45  * <P>
  46  * <B>IPP Compatibility:</B> The information needed to construct an IPP
  47  * "date-time-at-completed" 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 DateTimeAtCompleted extends DateTimeSyntax
  54     implements PrintJobAttribute {
  55 
  56     private static final long serialVersionUID = 6497399708058490000L;
  57 
  58     /**
  59      * Construct a new date-time at completed 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 DateTimeAtCompleted(Date dateTime) {
  68         super (dateTime);
  69     }
  70 
  71     /**
  72      * Returns whether this date-time at completed 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 DateTimeAtCompleted.
  80      * <LI>
  81      * This date-time at completed attribute's {@link java.util.Date Date} value
  82      * and {@code object}'s {@link java.util.Date Date} value are equal.
  83      * </OL>
  84      *
  85      * @param  object  Object to compare to.
  86      *
  87      * @return  True if {@code object} is equivalent to this date-time
  88      *          at completed attribute, false otherwise.
  89      */
  90     public boolean equals(Object object) {
  91         return(super.equals (object) &&
  92                object instanceof DateTimeAtCompleted);
  93     }
  94 
  95 // Exported operations inherited and implemented from interface Attribute.
  96 
  97     /**
  98      * Get the printing attribute class which is to be used as the "category"
  99      * for this printing attribute value.
 100          * <P>
 101          * For class DateTimeAtCompleted, the category is class
 102          * DateTimeAtCompleted itself.
 103          *
 104          * @return  Printing attribute class (category), an instance of class
 105          *          {@link java.lang.Class java.lang.Class}.
 106          */
 107     public final Class<? extends Attribute> getCategory() {
 108         return DateTimeAtCompleted.class;
 109     }
 110 
 111     /**
 112      * Get the name of the category of which this attribute value is an
 113      * instance.
 114      * <P>
 115      * For class DateTimeAtCompleted, the category name is
 116      * {@code "date-time-at-completed"}.
 117      *
 118      * @return  Attribute category name.
 119      */
 120     public final String getName() {
 121         return "date-time-at-completed";
 122     }
 123 
 124 }
< prev index next >