< prev index next >

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

Print this page




  35  * <P>
  36  * If a JobPriority attribute is specified for a Print Job, it specifies a
  37  * priority for scheduling the job. A higher value specifies a higher priority.
  38  * The value 1 indicates the lowest possible priority. The value 100 indicates
  39  * the highest possible priority. Among those jobs that are ready to print, a
  40  * printer must print all jobs with a priority value of <I>n</I> before printing
  41  * those with a priority value of <I>n</I>-1 for all <I>n.</I>
  42  * <P>
  43  * If the client does not specify a JobPriority attribute for a Print Job and
  44  * the printer does support the JobPriority attribute, the printer must use an
  45  * implementation-defined default JobPriority value.
  46  * <P>
  47  * The client can always specify any job priority value from 1 to 100 for a job.
  48  * However, a Print Service instance may support fewer than 100 different
  49  * job priority levels. If this is the case, the Print Service instance
  50  * automatically maps the client-specified job priority value to one of the
  51  * supported job priority levels, dividing the 100 job priority values equally
  52  * among the available job priority levels.
  53  * <P>
  54  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
  55  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  56  * name.
  57  *
  58  * @author  Alan Kaminsky
  59  */
  60 public final class JobPriority extends IntegerSyntax
  61     implements PrintRequestAttribute, PrintJobAttribute {
  62 
  63     private static final long serialVersionUID = -4599900369040602769L;
  64 
  65     /**
  66      * Construct a new job priority attribute with the given integer value.
  67      *
  68      * @param  value  Integer value.
  69      *
  70      * @exception  IllegalArgumentException
  71      *     (Unchecked exception) Thrown if <CODE>value</CODE> is less than 1
  72      *     or greater than 100.
  73      */
  74     public JobPriority(int value) {
  75         super (value, 1, 100);
  76     }
  77 
  78     /**
  79      * Returns whether this job priority attribute is equivalent to the passed
  80      * in object. To be equivalent, all of the following conditions must be
  81      * true:
  82      * <OL TYPE=1>
  83      * <LI>
  84      * <CODE>object</CODE> is not null.
  85      * <LI>
  86      * <CODE>object</CODE> is an instance of class JobPriority.
  87      * <LI>
  88      * This job priority attribute's value and <CODE>object</CODE>'s value
  89      * are equal.
  90      * </OL>
  91      *
  92      * @param  object  Object to compare to.
  93      *
  94      * @return  True if <CODE>object</CODE> is equivalent to this job
  95      *          priority attribute, false otherwise.
  96      */
  97     public boolean equals(Object object) {
  98         return (super.equals (object) && object instanceof JobPriority);
  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 JobPriority, the category is class JobPriority 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 JobPriority.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 JobPriority, the category name is <CODE>"job-priority"</CODE>.
 119      *
 120      * @return  Attribute category name.
 121      */
 122     public final String getName() {
 123         return "job-priority";
 124     }
 125 
 126 }


  35  * <P>
  36  * If a JobPriority attribute is specified for a Print Job, it specifies a
  37  * priority for scheduling the job. A higher value specifies a higher priority.
  38  * The value 1 indicates the lowest possible priority. The value 100 indicates
  39  * the highest possible priority. Among those jobs that are ready to print, a
  40  * printer must print all jobs with a priority value of <I>n</I> before printing
  41  * those with a priority value of <I>n</I>-1 for all <I>n.</I>
  42  * <P>
  43  * If the client does not specify a JobPriority attribute for a Print Job and
  44  * the printer does support the JobPriority attribute, the printer must use an
  45  * implementation-defined default JobPriority value.
  46  * <P>
  47  * The client can always specify any job priority value from 1 to 100 for a job.
  48  * However, a Print Service instance may support fewer than 100 different
  49  * job priority levels. If this is the case, the Print Service instance
  50  * automatically maps the client-specified job priority value to one of the
  51  * supported job priority levels, dividing the 100 job priority values equally
  52  * among the available job priority levels.
  53  * <P>
  54  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
  55  * category name returned by {@code getName()} gives the IPP attribute
  56  * name.
  57  *
  58  * @author  Alan Kaminsky
  59  */
  60 public final class JobPriority extends IntegerSyntax
  61     implements PrintRequestAttribute, PrintJobAttribute {
  62 
  63     private static final long serialVersionUID = -4599900369040602769L;
  64 
  65     /**
  66      * Construct a new job priority attribute with the given integer value.
  67      *
  68      * @param  value  Integer value.
  69      *
  70      * @exception  IllegalArgumentException
  71      *     (Unchecked exception) Thrown if {@code value} is less than 1
  72      *     or greater than 100.
  73      */
  74     public JobPriority(int value) {
  75         super (value, 1, 100);
  76     }
  77 
  78     /**
  79      * Returns whether this job priority attribute is equivalent to the passed
  80      * in object. To be equivalent, all of the following conditions must be
  81      * true:
  82      * <OL TYPE=1>
  83      * <LI>
  84      * {@code object} is not null.
  85      * <LI>
  86      * {@code object} is an instance of class JobPriority.
  87      * <LI>
  88      * This job priority attribute's value and {@code object}'s value
  89      * are equal.
  90      * </OL>
  91      *
  92      * @param  object  Object to compare to.
  93      *
  94      * @return  True if {@code object} is equivalent to this job
  95      *          priority attribute, false otherwise.
  96      */
  97     public boolean equals(Object object) {
  98         return (super.equals (object) && object instanceof JobPriority);
  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 JobPriority, the category is class JobPriority 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 JobPriority.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 JobPriority, the category name is {@code "job-priority"}.
 119      *
 120      * @return  Attribute category name.
 121      */
 122     public final String getName() {
 123         return "job-priority";
 124     }
 125 
 126 }
< prev index next >