KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)PrinterIsAcceptingJobs.java 1.8 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.EnumSyntax JavaDoc;
11 import javax.print.attribute.PrintServiceAttribute JavaDoc;
12
13 /**
14  * Class PrinterIsAcceptingJobs is a printing attribute class, an enumeration,
15  * that indicates whether the printer is currently able to accept jobs. This
16  * value is independent of the {@link PrinterState PrinterState} and {@link
17  * PrinterStateReasons PrinterStateReasons} attributes because its value does
18  * not affect the current job; rather it affects future jobs. If the value is
19  * NOT_ACCEPTING_JOBS, the printer will reject jobs even when the {@link
20  * PrinterState PrinterState} is IDLE. If value is ACCEPTING_JOBS, the Printer
21  * will accept jobs even when the {@link PrinterState PrinterState} is STOPPED.
22  * <P>
23  * <B>IPP Compatibility:</B> The IPP boolean value is "true" for ACCEPTING_JOBS
24  * and "false" for NOT_ACCEPTING_JOBS. TThe category name returned by
25  * <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
26  * integer value is the IPP enum value. The <code>toString()</code> method
27  * returns the IPP string representation of the attribute value.
28  * <P>
29  *
30  * @author Alan Kaminsky
31  */

32 public final class PrinterIsAcceptingJobs extends EnumSyntax JavaDoc
33     implements PrintServiceAttribute JavaDoc {
34
35     private static final long serialVersionUID = -5052010680537678061L;
36
37     /**
38      * The printer is currently rejecting any jobs sent to it.
39      */

40     public static final PrinterIsAcceptingJobs JavaDoc
41     NOT_ACCEPTING_JOBS = new PrinterIsAcceptingJobs JavaDoc(0);
42
43     /**
44      * The printer is currently acccepting jobs.
45      */

46     public static final PrinterIsAcceptingJobs JavaDoc
47     ACCEPTING_JOBS = new PrinterIsAcceptingJobs JavaDoc(1);
48
49     /**
50      * Construct a new printer is accepting jobs enumeration value with the
51      * given integer value.
52      *
53      * @param value Integer value.
54      */

55     protected PrinterIsAcceptingJobs(int value) {
56     super (value);
57     }
58
59     private static final String JavaDoc[] myStringTable = {
60     "not-accepting-jobs",
61     "accepting-jobs"
62     };
63
64     private static final PrinterIsAcceptingJobs JavaDoc[] myEnumValueTable = {
65     NOT_ACCEPTING_JOBS,
66     ACCEPTING_JOBS
67     };
68
69     /**
70      * Returns the string table for class PrinterIsAcceptingJobs.
71      */

72     protected String JavaDoc[] getStringTable() {
73     return myStringTable;
74     }
75
76     /**
77      * Returns the enumeration value table for class PrinterIsAcceptingJobs.
78      */

79     protected EnumSyntax JavaDoc[] getEnumValueTable() {
80     return myEnumValueTable;
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 PrinterIsAcceptingJobs, the
88      * category is class PrinterIsAcceptingJobs 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 PrinterIsAcceptingJobs 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 PrinterIsAcceptingJobs, the
102      * category name is <CODE>"printer-is-accepting-jobs"</CODE>.
103      *
104      * @return Attribute category name.
105      */

106     public final String JavaDoc getName() {
107     return "printer-is-accepting-jobs";
108     }
109
110 }
111
Popular Tags