KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)JobSheets.java 1.9 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 java.util.Locale JavaDoc;
10
11 import javax.print.attribute.Attribute JavaDoc;
12 import javax.print.attribute.EnumSyntax JavaDoc;
13 import javax.print.attribute.PrintRequestAttribute JavaDoc;
14 import javax.print.attribute.PrintJobAttribute JavaDoc;
15
16 /**
17  * Class JobSheets is a printing attribute class, an enumeration, that
18  * determines which job start and end sheets, if any, must be printed with a
19  * job. Class JobSheets declares keywords for standard job sheets values.
20  * Implementation- or site-defined names for a job sheets attribute may also be
21  * created by defining a subclass of class JobSheets.
22  * <P>
23  * The effect of a JobSheets attribute on multidoc print jobs (jobs with
24  * multiple documents) may be affected by the {@link MultipleDocumentHandling
25  * MultipleDocumentHandling} job attribute, depending on the meaning of the
26  * particular JobSheets value.
27  * <P>
28  * <B>IPP Compatibility:</B> The category name returned by
29  * <CODE>getName()</CODE> is the IPP attribute name. The
30  * enumeration's integer value is the IPP enum value. The
31  * <code>toString()</code> method returns the IPP string representation of
32  * the attribute value. For a subclass, the attribute value must be
33  * localized to give the IPP name and natural language values.
34  * <P>
35  *
36  * @author Alan Kaminsky
37  */

38 public class JobSheets extends EnumSyntax JavaDoc
39     implements PrintRequestAttribute JavaDoc, PrintJobAttribute JavaDoc {
40
41     private static final long serialVersionUID = -4735258056132519759L;
42
43     /**
44      * No job sheets are printed.
45      */

46     public static final JobSheets JavaDoc NONE = new JobSheets JavaDoc(0);
47
48     /**
49      * One or more site specific standard job sheets are printed. e.g. a
50      * single start sheet is printed, or both start and end sheets are
51      * printed.
52      */

53     public static final JobSheets JavaDoc STANDARD = new JobSheets JavaDoc(1);
54
55     /**
56      * Construct a new job sheets enumeration value with the given integer
57      * value.
58      *
59      * @param value Integer value.
60      */

61     protected JobSheets(int value) {
62     super (value);
63     }
64
65     private static final String JavaDoc[] myStringTable = {
66     "none",
67     "standard"
68     };
69
70     private static final JobSheets JavaDoc[] myEnumValueTable = {
71     NONE,
72     STANDARD
73     };
74
75     /**
76      * Returns the string table for class JobSheets.
77      */

78     protected String JavaDoc[] getStringTable() {
79     return (String JavaDoc[])myStringTable.clone();
80     }
81
82     /**
83      * Returns the enumeration value table for class JobSheets.
84      */

85     protected EnumSyntax JavaDoc[] getEnumValueTable() {
86     return (EnumSyntax JavaDoc[])myEnumValueTable.clone();
87     }
88
89     /**
90      * Get the printing attribute class which is to be used as the "category"
91      * for this printing attribute value.
92      * <P>
93      * For class JobSheets and any vendor-defined subclasses, the category is
94      * class JobSheets itself.
95      *
96      * @return Printing attribute class (category), an instance of class
97      * {@link java.lang.Class java.lang.Class}.
98      */

99     public final Class JavaDoc<? extends Attribute JavaDoc> getCategory() {
100     return JobSheets JavaDoc.class;
101     }
102
103     /**
104      * Get the name of the category of which this attribute value is an
105      * instance.
106      * <P>
107      * For class JobSheets and any vendor-defined subclasses, the category
108      * name is <CODE>"job-sheets"</CODE>.
109      *
110      * @return Attribute category name.
111      */

112     public final String JavaDoc getName() {
113     return "job-sheets";
114     }
115     
116 }
117
Popular Tags