< prev index next >

src/java.desktop/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java

Print this page




  29 import javax.print.attribute.Attribute;
  30 import javax.print.attribute.TextSyntax;
  31 import javax.print.attribute.PrintJobAttribute;
  32 
  33 /**
  34  * Class JobMessageFromOperator is a printing attribute class, a text attribute,
  35  * that provides a message from an operator, system administrator, or
  36  * "intelligent" process to indicate to the end user the reasons for
  37  * modification or other management action taken on a job.
  38  * <P>
  39  * A Print Job's attribute set includes zero instances or one instance of a
  40  * JobMessageFromOperator attribute, not more than one instance. A new
  41  * JobMessageFromOperator attribute replaces an existing JobMessageFromOperator
  42  * attribute, if any. In other words, JobMessageFromOperator is not intended to
  43  * be a history log. If it wishes, the client can detect changes to a Print
  44  * Job's JobMessageFromOperator attribute and maintain the client's own history
  45  * log of the JobMessageFromOperator attribute values.
  46  * <P>
  47  * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
  48  * locale gives the IPP natural language. The category name returned by
  49  * <CODE>getName()</CODE> gives the IPP attribute name.
  50  *
  51  * @author  Alan Kaminsky
  52  */
  53 public final class JobMessageFromOperator extends TextSyntax
  54         implements PrintJobAttribute {
  55 
  56     private static final long serialVersionUID = -4620751846003142047L;
  57 
  58     /**
  59      * Constructs a new job message from operator attribute with the given
  60      * message and locale.
  61      *
  62      * @param  message  Message.
  63      * @param  locale   Natural language of the text string. null
  64      * is interpreted to mean the default locale as returned
  65      * by <code>Locale.getDefault()</code>
  66      *
  67      * @exception  NullPointerException
  68      *     (unchecked exception) Thrown if <CODE>message</CODE> is null.
  69      */
  70     public JobMessageFromOperator(String message, Locale locale) {
  71         super (message, locale);
  72     }
  73 
  74     /**
  75      * Returns whether this job message from operator attribute is equivalent to
  76      * the passed in object. To be equivalent, all of the following conditions
  77      * must be true:
  78      * <OL TYPE=1>
  79      * <LI>
  80      * <CODE>object</CODE> is not null.
  81      * <LI>
  82      * <CODE>object</CODE> is an instance of class JobMessageFromOperator.
  83      * <LI>
  84      * This job message from operator attribute's underlying string and
  85      * <CODE>object</CODE>'s underlying string are equal.
  86      * <LI>
  87      * This job message from operator attribute's locale and
  88      * <CODE>object</CODE>'s locale are equal.
  89      * </OL>
  90      *
  91      * @param  object  Object to compare to.
  92      *
  93      * @return  True if <CODE>object</CODE> is equivalent to this job
  94      *          message from operator attribute, false otherwise.
  95      */
  96     public boolean equals(Object object) {
  97         return (super.equals (object) &&
  98                 object instanceof JobMessageFromOperator);
  99     }
 100 
 101     /**
 102      * Get the printing attribute class which is to be used as the "category"
 103      * for this printing attribute value.
 104      * <P>
 105      * For class JobMessageFromOperator, the
 106      * category is class JobMessageFromOperator itself.
 107      *
 108      * @return  Printing attribute class (category), an instance of class
 109      *          {@link java.lang.Class java.lang.Class}.
 110      */
 111     public final Class<? extends Attribute> getCategory() {
 112         return JobMessageFromOperator.class;
 113     }
 114 
 115     /**
 116      * Get the name of the category of which this attribute value is an
 117      * instance.
 118      * <P>
 119      * For class JobMessageFromOperator, the
 120      * category name is <CODE>"job-message-from-operator"</CODE>.
 121      *
 122      * @return  Attribute category name.
 123      */
 124     public final String getName() {
 125         return "job-message-from-operator";
 126     }
 127 
 128 }


  29 import javax.print.attribute.Attribute;
  30 import javax.print.attribute.TextSyntax;
  31 import javax.print.attribute.PrintJobAttribute;
  32 
  33 /**
  34  * Class JobMessageFromOperator is a printing attribute class, a text attribute,
  35  * that provides a message from an operator, system administrator, or
  36  * "intelligent" process to indicate to the end user the reasons for
  37  * modification or other management action taken on a job.
  38  * <P>
  39  * A Print Job's attribute set includes zero instances or one instance of a
  40  * JobMessageFromOperator attribute, not more than one instance. A new
  41  * JobMessageFromOperator attribute replaces an existing JobMessageFromOperator
  42  * attribute, if any. In other words, JobMessageFromOperator is not intended to
  43  * be a history log. If it wishes, the client can detect changes to a Print
  44  * Job's JobMessageFromOperator attribute and maintain the client's own history
  45  * log of the JobMessageFromOperator attribute values.
  46  * <P>
  47  * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
  48  * locale gives the IPP natural language. The category name returned by
  49  * {@code getName()} gives the IPP attribute name.
  50  *
  51  * @author  Alan Kaminsky
  52  */
  53 public final class JobMessageFromOperator extends TextSyntax
  54         implements PrintJobAttribute {
  55 
  56     private static final long serialVersionUID = -4620751846003142047L;
  57 
  58     /**
  59      * Constructs a new job message from operator attribute with the given
  60      * message and locale.
  61      *
  62      * @param  message  Message.
  63      * @param  locale   Natural language of the text string. null
  64      * is interpreted to mean the default locale as returned
  65      * by {@code Locale.getDefault()}
  66      *
  67      * @exception  NullPointerException
  68      *     (unchecked exception) Thrown if {@code message} is null.
  69      */
  70     public JobMessageFromOperator(String message, Locale locale) {
  71         super (message, locale);
  72     }
  73 
  74     /**
  75      * Returns whether this job message from operator attribute is equivalent to
  76      * the passed in object. To be equivalent, all of the following conditions
  77      * must be true:
  78      * <OL TYPE=1>
  79      * <LI>
  80      * {@code object} is not null.
  81      * <LI>
  82      * {@code object} is an instance of class JobMessageFromOperator.
  83      * <LI>
  84      * This job message from operator attribute's underlying string and
  85      * {@code object}'s underlying string are equal.
  86      * <LI>
  87      * This job message from operator attribute's locale and
  88      * {@code object}'s locale are equal.
  89      * </OL>
  90      *
  91      * @param  object  Object to compare to.
  92      *
  93      * @return  True if {@code object} is equivalent to this job
  94      *          message from operator attribute, false otherwise.
  95      */
  96     public boolean equals(Object object) {
  97         return (super.equals (object) &&
  98                 object instanceof JobMessageFromOperator);
  99     }
 100 
 101     /**
 102      * Get the printing attribute class which is to be used as the "category"
 103      * for this printing attribute value.
 104      * <P>
 105      * For class JobMessageFromOperator, the
 106      * category is class JobMessageFromOperator itself.
 107      *
 108      * @return  Printing attribute class (category), an instance of class
 109      *          {@link java.lang.Class java.lang.Class}.
 110      */
 111     public final Class<? extends Attribute> getCategory() {
 112         return JobMessageFromOperator.class;
 113     }
 114 
 115     /**
 116      * Get the name of the category of which this attribute value is an
 117      * instance.
 118      * <P>
 119      * For class JobMessageFromOperator, the
 120      * category name is {@code "job-message-from-operator"}.
 121      *
 122      * @return  Attribute category name.
 123      */
 124     public final String getName() {
 125         return "job-message-from-operator";
 126     }
 127 
 128 }
< prev index next >