31 /** 32 * Class PagesPerMinuteColor is an integer valued printing attribute that 33 * indicates the nominal number of pages per minute to the nearest whole number 34 * which may be generated by this printer when printing color (e.g., simplex, 35 * color). For purposes of this attribute, "color" means the same as for the 36 * {@link ColorSupported ColorSupported} attribute, namely, the device is 37 * capable of any type of color printing at all, including highlight color as 38 * well as full process color. This attribute is informative, not a service 39 * guarantee. Generally, it is the value used in the marketing literature to 40 * describe the color capabilities of this device. A value of 0 indicates a 41 * device that takes more than two minutes to process a page. If a color device 42 * has several color modes, it may use the pages-per- minute value for this 43 * attribute that corresponds to the mode that produces the highest number. 44 * <P> 45 * A black and white only printer must not include the PagesPerMinuteColor 46 * attribute in its attribute set or service registration. If this attribute is 47 * present, then the {@link ColorSupported ColorSupported} printer description 48 * attribute must also be present and have a value of SUPPORTED. 49 * <P> 50 * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The 51 * category name returned by <CODE>getName()</CODE> gives the IPP attribute 52 * name. 53 * 54 * @author Alan Kaminsky 55 */ 56 public final class PagesPerMinuteColor extends IntegerSyntax 57 implements PrintServiceAttribute { 58 59 static final long serialVersionUID = 1684993151687470944L; 60 61 /** 62 * Construct a new pages per minute color attribute with the given integer 63 * value. 64 * 65 * @param value Integer value. 66 * 67 * @exception IllegalArgumentException 68 * (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0. 69 */ 70 public PagesPerMinuteColor(int value) { 71 super(value, 0, Integer.MAX_VALUE); 72 } 73 74 /** 75 * Returns whether this pages per minute color attribute is equivalent to 76 * the passed in object. To be equivalent, all of the following conditions 77 * must be true: 78 * <OL TYPE=1> 79 * <LI> 80 * <CODE>object</CODE> is not null. 81 * <LI> 82 * <CODE>object</CODE> is an instance of class PagesPerMinuteColor. 83 * <LI> 84 * This pages per minute attribute's value and <CODE>object</CODE>'s 85 * value are equal. 86 * </OL> 87 * 88 * @param object Object to compare to. 89 * 90 * @return True if <CODE>object</CODE> is equivalent to this pages per 91 * minute color attribute, false otherwise. 92 */ 93 public boolean equals(Object object) { 94 return (super.equals(object) && 95 object instanceof PagesPerMinuteColor); 96 } 97 98 /** 99 * Get the printing attribute class which is to be used as the "category" 100 * for this printing attribute value. 101 * <P> 102 * For class PagesPerMinuteColor, the 103 * category is class PagesPerMinuteColor itself. 104 * 105 * @return Printing attribute class (category), an instance of class 106 * {@link java.lang.Class java.lang.Class}. 107 */ 108 public final Class<? extends Attribute> getCategory() { 109 return PagesPerMinuteColor.class; 110 } 111 112 /** 113 * Get the name of the category of which this attribute value is an 114 * instance. 115 * <P> 116 * For class PagesPerMinuteColor, the 117 * category name is <CODE>"pages-per-minute-color"</CODE>. 118 * 119 * @return Attribute category name. 120 */ 121 public final String getName() { 122 return "pages-per-minute-color"; 123 } 124 125 } | 31 /** 32 * Class PagesPerMinuteColor is an integer valued printing attribute that 33 * indicates the nominal number of pages per minute to the nearest whole number 34 * which may be generated by this printer when printing color (e.g., simplex, 35 * color). For purposes of this attribute, "color" means the same as for the 36 * {@link ColorSupported ColorSupported} attribute, namely, the device is 37 * capable of any type of color printing at all, including highlight color as 38 * well as full process color. This attribute is informative, not a service 39 * guarantee. Generally, it is the value used in the marketing literature to 40 * describe the color capabilities of this device. A value of 0 indicates a 41 * device that takes more than two minutes to process a page. If a color device 42 * has several color modes, it may use the pages-per- minute value for this 43 * attribute that corresponds to the mode that produces the highest number. 44 * <P> 45 * A black and white only printer must not include the PagesPerMinuteColor 46 * attribute in its attribute set or service registration. If this attribute is 47 * present, then the {@link ColorSupported ColorSupported} printer description 48 * attribute must also be present and have a value of SUPPORTED. 49 * <P> 50 * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The 51 * category name returned by {@code getName()} gives the IPP attribute 52 * name. 53 * 54 * @author Alan Kaminsky 55 */ 56 public final class PagesPerMinuteColor extends IntegerSyntax 57 implements PrintServiceAttribute { 58 59 static final long serialVersionUID = 1684993151687470944L; 60 61 /** 62 * Construct a new pages per minute color attribute with the given integer 63 * value. 64 * 65 * @param value Integer value. 66 * 67 * @exception IllegalArgumentException 68 * (Unchecked exception) Thrown if {@code value} is less than 0. 69 */ 70 public PagesPerMinuteColor(int value) { 71 super(value, 0, Integer.MAX_VALUE); 72 } 73 74 /** 75 * Returns whether this pages per minute color attribute is equivalent to 76 * the passed in object. To be equivalent, all of the following conditions 77 * must be true: 78 * <OL TYPE=1> 79 * <LI> 80 * {@code object} is not null. 81 * <LI> 82 * {@code object} is an instance of class PagesPerMinuteColor. 83 * <LI> 84 * This pages per minute attribute's value and {@code object}'s 85 * value are equal. 86 * </OL> 87 * 88 * @param object Object to compare to. 89 * 90 * @return True if {@code object} is equivalent to this pages per 91 * minute color attribute, false otherwise. 92 */ 93 public boolean equals(Object object) { 94 return (super.equals(object) && 95 object instanceof PagesPerMinuteColor); 96 } 97 98 /** 99 * Get the printing attribute class which is to be used as the "category" 100 * for this printing attribute value. 101 * <P> 102 * For class PagesPerMinuteColor, the 103 * category is class PagesPerMinuteColor itself. 104 * 105 * @return Printing attribute class (category), an instance of class 106 * {@link java.lang.Class java.lang.Class}. 107 */ 108 public final Class<? extends Attribute> getCategory() { 109 return PagesPerMinuteColor.class; 110 } 111 112 /** 113 * Get the name of the category of which this attribute value is an 114 * instance. 115 * <P> 116 * For class PagesPerMinuteColor, the 117 * category name is {@code "pages-per-minute-color"}. 118 * 119 * @return Attribute category name. 120 */ 121 public final String getName() { 122 return "pages-per-minute-color"; 123 } 124 125 } |