KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > print > attribute > standard > DateTimeAtProcessing


1 /*
2  * @(#)DateTimeAtProcessing.java 1.7 04/05/05
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package javax.print.attribute.standard;
8
9 import java.util.Date JavaDoc;
10 import javax.print.attribute.Attribute JavaDoc;
11 import javax.print.attribute.DateTimeSyntax JavaDoc;
12 import javax.print.attribute.PrintJobAttribute JavaDoc;
13
14 /**
15  * Class DateTimeAtProcessing is a printing attribute class, a date-time
16  * attribute, that indicates the date and time at which the Print Job first
17  * began processing.
18  * <P>
19  * To construct a DateTimeAtProcessing attribute from separate values of the
20  * year, month, day, hour, minute, and so on, use a {@link java.util.Calendar
21  * Calendar} object to construct a {@link java.util.Date Date} object, then use
22  * the {@link java.util.Date Date} object to construct the DateTimeAtProcessing
23  * attribute. To convert a DateTimeAtProcessing attribute to separate values of
24  * the year, month, day, hour, minute, and so on, create a {@link
25  * java.util.Calendar Calendar} object and set it to the {@link java.util.Date
26  * Date} from the DateTimeAtProcessing attribute.
27  * <P>
28  * <B>IPP Compatibility:</B> The information needed to construct an IPP
29  * "date-time-at-processing" attribute can be obtained as described above. The
30  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
31  * name.
32  * <P>
33  *
34  * @author Alan Kaminsky
35  */

36 public final class DateTimeAtProcessing extends DateTimeSyntax JavaDoc
37     implements PrintJobAttribute JavaDoc {
38
39     private static final long serialVersionUID = -3710068197278263244L;
40
41     /**
42      * Construct a new date-time at processing attribute with the given {@link
43      * java.util.Date Date} value.
44      *
45      * @param dateTime {@link java.util.Date Date} value.
46      *
47      * @exception NullPointerException
48      * (unchecked exception) Thrown if <CODE>dateTime</CODE> is null.
49      */

50     public DateTimeAtProcessing(Date JavaDoc dateTime) {
51     super (dateTime);
52     }
53
54     /**
55      * Returns whether this date-time at processing attribute is equivalent to
56      * the passed in object. To be equivalent, all of the following conditions
57      * must be true:
58      * <OL TYPE=1>
59      * <LI>
60      * <CODE>object</CODE> is not null.
61      * <LI>
62      * <CODE>object</CODE> is an instance of class DateTimeAtProcessing.
63      * <LI>
64      * This date-time at processing attribute's {@link java.util.Date Date}
65      * value and <CODE>object</CODE>'s {@link java.util.Date Date} value
66      * are equal.
67      * </OL>
68      *
69      * @param object Object to compare to.
70      *
71      * @return True if <CODE>object</CODE> is equivalent to this date-time
72      * at processing attribute, false otherwise.
73      */

74     public boolean equals(Object JavaDoc object) {
75     return(super.equals (object) &&
76            object instanceof DateTimeAtProcessing JavaDoc);
77     }
78
79     /**
80      * Get the printing attribute class which is to be used as the "category"
81      * for this printing attribute value.
82      * <P>
83      * For class DateTimeAtProcessing, the category is class
84      * DateTimeAtProcessing itself.
85      *
86      * @return Printing attribute class (category), an instance of class
87      * {@link java.lang.Class java.lang.Class}.
88      */

89     public final Class JavaDoc<? extends Attribute JavaDoc> getCategory() {
90     return DateTimeAtProcessing JavaDoc.class;
91     }
92
93     /**
94      * Get the name of the category of which this attribute value is an
95      * instance.
96      * <P>
97      * For class DateTimeAtProcessing, the category name is
98      * <CODE>"date-time-at-processing"</CODE>.
99      *
100      * @return Attribute category name.
101      */

102     public final String JavaDoc getName() {
103     return "date-time-at-processing";
104     }
105     
106 }
107
Popular Tags