< prev index next >

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

Print this page




  38  * scheduling information if known. The printer may try to compute the
  39  * JobMediaSheets attribute's value if it is not supplied in the Print Request.
  40  * Even if the client does supply a value for the JobMediaSheets attribute in
  41  * the Print Request, the printer may choose to change the value if the printer
  42  * is able to compute a value which is more accurate than the client supplied
  43  * value. The printer may be able to determine the correct value for the
  44  * JobMediaSheets attribute either right at job submission time or at any later
  45  * point in time.
  46  * <P>
  47  * Unlike the {@link JobKOctets JobKOctets} and {@link JobImpressions
  48  * JobImpressions} attributes, the JobMediaSheets value must include the
  49  * multiplicative factors contributed by the number of copies specified by the
  50  * {@link Copies Copies} attribute and a "number of copies" instruction embedded
  51  * in the document data, if any. This difference allows the system administrator
  52  * to control the lower and upper bounds of both (1) the size of the document(s)
  53  * with {@link JobKOctetsSupported JobKOctetsSupported} and {@link
  54  * JobImpressionsSupported JobImpressionsSupported} and (2) the size of the job
  55  * with {@link JobMediaSheetsSupported JobMediaSheetsSupported}.
  56  * <P>
  57  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
  58  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  59  * name.
  60  *
  61  * @see JobMediaSheetsSupported
  62  * @see JobMediaSheetsCompleted
  63  * @see JobKOctets
  64  * @see JobImpressions
  65  *
  66  * @author  Alan Kaminsky
  67  */
  68 public class JobMediaSheets extends IntegerSyntax
  69         implements PrintRequestAttribute, PrintJobAttribute {
  70 
  71 
  72     private static final long serialVersionUID = 408871131531979741L;
  73 
  74     /**
  75      * Construct a new job media sheets attribute with the given integer
  76      * value.
  77      *
  78      * @param  value  Integer value.
  79      *
  80      * @exception  IllegalArgumentException
  81      *   (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
  82      */
  83     public JobMediaSheets(int value) {
  84         super (value, 0, Integer.MAX_VALUE);
  85     }
  86 
  87     /**
  88      * Returns whether this job media sheets attribute is equivalent to the
  89      * passed in object. To be equivalent, all of the following conditions must
  90      * be true:
  91      * <OL TYPE=1>
  92      * <LI>
  93      * <CODE>object</CODE> is not null.
  94      * <LI>
  95      * <CODE>object</CODE> is an instance of class JobMediaSheets.
  96      * <LI>
  97      * This job media sheets attribute's value and <CODE>object</CODE>'s
  98      * value are equal.
  99      * </OL>
 100      *
 101      * @param  object  Object to compare to.
 102      *
 103      * @return  True if <CODE>object</CODE> is equivalent to this job media
 104      *          sheets attribute, false otherwise.
 105      */
 106     public boolean equals(Object object) {
 107         return super.equals(object) && object instanceof JobMediaSheets;
 108     }
 109 
 110     /**
 111      * Get the printing attribute class which is to be used as the "category"
 112      * for this printing attribute value.
 113      * <P>
 114      * For class JobMediaSheets and any vendor-defined subclasses, the category
 115      * is class JobMediaSheets itself.
 116      *
 117      * @return  Printing attribute class (category), an instance of class
 118      *          {@link java.lang.Class java.lang.Class}.
 119      */
 120     public final Class<? extends Attribute> getCategory() {
 121         return JobMediaSheets.class;
 122     }
 123 
 124     /**
 125      * Get the name of the category of which this attribute value is an
 126      * instance.
 127      * <P>
 128      * For class JobMediaSheets and any vendor-defined subclasses, the
 129      * category name is <CODE>"job-media-sheets"</CODE>.
 130      *
 131      * @return  Attribute category name.
 132      */
 133     public final String getName() {
 134         return "job-media-sheets";
 135     }
 136 
 137 }


  38  * scheduling information if known. The printer may try to compute the
  39  * JobMediaSheets attribute's value if it is not supplied in the Print Request.
  40  * Even if the client does supply a value for the JobMediaSheets attribute in
  41  * the Print Request, the printer may choose to change the value if the printer
  42  * is able to compute a value which is more accurate than the client supplied
  43  * value. The printer may be able to determine the correct value for the
  44  * JobMediaSheets attribute either right at job submission time or at any later
  45  * point in time.
  46  * <P>
  47  * Unlike the {@link JobKOctets JobKOctets} and {@link JobImpressions
  48  * JobImpressions} attributes, the JobMediaSheets value must include the
  49  * multiplicative factors contributed by the number of copies specified by the
  50  * {@link Copies Copies} attribute and a "number of copies" instruction embedded
  51  * in the document data, if any. This difference allows the system administrator
  52  * to control the lower and upper bounds of both (1) the size of the document(s)
  53  * with {@link JobKOctetsSupported JobKOctetsSupported} and {@link
  54  * JobImpressionsSupported JobImpressionsSupported} and (2) the size of the job
  55  * with {@link JobMediaSheetsSupported JobMediaSheetsSupported}.
  56  * <P>
  57  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
  58  * category name returned by {@code getName()} gives the IPP attribute
  59  * name.
  60  *
  61  * @see JobMediaSheetsSupported
  62  * @see JobMediaSheetsCompleted
  63  * @see JobKOctets
  64  * @see JobImpressions
  65  *
  66  * @author  Alan Kaminsky
  67  */
  68 public class JobMediaSheets extends IntegerSyntax
  69         implements PrintRequestAttribute, PrintJobAttribute {
  70 
  71 
  72     private static final long serialVersionUID = 408871131531979741L;
  73 
  74     /**
  75      * Construct a new job media sheets attribute with the given integer
  76      * value.
  77      *
  78      * @param  value  Integer value.
  79      *
  80      * @exception  IllegalArgumentException
  81      *   (Unchecked exception) Thrown if {@code value} is less than 0.
  82      */
  83     public JobMediaSheets(int value) {
  84         super (value, 0, Integer.MAX_VALUE);
  85     }
  86 
  87     /**
  88      * Returns whether this job media sheets attribute is equivalent to the
  89      * passed in object. To be equivalent, all of the following conditions must
  90      * be true:
  91      * <OL TYPE=1>
  92      * <LI>
  93      * {@code object} is not null.
  94      * <LI>
  95      * {@code object} is an instance of class JobMediaSheets.
  96      * <LI>
  97      * This job media sheets attribute's value and {@code object}'s
  98      * value are equal.
  99      * </OL>
 100      *
 101      * @param  object  Object to compare to.
 102      *
 103      * @return  True if {@code object} is equivalent to this job media
 104      *          sheets attribute, false otherwise.
 105      */
 106     public boolean equals(Object object) {
 107         return super.equals(object) && object instanceof JobMediaSheets;
 108     }
 109 
 110     /**
 111      * Get the printing attribute class which is to be used as the "category"
 112      * for this printing attribute value.
 113      * <P>
 114      * For class JobMediaSheets and any vendor-defined subclasses, the category
 115      * is class JobMediaSheets itself.
 116      *
 117      * @return  Printing attribute class (category), an instance of class
 118      *          {@link java.lang.Class java.lang.Class}.
 119      */
 120     public final Class<? extends Attribute> getCategory() {
 121         return JobMediaSheets.class;
 122     }
 123 
 124     /**
 125      * Get the name of the category of which this attribute value is an
 126      * instance.
 127      * <P>
 128      * For class JobMediaSheets and any vendor-defined subclasses, the
 129      * category name is {@code "job-media-sheets"}.
 130      *
 131      * @return  Attribute category name.
 132      */
 133     public final String getName() {
 134         return "job-media-sheets";
 135     }
 136 
 137 }
< prev index next >