< prev index next >

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

Print this page




  25 package javax.print.attribute.standard;
  26 
  27 import java.util.Locale;
  28 
  29 import javax.print.attribute.Attribute;
  30 import javax.print.attribute.TextSyntax;
  31 import javax.print.attribute.PrintJobAttribute;
  32 
  33 /**
  34  * Class OutputDeviceAssigned is a printing attribute class, a text attribute,
  35  * that identifies the output device to which the service has assigned this
  36  * job. If an output device implements an embedded Print Service instance, the
  37  * printer need not set this attribute. If a print server implements a
  38  * Print Service instance, the value may be empty (zero- length string) or not
  39  * returned until the service assigns an output device to the job. This
  40  * attribute is particularly useful when a single service supports multiple
  41  * devices (so called "fan-out").
  42  * <P>
  43  * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
  44  * locale gives the IPP natural language. The category name returned by
  45  * <CODE>getName()</CODE> gives the IPP attribute name.
  46  *
  47  * @author  Alan Kaminsky
  48  */
  49 public final class OutputDeviceAssigned extends TextSyntax
  50     implements PrintJobAttribute {
  51 
  52     private static final long serialVersionUID = 5486733778854271081L;
  53 
  54     /**
  55      * Constructs a new output device assigned attribute with the given device
  56      * name and locale.
  57      *
  58      * @param  deviceName  Device name.
  59      * @param  locale      Natural language of the text string. null
  60      * is interpreted to mean the default locale as returned
  61      * by <code>Locale.getDefault()</code>
  62      *
  63      * @exception  NullPointerException
  64      *   (unchecked exception) Thrown if <CODE>deviceName</CODE> is null.
  65      */
  66     public OutputDeviceAssigned(String deviceName, Locale locale) {
  67 
  68         super (deviceName, locale);
  69     }
  70 
  71     // Exported operations inherited and overridden from class Object.
  72 
  73     /**
  74      * Returns whether this output device assigned attribute is equivalent to
  75      * the passed in object. To be equivalent, all of the following conditions
  76      * must be true:
  77      * <OL TYPE=1>
  78      * <LI>
  79      * <CODE>object</CODE> is not null.
  80      * <LI>
  81      * <CODE>object</CODE> is an instance of class OutputDeviceAssigned.
  82      * <LI>
  83      * This output device assigned attribute's underlying string and
  84      * <CODE>object</CODE>'s underlying string are equal.
  85      * <LI>
  86      * This output device assigned attribute's locale and
  87      * <CODE>object</CODE>'s locale are equal.
  88      * </OL>
  89      *
  90      * @param  object  Object to compare to.
  91      *
  92      * @return  True if <CODE>object</CODE> is equivalent to this output
  93      *          device assigned attribute, false otherwise.
  94      */
  95     public boolean equals(Object object) {
  96         return (super.equals (object) &&
  97                 object instanceof OutputDeviceAssigned);
  98     }
  99 
 100     /**
 101      * Get the printing attribute class which is to be used as the "category"
 102      * for this printing attribute value.
 103      * <P>
 104      * For class OutputDeviceAssigned, the
 105      * category is class OutputDeviceAssigned itself.
 106      *
 107      * @return  Printing attribute class (category), an instance of class
 108      *          {@link java.lang.Class java.lang.Class}.
 109      */
 110     public final Class<? extends Attribute> getCategory() {
 111         return OutputDeviceAssigned.class;
 112     }
 113 
 114     /**
 115      * Get the name of the category of which this attribute value is an
 116      * instance.
 117      * <P>
 118      * For class OutputDeviceAssigned, the
 119      * category name is <CODE>"output-device-assigned"</CODE>.
 120      *
 121      * @return  Attribute category name.
 122      */
 123     public final String getName() {
 124         return "output-device-assigned";
 125     }
 126 
 127 }


  25 package javax.print.attribute.standard;
  26 
  27 import java.util.Locale;
  28 
  29 import javax.print.attribute.Attribute;
  30 import javax.print.attribute.TextSyntax;
  31 import javax.print.attribute.PrintJobAttribute;
  32 
  33 /**
  34  * Class OutputDeviceAssigned is a printing attribute class, a text attribute,
  35  * that identifies the output device to which the service has assigned this
  36  * job. If an output device implements an embedded Print Service instance, the
  37  * printer need not set this attribute. If a print server implements a
  38  * Print Service instance, the value may be empty (zero- length string) or not
  39  * returned until the service assigns an output device to the job. This
  40  * attribute is particularly useful when a single service supports multiple
  41  * devices (so called "fan-out").
  42  * <P>
  43  * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
  44  * locale gives the IPP natural language. The category name returned by
  45  * {@code getName()} gives the IPP attribute name.
  46  *
  47  * @author  Alan Kaminsky
  48  */
  49 public final class OutputDeviceAssigned extends TextSyntax
  50     implements PrintJobAttribute {
  51 
  52     private static final long serialVersionUID = 5486733778854271081L;
  53 
  54     /**
  55      * Constructs a new output device assigned attribute with the given device
  56      * name and locale.
  57      *
  58      * @param  deviceName  Device name.
  59      * @param  locale      Natural language of the text string. null
  60      * is interpreted to mean the default locale as returned
  61      * by {@code Locale.getDefault()}
  62      *
  63      * @exception  NullPointerException
  64      *   (unchecked exception) Thrown if {@code deviceName} is null.
  65      */
  66     public OutputDeviceAssigned(String deviceName, Locale locale) {
  67 
  68         super (deviceName, locale);
  69     }
  70 
  71     // Exported operations inherited and overridden from class Object.
  72 
  73     /**
  74      * Returns whether this output device assigned attribute is equivalent to
  75      * the passed in object. To be equivalent, all of the following conditions
  76      * must be true:
  77      * <OL TYPE=1>
  78      * <LI>
  79      * {@code object} is not null.
  80      * <LI>
  81      * {@code object} is an instance of class OutputDeviceAssigned.
  82      * <LI>
  83      * This output device assigned attribute's underlying string and
  84      * {@code object}'s underlying string are equal.
  85      * <LI>
  86      * This output device assigned attribute's locale and
  87      * {@code object}'s locale are equal.
  88      * </OL>
  89      *
  90      * @param  object  Object to compare to.
  91      *
  92      * @return  True if {@code object} is equivalent to this output
  93      *          device assigned attribute, false otherwise.
  94      */
  95     public boolean equals(Object object) {
  96         return (super.equals (object) &&
  97                 object instanceof OutputDeviceAssigned);
  98     }
  99 
 100     /**
 101      * Get the printing attribute class which is to be used as the "category"
 102      * for this printing attribute value.
 103      * <P>
 104      * For class OutputDeviceAssigned, the
 105      * category is class OutputDeviceAssigned itself.
 106      *
 107      * @return  Printing attribute class (category), an instance of class
 108      *          {@link java.lang.Class java.lang.Class}.
 109      */
 110     public final Class<? extends Attribute> getCategory() {
 111         return OutputDeviceAssigned.class;
 112     }
 113 
 114     /**
 115      * Get the name of the category of which this attribute value is an
 116      * instance.
 117      * <P>
 118      * For class OutputDeviceAssigned, the
 119      * category name is {@code "output-device-assigned"}.
 120      *
 121      * @return  Attribute category name.
 122      */
 123     public final String getName() {
 124         return "output-device-assigned";
 125     }
 126 
 127 }
< prev index next >