KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)NumberOfInterveningJobs.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 NumberOfInterveningJobs is an integer valued printing attribute that
15  * indicates the number of jobs that are ahead of this job in the relative
16  * chronological order of expected time to complete (i.e., the current
17  * scheduled order).
18  * <P>
19  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value.
20  * The category name returned by <CODE>getName()</CODE> gives the IPP
21  * attribute name.
22  * <P>
23  *
24  * @author Alan Kaminsky
25  */

26 public final class NumberOfInterveningJobs extends IntegerSyntax JavaDoc
27     implements PrintJobAttribute JavaDoc {
28
29     private static final long serialVersionUID = 2568141124844982746L;
30
31     /**
32      * Construct a new number of intervening jobs attribute with the given
33      * integer value.
34      *
35      * @param value Integer value.
36      *
37      * @exception IllegalArgumentException
38      * (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
39      */

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

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

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

91     public final String JavaDoc getName() {
92     return "number-of-intervening-jobs";
93     }
94     
95 }
96
Popular Tags