< prev index next >

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

Print this page




  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package javax.print.attribute.standard;
  26 
  27 import javax.print.attribute.Attribute;
  28 import javax.print.attribute.IntegerSyntax;
  29 import javax.print.attribute.PrintServiceAttribute;
  30 
  31 /**
  32  * Class PagesPerMinute is an integer valued printing attribute that indicates
  33  * the nominal number of pages per minute to the nearest whole number which may
  34  * be generated by this printer (e.g., simplex, black-and-white). This attribute
  35  * is informative, not a service guarantee. Generally, it is the value used in
  36  * the marketing literature to describe the device. A value of 0 indicates a
  37  * device that takes more than two minutes to process a page.
  38  * <P>
  39  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
  40  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  41  * name.
  42  *
  43  * @author  Alan Kaminsky
  44  */
  45 public final class PagesPerMinute extends IntegerSyntax
  46         implements PrintServiceAttribute {
  47 
  48     private static final long serialVersionUID = -6366403993072862015L;
  49 
  50     /**
  51      * Construct a new pages per minute attribute with the given integer
  52      * value.
  53      *
  54      * @param  value  Integer value.
  55      *
  56      * @exception  IllegalArgumentException
  57      *   (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
  58      */
  59     public PagesPerMinute(int value) {
  60         super(value, 0, Integer.MAX_VALUE);
  61     }
  62 
  63     /**
  64      * Returns whether this pages per minute attribute is equivalent to the
  65      * passed in object. To be equivalent, all of the following conditions
  66      * must be true:
  67      * <OL TYPE=1>
  68      * <LI>
  69      * <CODE>object</CODE> is not null.
  70      * <LI>
  71      * <CODE>object</CODE> is an instance of class PagesPerMinute.
  72      * <LI>
  73      * This pages per minute attribute's value and <CODE>object</CODE>'s
  74      * value are equal.
  75      * </OL>
  76      *
  77      * @param  object  Object to compare to.
  78      *
  79      * @return  True if <CODE>object</CODE> is equivalent to this pages per
  80      *          minute attribute, false otherwise.
  81      */
  82     public boolean equals(Object object) {
  83         return (super.equals (object) &&
  84                 object instanceof PagesPerMinute);
  85     }
  86 
  87     /**
  88      * Get the printing attribute class which is to be used as the "category"
  89      * for this printing attribute value.
  90      * <P>
  91      * For class PagesPerMinute, the category is class PagesPerMinute itself.
  92      *
  93      * @return  Printing attribute class (category), an instance of class
  94      *          {@link java.lang.Class java.lang.Class}.
  95      */
  96     public final Class<? extends Attribute> getCategory() {
  97         return PagesPerMinute.class;
  98     }
  99 
 100     /**
 101      * Get the name of the category of which this attribute value is an
 102      * instance.
 103      * <P>
 104      * For class PagesPerMinute, the
 105      * category name is <CODE>"pages-per-minute"</CODE>.
 106      *
 107      * @return  Attribute category name.
 108      */
 109     public final String getName() {
 110         return "pages-per-minute";
 111     }
 112 
 113 }


  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package javax.print.attribute.standard;
  26 
  27 import javax.print.attribute.Attribute;
  28 import javax.print.attribute.IntegerSyntax;
  29 import javax.print.attribute.PrintServiceAttribute;
  30 
  31 /**
  32  * Class PagesPerMinute is an integer valued printing attribute that indicates
  33  * the nominal number of pages per minute to the nearest whole number which may
  34  * be generated by this printer (e.g., simplex, black-and-white). This attribute
  35  * is informative, not a service guarantee. Generally, it is the value used in
  36  * the marketing literature to describe the device. A value of 0 indicates a
  37  * device that takes more than two minutes to process a page.
  38  * <P>
  39  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
  40  * category name returned by {@code getName()} gives the IPP attribute
  41  * name.
  42  *
  43  * @author  Alan Kaminsky
  44  */
  45 public final class PagesPerMinute extends IntegerSyntax
  46         implements PrintServiceAttribute {
  47 
  48     private static final long serialVersionUID = -6366403993072862015L;
  49 
  50     /**
  51      * Construct a new pages per minute attribute with the given integer
  52      * value.
  53      *
  54      * @param  value  Integer value.
  55      *
  56      * @exception  IllegalArgumentException
  57      *   (Unchecked exception) Thrown if {@code value} is less than 0.
  58      */
  59     public PagesPerMinute(int value) {
  60         super(value, 0, Integer.MAX_VALUE);
  61     }
  62 
  63     /**
  64      * Returns whether this pages per minute attribute is equivalent to the
  65      * passed in object. To be equivalent, all of the following conditions
  66      * must be true:
  67      * <OL TYPE=1>
  68      * <LI>
  69      * {@code object} is not null.
  70      * <LI>
  71      * {@code object} is an instance of class PagesPerMinute.
  72      * <LI>
  73      * This pages per minute attribute's value and {@code object}'s
  74      * value are equal.
  75      * </OL>
  76      *
  77      * @param  object  Object to compare to.
  78      *
  79      * @return  True if {@code object} is equivalent to this pages per
  80      *          minute attribute, false otherwise.
  81      */
  82     public boolean equals(Object object) {
  83         return (super.equals (object) &&
  84                 object instanceof PagesPerMinute);
  85     }
  86 
  87     /**
  88      * Get the printing attribute class which is to be used as the "category"
  89      * for this printing attribute value.
  90      * <P>
  91      * For class PagesPerMinute, the category is class PagesPerMinute itself.
  92      *
  93      * @return  Printing attribute class (category), an instance of class
  94      *          {@link java.lang.Class java.lang.Class}.
  95      */
  96     public final Class<? extends Attribute> getCategory() {
  97         return PagesPerMinute.class;
  98     }
  99 
 100     /**
 101      * Get the name of the category of which this attribute value is an
 102      * instance.
 103      * <P>
 104      * For class PagesPerMinute, the
 105      * category name is {@code "pages-per-minute"}.
 106      *
 107      * @return  Attribute category name.
 108      */
 109     public final String getName() {
 110         return "pages-per-minute";
 111     }
 112 
 113 }
< prev index next >