KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)QueuedJobCount.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.PrintServiceAttribute JavaDoc;
12
13 /**
14  * Class QueuedJobCount is an integer valued printing attribute that indicates
15  * the number of jobs in the printer whose {@link JobState JobState} is either
16  * PENDING, PENDING_HELD, PROCESSING, or PROCESSING_STOPPED.
17  * <P>
18  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value.
19  * The category name returned by <CODE>getName()</CODE> gives the IPP
20  * attribute name.
21  * <P>
22  *
23  * @author Alan Kaminsky
24  */

25 public final class QueuedJobCount extends IntegerSyntax JavaDoc
26     implements PrintServiceAttribute JavaDoc {
27
28     private static final long serialVersionUID = 7499723077864047742L;
29
30     /**
31      * Construct a new queued job count attribute with the given integer
32      * value.
33      *
34      * @param value Integer value.
35      *
36      * @exception IllegalArgumentException
37      * (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
38      */

39     public QueuedJobCount(int value) {
40     super (value, 0, Integer.MAX_VALUE);
41     }
42
43     /**
44      * Returns whether this queued job count attribute is equivalent to the
45      * passed in object. To be equivalent, all of the following conditions
46      * mus be true:
47      * <OL TYPE=1>
48      * <LI>
49      * <CODE>object</CODE> is not null.
50      * <LI>
51      * <CODE>object</CODE> is an instance of class QueuedJobCount.
52      * <LI>
53      * This queued job count attribute's value and <CODE>object</CODE>'s
54      * value are equal.
55      * </OL>
56      *
57      * @param object Object to compare to.
58      *
59      * @return True if <CODE>object</CODE> is equivalent to this queued job
60      * count attribute, false otherwise.
61      */

62     public boolean equals(Object JavaDoc object) {
63     return (super.equals (object) &&
64            object instanceof QueuedJobCount JavaDoc);
65     }
66
67     /**
68      * Get the printing attribute class which is to be used as the "category"
69      * for this printing attribute value.
70      * <P>
71      * For class QueuedJobCount, the category is class QueuedJobCount itself.
72      *
73      * @return Printing attribute class (category), an instance of class
74      * {@link java.lang.Class java.lang.Class}.
75      */

76     public final Class JavaDoc<? extends Attribute JavaDoc> getCategory() {
77     return QueuedJobCount JavaDoc.class;
78     }
79
80     /**
81      * Get the name of the category of which this attribute value is an
82      * instance.
83      * <P>
84      * For class QueuedJobCount, the
85      * category name is <CODE>"queued-job-count"</CODE>.
86      *
87      * @return Attribute category name.
88      */

89     public final String JavaDoc getName() {
90     return "queued-job-count";
91     }
92
93 }
94
Popular Tags