KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)Fidelity.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.PrintJobAttribute JavaDoc;
12 import javax.print.attribute.PrintRequestAttribute JavaDoc;
13
14 /**
15  * Class Fidelity is a printing attribute class, an enumeration,
16  * that indicates whether total fidelity to client supplied print request
17  * attributes is required.
18  * If FIDELITY_TRUE is specified and a service cannot print the job exactly
19  * as specified it must reject the job.
20  * If FIDELITY_FALSE is specified a reasonable attempt to print the job is
21  * acceptable. If not supplied the default is FIDELITY_FALSE.
22  *
23  * <P>
24  * <B>IPP Compatibility:</B> The IPP boolean value is "true" for FIDELITY_TRUE
25  * and "false" for FIDELITY_FALSE. The category name returned by
26  * <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
27  * integer value is the IPP enum value. The <code>toString()</code> method
28  * returns the IPP string representation of the attribute value.
29  * See <a HREF="www.ietf.org/rfc/rfc2911.txt">RFC 2911</a> Section 15.1 for
30  * a fuller description of the IPP fidelity attribute.
31  * <P>
32  *
33  */

34 public final class Fidelity extends EnumSyntax JavaDoc
35     implements PrintJobAttribute JavaDoc, PrintRequestAttribute JavaDoc {
36
37     private static final long serialVersionUID = 6320827847329172308L;
38
39     /**
40      * The job must be printed exactly as specified. or else rejected.
41      */

42     public static final Fidelity JavaDoc
43     FIDELITY_TRUE = new Fidelity JavaDoc(0);
44
45     /**
46      * The printer should make reasonable attempts to print the job,
47      * even if it cannot print it exactly as specified.
48      */

49     public static final Fidelity JavaDoc
50     FIDELITY_FALSE = new Fidelity JavaDoc(1);
51
52     /**
53      * Construct a new fidelity enumeration value with the
54      * given integer value.
55      *
56      * @param value Integer value.
57      */

58     protected Fidelity(int value) {
59     super (value);
60     }
61
62     private static final String JavaDoc[] myStringTable = {
63     "true",
64     "false"
65     };
66
67     
68     private static final Fidelity JavaDoc[] myEnumValueTable = {
69     FIDELITY_TRUE,
70     FIDELITY_FALSE
71     };
72
73     /**
74      * Returns the string table for class Fidelity.
75      */

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

83     protected EnumSyntax JavaDoc[] getEnumValueTable() {
84     return myEnumValueTable;
85     } /**
86      * Get the printing attribute class which is to be used as the "category"
87      * for this printing attribute value.
88      * <P>
89      * For class Fidelity the category is class Fidelity itself.
90      *
91      * @return Printing attribute class (category), an instance of class
92      * {@link java.lang.Class java.lang.Class}.
93      */

94     public final Class JavaDoc<? extends Attribute JavaDoc> getCategory() {
95     return Fidelity JavaDoc.class;
96     }
97
98     /**
99      * Get the name of the category of which this attribute value is an
100      * instance.
101      * <P>
102      * For class Fidelity the category name is
103      * <CODE>"ipp-attribute-fidelity"</CODE>.
104      *
105      * @return Attribute category name.
106      */

107     public final String JavaDoc getName() {
108     return "ipp-attribute-fidelity";
109     }
110
111 }
112
Popular Tags