KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)JobImpressionsCompleted.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 javax.print.attribute.Attribute JavaDoc;
10 import javax.print.attribute.IntegerSyntax JavaDoc;
11 import javax.print.attribute.PrintJobAttribute JavaDoc;
12
13 /**
14  * Class JobImpressionsCompleted is an integer valued printing attribute class
15  * that specifies the number of impressions completed for the job so far. For
16  * printing devices, the impressions completed includes interpreting, marking,
17  * and stacking the output.
18  * <P>
19  * The JobImpressionsCompleted attribute describes the progress of the job. This
20  * attribute is intended to be a counter. That is, the JobImpressionsCompleted
21  * value for a job that has not started processing must be 0. When the job's
22  * {@link JobState JobState} is PROCESSING or PROCESSING_STOPPED, the
23  * JobImpressionsCompleted value is intended to increase as the job is
24  * processed; it indicates the amount of the job that has been processed at the
25  * time the Print Job's attribute set is queried or at the time a print job
26  * event is reported. When the job enters the COMPLETED, CANCELED, or ABORTED
27  * states, the JobImpressionsCompleted value is the final value for the job.
28  * <P>
29  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
30  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
31  * name.
32  * <P>
33  *
34  * @see JobImpressions
35  * @see JobImpressionsSupported
36  * @see JobKOctetsProcessed
37  * @see JobMediaSheetsCompleted
38  *
39  * @author Alan Kaminsky
40  */

41 public final class JobImpressionsCompleted extends IntegerSyntax JavaDoc
42     implements PrintJobAttribute JavaDoc {
43
44     private static final long serialVersionUID = 6722648442432393294L;
45
46     /**
47      * Construct a new job impressions completed attribute with the given
48      * integer value.
49      *
50      * @param value Integer value.
51      *
52      * @exception IllegalArgumentException
53      * (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
54      */

55     public JobImpressionsCompleted(int value) {
56     super (value, 0, Integer.MAX_VALUE);
57     }
58
59     /**
60      * Returns whether this job impressions completed attribute is equivalent
61      * tp the passed in object. To be equivalent, all of the following
62      * conditions must be true:
63      * <OL TYPE=1>
64      * <LI>
65      * <CODE>object</CODE> is not null.
66      * <LI>
67      * <CODE>object</CODE> is an instance of class JobImpressionsCompleted.
68      * <LI>
69      * This job impressions completed attribute's value and
70      * <CODE>object</CODE>'s value are equal.
71      * </OL>
72      *
73      * @param object Object to compare to.
74      *
75      * @return True if <CODE>object</CODE> is equivalent to this job
76      * impressions completed attribute, false otherwise.
77      */

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

93     public final Class JavaDoc<? extends Attribute JavaDoc> getCategory() {
94     return JobImpressionsCompleted JavaDoc.class;
95     }
96
97     /**
98      * Get the name of the category of which this attribute value is an
99      * instance.
100      * <P>
101      * For class JobImpressionsCompleted, the category name is
102      * <CODE>"job-impressions-completed"</CODE>.
103      *
104      * @return Attribute category name.
105      */

106     public final String JavaDoc getName() {
107     return "job-impressions-completed";
108     }
109
110 }
111
Popular Tags