KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)JobMediaSheetsCompleted.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 JobMediaSheetsCompleted is an integer valued printing attribute class
15  * that specifies the number of media sheets which have completed marking and
16  * stacking for the entire job so far, whether those sheets have been processed
17  * on one side or on both.
18  * <P>
19  * The JobMediaSheetsCompleted attribute describes the progress of the job. This
20  * attribute is intended to be a counter. That is, the JobMediaSheetsCompleted
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  * JobMediaSheetsCompleted 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 JobMediaSheetsCompleted 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 JobMediaSheets
35  * @see JobMediaSheetsSupported
36  * @see JobKOctetsProcessed
37  * @see JobImpressionsCompleted
38  *
39  * @author Alan Kaminsky
40  */

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

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

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

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

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