KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)JobPrioritySupported.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.SupportedValuesAttribute JavaDoc;
12
13 /**
14  * Class JobPrioritySupported is an integer valued printing attribute class
15  * that specifies whether a Print Service instance supports the {@link
16  * JobPriority JobPriority} attribute and the number of different job priority
17  * levels supported.
18  * <P>
19  * The client can always specify any {@link JobPriority JobPriority} value
20  * from 1 to 100 for a job. However, the Print Service instance may support
21  * fewer than 100 different job priority levels. If this is the case, the
22  * Print Service instance automatically maps the client-specified job priority
23  * value to one of the supported job priority levels, dividing the 100 job
24  * priority values equally among the available job priority levels.
25  * <P>
26  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value.
27  * The category name returned by <CODE>getName()</CODE> gives the IPP
28  * attribute name.
29  * <P>
30  *
31  * @author Alan Kaminsky
32  */

33 public final class JobPrioritySupported extends IntegerSyntax JavaDoc
34     implements SupportedValuesAttribute JavaDoc {
35
36     private static final long serialVersionUID = 2564840378013555894L;
37
38
39     /**
40      * Construct a new job priority supported attribute with the given integer
41      * value.
42      *
43      * @param value Number of different job priority levels supported.
44      *
45      * @exception IllegalArgumentException
46      * (Unchecked exception) Thrown if <CODE>value</CODE> is less than 1
47      * or greater than 100.
48      */

49     public JobPrioritySupported(int value) {
50     super (value, 1, 100);
51     }
52         
53     /**
54      * Returns whether this job priority supported attribute is equivalent to
55      * the passed in object. To be equivalent, all of the following conditions
56      * must be true:
57      * <OL TYPE=1>
58      * <LI>
59      * <CODE>object</CODE> is not null.
60      * <LI>
61      * <CODE>object</CODE> is an instance of class JobPrioritySupported.
62      * <LI>
63      * This job priority supported attribute's value and
64      * <CODE>object</CODE>'s value are equal.
65      * </OL>
66      *
67      * @param object Object to compare to.
68      *
69      * @return True if <CODE>object</CODE> is equivalent to this job
70      * priority supported attribute, false otherwise.
71      */

72     public boolean equals (Object JavaDoc object) {
73
74     return (super.equals(object) &&
75            object instanceof JobPrioritySupported JavaDoc);
76     }
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 JobPrioritySupported, the
84      * category is class JobPrioritySupported 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 JobPrioritySupported 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 JobPrioritySupported, the
98      * category name is <CODE>"job-priority-supported"</CODE>.
99      *
100      * @return Attribute category name.
101      */

102     public final String JavaDoc getName() {
103     return "job-priority-supported";
104     }
105     
106 }
107
Popular Tags