KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)JobMessageFromOperator.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 JobMessageFromOperator is a printing attribute class, a text attribute,
17  * that provides a message from an operator, system administrator, or
18  * "intelligent" process to indicate to the end user the reasons for
19  * modification or other management action taken on a job.
20  * <P>
21  * A Print Job's attribute set includes zero instances or one instance of a
22  * JobMessageFromOperator attribute, not more than one instance. A new
23  * JobMessageFromOperator attribute replaces an existing JobMessageFromOperator
24  * attribute, if any. In other words, JobMessageFromOperator is not intended to
25  * be a history log. If it wishes, the client can detect changes to a Print
26  * Job's JobMessageFromOperator attribute and maintain the client's own history
27  * log of the JobMessageFromOperator attribute values.
28  * <P>
29  * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
30  * locale gives the IPP natural language. The category name returned by
31  * <CODE>getName()</CODE> gives the IPP attribute name.
32  * <P>
33  *
34  * @author Alan Kaminsky
35  */

36 public final class JobMessageFromOperator extends TextSyntax JavaDoc
37     implements PrintJobAttribute JavaDoc {
38
39     private static final long serialVersionUID = -4620751846003142047L;
40
41     /**
42      * Constructs a new job message from operator attribute with the given
43      * message and locale.
44      *
45      * @param message Message.
46      * @param locale Natural language of the text string. null
47      * is interpreted to mean the default locale as returned
48      * by <code>Locale.getDefault()</code>
49      *
50      * @exception NullPointerException
51      * (unchecked exception) Thrown if <CODE>message</CODE> is null.
52      */

53     public JobMessageFromOperator(String JavaDoc message, Locale JavaDoc locale) {
54     super (message, locale);
55     }
56
57     /**
58      * Returns whether this job message from operator attribute is equivalent to
59      * the passed in object. To be equivalent, all of the following conditions
60      * must be true:
61      * <OL TYPE=1>
62      * <LI>
63      * <CODE>object</CODE> is not null.
64      * <LI>
65      * <CODE>object</CODE> is an instance of class JobMessageFromOperator.
66      * <LI>
67      * This job message from operator attribute's underlying string and
68      * <CODE>object</CODE>'s underlying string are equal.
69      * <LI>
70      * This job message from operator attribute's locale and
71      * <CODE>object</CODE>'s locale are equal.
72      * </OL>
73      *
74      * @param object Object to compare to.
75      *
76      * @return True if <CODE>object</CODE> is equivalent to this job
77      * message from operator attribute, false otherwise.
78      */

79     public boolean equals(Object JavaDoc object) {
80     return (super.equals (object) &&
81         object instanceof JobMessageFromOperator JavaDoc);
82     }
83
84     /**
85      * Get the printing attribute class which is to be used as the "category"
86      * for this printing attribute value.
87      * <P>
88      * For class JobMessageFromOperator, the
89      * category is class JobMessageFromOperator 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 JobMessageFromOperator 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 JobMessageFromOperator, the
103      * category name is <CODE>"job-message-from-operator"</CODE>.
104      *
105      * @return Attribute category name.
106      */

107     public final String JavaDoc getName() {
108     return "job-message-from-operator";
109     }
110
111 }
112
Popular Tags