< prev index next >

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

Print this page




  25 package javax.print.attribute.standard;
  26 
  27 import javax.print.attribute.Attribute;
  28 import javax.print.attribute.IntegerSyntax;
  29 import javax.print.attribute.SupportedValuesAttribute;
  30 
  31 /**
  32  * Class JobPrioritySupported is an integer valued printing attribute class
  33  * that specifies whether a Print Service instance supports the {@link
  34  * JobPriority JobPriority} attribute and the number of different job priority
  35  * levels supported.
  36  * <P>
  37  * The client can always specify any {@link JobPriority JobPriority} value
  38  * from 1 to 100 for a job. However, the Print Service instance may support
  39  * fewer than 100 different job priority levels. If this is the case, the
  40  * Print Service instance automatically maps the client-specified job priority
  41  * value to one of the supported job priority levels, dividing the 100 job
  42  * priority values equally among the available job priority levels.
  43  * <P>
  44  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value.
  45  * The category name returned by <CODE>getName()</CODE> gives the IPP
  46  * attribute name.
  47  *
  48  * @author  Alan Kaminsky
  49  */
  50 public final class JobPrioritySupported extends IntegerSyntax
  51     implements SupportedValuesAttribute {
  52 
  53     private static final long serialVersionUID = 2564840378013555894L;
  54 
  55 
  56     /**
  57      * Construct a new job priority supported attribute with the given integer
  58      * value.
  59      *
  60      * @param  value  Number of different job priority levels supported.
  61      *
  62      * @exception  IllegalArgumentException
  63      *     (Unchecked exception) Thrown if <CODE>value</CODE> is less than 1
  64      *     or greater than 100.
  65      */
  66     public JobPrioritySupported(int value) {
  67         super (value, 1, 100);
  68     }
  69 
  70     /**
  71      * Returns whether this job priority supported attribute is equivalent to
  72      * the passed in object. To be equivalent, all of the following conditions
  73      * must be true:
  74      * <OL TYPE=1>
  75      * <LI>
  76      * <CODE>object</CODE> is not null.
  77      * <LI>
  78      * <CODE>object</CODE> is an instance of class JobPrioritySupported.
  79      * <LI>
  80      * This job priority supported attribute's value and
  81      * <CODE>object</CODE>'s value are equal.
  82      * </OL>
  83      *
  84      * @param  object  Object to compare to.
  85      *
  86      * @return  True if <CODE>object</CODE> is equivalent to this job
  87      *          priority supported attribute, false otherwise.
  88      */
  89     public boolean equals (Object object) {
  90 
  91         return (super.equals(object) &&
  92                object instanceof JobPrioritySupported);
  93     }
  94 
  95 
  96     /**
  97      * Get the printing attribute class which is to be used as the "category"
  98      * for this printing attribute value.
  99      * <P>
 100      * For class JobPrioritySupported, the
 101      * category is class JobPrioritySupported itself.
 102      *
 103      * @return  Printing attribute class (category), an instance of class
 104      *          {@link java.lang.Class java.lang.Class}.
 105      */
 106     public final Class<? extends Attribute> getCategory() {
 107         return JobPrioritySupported.class;
 108     }
 109 
 110     /**
 111      * Get the name of the category of which this attribute value is an
 112      * instance.
 113      * <P>
 114      * For class JobPrioritySupported, the
 115      * category name is <CODE>"job-priority-supported"</CODE>.
 116      *
 117      * @return  Attribute category name.
 118      */
 119     public final String getName() {
 120         return "job-priority-supported";
 121     }
 122 
 123 }


  25 package javax.print.attribute.standard;
  26 
  27 import javax.print.attribute.Attribute;
  28 import javax.print.attribute.IntegerSyntax;
  29 import javax.print.attribute.SupportedValuesAttribute;
  30 
  31 /**
  32  * Class JobPrioritySupported is an integer valued printing attribute class
  33  * that specifies whether a Print Service instance supports the {@link
  34  * JobPriority JobPriority} attribute and the number of different job priority
  35  * levels supported.
  36  * <P>
  37  * The client can always specify any {@link JobPriority JobPriority} value
  38  * from 1 to 100 for a job. However, the Print Service instance may support
  39  * fewer than 100 different job priority levels. If this is the case, the
  40  * Print Service instance automatically maps the client-specified job priority
  41  * value to one of the supported job priority levels, dividing the 100 job
  42  * priority values equally among the available job priority levels.
  43  * <P>
  44  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value.
  45  * The category name returned by {@code getName()} gives the IPP
  46  * attribute name.
  47  *
  48  * @author  Alan Kaminsky
  49  */
  50 public final class JobPrioritySupported extends IntegerSyntax
  51     implements SupportedValuesAttribute {
  52 
  53     private static final long serialVersionUID = 2564840378013555894L;
  54 
  55 
  56     /**
  57      * Construct a new job priority supported attribute with the given integer
  58      * value.
  59      *
  60      * @param  value  Number of different job priority levels supported.
  61      *
  62      * @exception  IllegalArgumentException
  63      *     (Unchecked exception) Thrown if {@code value} is less than 1
  64      *     or greater than 100.
  65      */
  66     public JobPrioritySupported(int value) {
  67         super (value, 1, 100);
  68     }
  69 
  70     /**
  71      * Returns whether this job priority supported attribute is equivalent to
  72      * the passed in object. To be equivalent, all of the following conditions
  73      * must be true:
  74      * <OL TYPE=1>
  75      * <LI>
  76      * {@code object} is not null.
  77      * <LI>
  78      * {@code object} is an instance of class JobPrioritySupported.
  79      * <LI>
  80      * This job priority supported attribute's value and
  81      * {@code object}'s value are equal.
  82      * </OL>
  83      *
  84      * @param  object  Object to compare to.
  85      *
  86      * @return  True if {@code object} is equivalent to this job
  87      *          priority supported attribute, false otherwise.
  88      */
  89     public boolean equals (Object object) {
  90 
  91         return (super.equals(object) &&
  92                object instanceof JobPrioritySupported);
  93     }
  94 
  95 
  96     /**
  97      * Get the printing attribute class which is to be used as the "category"
  98      * for this printing attribute value.
  99      * <P>
 100      * For class JobPrioritySupported, the
 101      * category is class JobPrioritySupported itself.
 102      *
 103      * @return  Printing attribute class (category), an instance of class
 104      *          {@link java.lang.Class java.lang.Class}.
 105      */
 106     public final Class<? extends Attribute> getCategory() {
 107         return JobPrioritySupported.class;
 108     }
 109 
 110     /**
 111      * Get the name of the category of which this attribute value is an
 112      * instance.
 113      * <P>
 114      * For class JobPrioritySupported, the
 115      * category name is {@code "job-priority-supported"}.
 116      *
 117      * @return  Attribute category name.
 118      */
 119     public final String getName() {
 120         return "job-priority-supported";
 121     }
 122 
 123 }
< prev index next >