KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)OutputDeviceAssigned.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.TextSyntax JavaDoc;
13 import javax.print.attribute.PrintJobAttribute JavaDoc;
14
15 /**
16  * Class OutputDeviceAssigned is a printing attribute class, a text attribute,
17  * that identifies the output device to which the service has assigned this
18  * job. If an output device implements an embedded Print Service instance, the
19  * printer need not set this attribute. If a print server implements a
20  * Print Service instance, the value may be empty (zero- length string) or not
21  * returned until the service assigns an output device to the job. This
22  * attribute is particularly useful when a single service supports multiple
23  * devices (so called "fan-out").
24  * <P>
25  * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
26  * locale gives the IPP natural language. The category name returned by
27  * <CODE>getName()</CODE> gives the IPP attribute name.
28  * <P>
29  *
30  * @author Alan Kaminsky
31  */

32 public final class OutputDeviceAssigned extends TextSyntax JavaDoc
33     implements PrintJobAttribute JavaDoc {
34
35     private static final long serialVersionUID = 5486733778854271081L;
36
37     /**
38      * Constructs a new output device assigned attribute with the given device
39      * name and locale.
40      *
41      * @param deviceName Device name.
42      * @param locale Natural language of the text string. null
43      * is interpreted to mean the default locale as returned
44      * by <code>Locale.getDefault()</code>
45      *
46      * @exception NullPointerException
47      * (unchecked exception) Thrown if <CODE>deviceName</CODE> is null.
48      */

49     public OutputDeviceAssigned(String JavaDoc deviceName, Locale JavaDoc locale) {
50     
51     super (deviceName, locale);
52     }
53
54     // Exported operations inherited and overridden from class Object.
55

56     /**
57      * Returns whether this output device assigned attribute is equivalent to
58      * the passed in object. To be equivalent, all of the following conditions
59      * must be true:
60      * <OL TYPE=1>
61      * <LI>
62      * <CODE>object</CODE> is not null.
63      * <LI>
64      * <CODE>object</CODE> is an instance of class OutputDeviceAssigned.
65      * <LI>
66      * This output device assigned attribute's underlying string and
67      * <CODE>object</CODE>'s underlying string are equal.
68      * <LI>
69      * This output device assigned attribute's locale and
70      * <CODE>object</CODE>'s locale are equal.
71      * </OL>
72      *
73      * @param object Object to compare to.
74      *
75      * @return True if <CODE>object</CODE> is equivalent to this output
76      * device assigned attribute, false otherwise.
77      */

78     public boolean equals(Object JavaDoc object) {
79     return (super.equals (object) &&
80         object instanceof OutputDeviceAssigned JavaDoc);
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 OutputDeviceAssigned, the
88      * category is class OutputDeviceAssigned 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 OutputDeviceAssigned 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 OutputDeviceAssigned, the
102      * category name is <CODE>"output-device-assigned"</CODE>.
103      *
104      * @return Attribute category name.
105      */

106     public final String JavaDoc getName() {
107     return "output-device-assigned";
108     }
109     
110 }
111
Popular Tags