< prev index next >

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

Print this page




  28 import javax.print.attribute.IntegerSyntax;
  29 import javax.print.attribute.PrintJobAttribute;
  30 
  31 /**
  32  * Class JobImpressionsCompleted is an integer valued printing attribute class
  33  * that specifies the number of impressions completed for the job so far. For
  34  * printing devices, the impressions completed includes interpreting, marking,
  35  * and stacking the output.
  36  * <P>
  37  * The JobImpressionsCompleted attribute describes the progress of the job. This
  38  * attribute is intended to be a counter. That is, the JobImpressionsCompleted
  39  * value for a job that has not started processing must be 0. When the job's
  40  * {@link JobState JobState} is PROCESSING or PROCESSING_STOPPED, the
  41  * JobImpressionsCompleted value is intended to increase as the job is
  42  * processed; it indicates the amount of the job that has been processed at the
  43  * time the Print Job's attribute set is queried or at the time a print job
  44  * event is reported. When the job enters the COMPLETED, CANCELED, or ABORTED
  45  * states, the JobImpressionsCompleted value is the final value for the job.
  46  * <P>
  47  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
  48  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  49  * name.
  50  *
  51  * @see JobImpressions
  52  * @see JobImpressionsSupported
  53  * @see JobKOctetsProcessed
  54  * @see JobMediaSheetsCompleted
  55  *
  56  * @author  Alan Kaminsky
  57  */
  58 public final class JobImpressionsCompleted extends IntegerSyntax
  59         implements PrintJobAttribute {
  60 
  61     private static final long serialVersionUID = 6722648442432393294L;
  62 
  63     /**
  64      * Construct a new job impressions completed attribute with the given
  65      * integer value.
  66      *
  67      * @param  value  Integer value.
  68      *
  69      * @exception  IllegalArgumentException
  70      *  (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
  71      */
  72     public JobImpressionsCompleted(int value) {
  73         super (value, 0, Integer.MAX_VALUE);
  74     }
  75 
  76     /**
  77      * Returns whether this job impressions completed attribute is equivalent
  78      * tp the passed in object. To be equivalent, all of the following
  79      * conditions must be true:
  80      * <OL TYPE=1>
  81      * <LI>
  82      * <CODE>object</CODE> is not null.
  83      * <LI>
  84      * <CODE>object</CODE> is an instance of class JobImpressionsCompleted.
  85      * <LI>
  86      * This job impressions completed attribute's value and
  87      * <CODE>object</CODE>'s value are equal.
  88      * </OL>
  89      *
  90      * @param  object  Object to compare to.
  91      *
  92      * @return  True if <CODE>object</CODE> is equivalent to this job
  93      *          impressions completed attribute, false otherwise.
  94      */
  95     public boolean equals(Object object) {
  96         return(super.equals (object) &&
  97                object instanceof JobImpressionsCompleted);
  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 JobImpressionsCompleted, the category is class
 105      * JobImpressionsCompleted 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 JobImpressionsCompleted.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 JobImpressionsCompleted, the category name is
 119      * <CODE>"job-impressions-completed"</CODE>.
 120      *
 121      * @return  Attribute category name.
 122      */
 123     public final String getName() {
 124         return "job-impressions-completed";
 125     }
 126 
 127 }


  28 import javax.print.attribute.IntegerSyntax;
  29 import javax.print.attribute.PrintJobAttribute;
  30 
  31 /**
  32  * Class JobImpressionsCompleted is an integer valued printing attribute class
  33  * that specifies the number of impressions completed for the job so far. For
  34  * printing devices, the impressions completed includes interpreting, marking,
  35  * and stacking the output.
  36  * <P>
  37  * The JobImpressionsCompleted attribute describes the progress of the job. This
  38  * attribute is intended to be a counter. That is, the JobImpressionsCompleted
  39  * value for a job that has not started processing must be 0. When the job's
  40  * {@link JobState JobState} is PROCESSING or PROCESSING_STOPPED, the
  41  * JobImpressionsCompleted value is intended to increase as the job is
  42  * processed; it indicates the amount of the job that has been processed at the
  43  * time the Print Job's attribute set is queried or at the time a print job
  44  * event is reported. When the job enters the COMPLETED, CANCELED, or ABORTED
  45  * states, the JobImpressionsCompleted value is the final value for the job.
  46  * <P>
  47  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
  48  * category name returned by {@code getName()} gives the IPP attribute
  49  * name.
  50  *
  51  * @see JobImpressions
  52  * @see JobImpressionsSupported
  53  * @see JobKOctetsProcessed
  54  * @see JobMediaSheetsCompleted
  55  *
  56  * @author  Alan Kaminsky
  57  */
  58 public final class JobImpressionsCompleted extends IntegerSyntax
  59         implements PrintJobAttribute {
  60 
  61     private static final long serialVersionUID = 6722648442432393294L;
  62 
  63     /**
  64      * Construct a new job impressions completed attribute with the given
  65      * integer value.
  66      *
  67      * @param  value  Integer value.
  68      *
  69      * @exception  IllegalArgumentException
  70      *  (Unchecked exception) Thrown if {@code value} is less than 0.
  71      */
  72     public JobImpressionsCompleted(int value) {
  73         super (value, 0, Integer.MAX_VALUE);
  74     }
  75 
  76     /**
  77      * Returns whether this job impressions completed attribute is equivalent
  78      * tp the passed in object. To be equivalent, all of the following
  79      * conditions must be true:
  80      * <OL TYPE=1>
  81      * <LI>
  82      * {@code object} is not null.
  83      * <LI>
  84      * {@code object} is an instance of class JobImpressionsCompleted.
  85      * <LI>
  86      * This job impressions completed attribute's value and
  87      * {@code object}'s value are equal.
  88      * </OL>
  89      *
  90      * @param  object  Object to compare to.
  91      *
  92      * @return  True if {@code object} is equivalent to this job
  93      *          impressions completed attribute, false otherwise.
  94      */
  95     public boolean equals(Object object) {
  96         return(super.equals (object) &&
  97                object instanceof JobImpressionsCompleted);
  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 JobImpressionsCompleted, the category is class
 105      * JobImpressionsCompleted 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 JobImpressionsCompleted.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 JobImpressionsCompleted, the category name is
 119      * {@code "job-impressions-completed"}.
 120      *
 121      * @return  Attribute category name.
 122      */
 123     public final String getName() {
 124         return "job-impressions-completed";
 125     }
 126 
 127 }
< prev index next >