< prev index next >

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

Print this page




  98  * <TR>
  99  * <TD>java.awt.image.renderable.RenderableImage</TD>
 100  * <TD>Implementation dependent*</TD>
 101  * </TR>
 102  * <TR>
 103  * <TD>java.awt.print.Printable</TD>
 104  * <TD>Implementation dependent*</TD>
 105  * </TR>
 106  * <TR>
 107  * <TD>java.awt.print.Pageable</TD>
 108  * <TD>Implementation dependent*</TD>
 109  * </TR>
 110  * </TABLE>
 111  * <P>
 112  * * In these cases the Print Service itself generates the print data sent
 113  * to the printer. If the Print Service supports the JobKOctets attribute, for
 114  * these cases the Print Service itself must calculate the size of the print
 115  * data, replacing any JobKOctets value the client specified.
 116  * <P>
 117  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
 118  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
 119  * name.
 120  *
 121  * @see JobKOctetsSupported
 122  * @see JobKOctetsProcessed
 123  * @see JobImpressions
 124  * @see JobMediaSheets
 125  *
 126  * @author  Alan Kaminsky
 127  */
 128 public final class JobKOctets   extends IntegerSyntax
 129         implements PrintRequestAttribute, PrintJobAttribute {
 130 
 131     private static final long serialVersionUID = -8959710146498202869L;
 132 
 133     /**
 134      * Construct a new job K octets attribute with the given integer value.
 135      *
 136      * @param  value  Integer value.
 137      *
 138      * @exception  IllegalArgumentException
 139      *  (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
 140      */
 141     public JobKOctets(int value) {
 142         super (value, 0, Integer.MAX_VALUE);
 143     }
 144 
 145     /**
 146      * Returns whether this job K octets attribute is equivalent to the passed
 147      * in object. To be equivalent, all of the following conditions must be
 148      * true:
 149      * <OL TYPE=1>
 150      * <LI>
 151      * <CODE>object</CODE> is not null.
 152      * <LI>
 153      * <CODE>object</CODE> is an instance of class JobKOctets.
 154      * <LI>
 155      * This job K octets attribute's value and <CODE>object</CODE>'s value
 156      * are equal.
 157      * </OL>
 158      *
 159      * @param  object  Object to compare to.
 160      *
 161      * @return  True if <CODE>object</CODE> is equivalent to this job K
 162      *          octets attribute, false otherwise.
 163      */
 164     public boolean equals(Object object) {
 165         return super.equals(object) && object instanceof JobKOctets;
 166     }
 167 
 168     /**
 169      * Get the printing attribute class which is to be used as the "category"
 170      * for this printing attribute value.
 171      * <P>
 172      * For class JobKOctets, the category is class JobKOctets itself.
 173      *
 174      * @return  Printing attribute class (category), an instance of class
 175      *          {@link java.lang.Class java.lang.Class}.
 176      */
 177     public final Class<? extends Attribute> getCategory() {
 178         return JobKOctets.class;
 179     }
 180 
 181     /**
 182      * Get the name of the category of which this attribute value is an
 183      * instance.
 184      * <P>
 185      * For class JobKOctets, the category name is <CODE>"job-k-octets"</CODE>.
 186      *
 187      * @return  Attribute category name.
 188      */
 189     public final String getName() {
 190         return "job-k-octets";
 191     }
 192 
 193 }


  98  * <TR>
  99  * <TD>java.awt.image.renderable.RenderableImage</TD>
 100  * <TD>Implementation dependent*</TD>
 101  * </TR>
 102  * <TR>
 103  * <TD>java.awt.print.Printable</TD>
 104  * <TD>Implementation dependent*</TD>
 105  * </TR>
 106  * <TR>
 107  * <TD>java.awt.print.Pageable</TD>
 108  * <TD>Implementation dependent*</TD>
 109  * </TR>
 110  * </TABLE>
 111  * <P>
 112  * * In these cases the Print Service itself generates the print data sent
 113  * to the printer. If the Print Service supports the JobKOctets attribute, for
 114  * these cases the Print Service itself must calculate the size of the print
 115  * data, replacing any JobKOctets value the client specified.
 116  * <P>
 117  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
 118  * category name returned by {@code getName()} gives the IPP attribute
 119  * name.
 120  *
 121  * @see JobKOctetsSupported
 122  * @see JobKOctetsProcessed
 123  * @see JobImpressions
 124  * @see JobMediaSheets
 125  *
 126  * @author  Alan Kaminsky
 127  */
 128 public final class JobKOctets   extends IntegerSyntax
 129         implements PrintRequestAttribute, PrintJobAttribute {
 130 
 131     private static final long serialVersionUID = -8959710146498202869L;
 132 
 133     /**
 134      * Construct a new job K octets attribute with the given integer value.
 135      *
 136      * @param  value  Integer value.
 137      *
 138      * @exception  IllegalArgumentException
 139      *  (Unchecked exception) Thrown if {@code value} is less than 0.
 140      */
 141     public JobKOctets(int value) {
 142         super (value, 0, Integer.MAX_VALUE);
 143     }
 144 
 145     /**
 146      * Returns whether this job K octets attribute is equivalent to the passed
 147      * in object. To be equivalent, all of the following conditions must be
 148      * true:
 149      * <OL TYPE=1>
 150      * <LI>
 151      * {@code object} is not null.
 152      * <LI>
 153      * {@code object} is an instance of class JobKOctets.
 154      * <LI>
 155      * This job K octets attribute's value and {@code object}'s value
 156      * are equal.
 157      * </OL>
 158      *
 159      * @param  object  Object to compare to.
 160      *
 161      * @return  True if {@code object} is equivalent to this job K
 162      *          octets attribute, false otherwise.
 163      */
 164     public boolean equals(Object object) {
 165         return super.equals(object) && object instanceof JobKOctets;
 166     }
 167 
 168     /**
 169      * Get the printing attribute class which is to be used as the "category"
 170      * for this printing attribute value.
 171      * <P>
 172      * For class JobKOctets, the category is class JobKOctets itself.
 173      *
 174      * @return  Printing attribute class (category), an instance of class
 175      *          {@link java.lang.Class java.lang.Class}.
 176      */
 177     public final Class<? extends Attribute> getCategory() {
 178         return JobKOctets.class;
 179     }
 180 
 181     /**
 182      * Get the name of the category of which this attribute value is an
 183      * instance.
 184      * <P>
 185      * For class JobKOctets, the category name is {@code "job-k-octets"}.
 186      *
 187      * @return  Attribute category name.
 188      */
 189     public final String getName() {
 190         return "job-k-octets";
 191     }
 192 
 193 }
< prev index next >