KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > print > attribute > standard > PagesPerMinuteColor


1 /*
2  * @(#)PagesPerMinuteColor.java 1.7 04/05/05
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package javax.print.attribute.standard;
8
9 import javax.print.attribute.Attribute JavaDoc;
10 import javax.print.attribute.IntegerSyntax JavaDoc;
11 import javax.print.attribute.PrintServiceAttribute JavaDoc;
12
13 /**
14  * Class PagesPerMinuteColor is an integer valued printing attribute that
15  * indicates the nominal number of pages per minute to the nearest whole number
16  * which may be generated by this printer when printing color (e.g., simplex,
17  * color). For purposes of this attribute, "color" means the same as for the
18  * {@link ColorSupported ColorSupported} attribute, namely, the device is
19  * capable of any type of color printing at all, including highlight color as
20  * well as full process color. This attribute is informative, not a service
21  * guarantee. Generally, it is the value used in the marketing literature to
22  * describe the color capabilities of this device. A value of 0 indicates a
23  * device that takes more than two minutes to process a page. If a color device
24  * has several color modes, it may use the pages-per- minute value for this
25  * attribute that corresponds to the mode that produces the highest number.
26  * <P>
27  * A black and white only printer must not include the PagesPerMinuteColor
28  * attribute in its attribute set or service registration. If this attribute is
29  * present, then the {@link ColorSupported ColorSupported} printer description
30  * attribute must also be present and have a value of SUPPORTED.
31  * <P>
32  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
33  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
34  * name.
35  * <P>
36  *
37  * @author Alan Kaminsky
38  */

39 public final class PagesPerMinuteColor extends IntegerSyntax JavaDoc
40     implements PrintServiceAttribute JavaDoc {
41
42     static final long serialVersionUID = 1684993151687470944L;
43
44     /**
45      * Construct a new pages per minute color attribute with the given integer
46      * value.
47      *
48      * @param value Integer value.
49      *
50      * @exception IllegalArgumentException
51      * (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
52      */

53     public PagesPerMinuteColor(int value) {
54     super(value, 0, Integer.MAX_VALUE);
55     }
56
57     /**
58      * Returns whether this pages per minute color attribute is equivalent to
59      * the passed in object. To be equivalent, all of the following conditions
60      * must be true:
61      * <OL TYPE=1>
62      * <LI>
63      * <CODE>object</CODE> is not null.
64      * <LI>
65      * <CODE>object</CODE> is an instance of class PagesPerMinuteColor.
66      * <LI>
67      * This pages per minute attribute's value and <CODE>object</CODE>'s
68      * value are equal.
69      * </OL>
70      *
71      * @param object Object to compare to.
72      *
73      * @return True if <CODE>object</CODE> is equivalent to this pages per
74      * minute color attribute, false otherwise.
75      */

76     public boolean equals(Object JavaDoc object) {
77     return (super.equals(object) &&
78         object instanceof PagesPerMinuteColor JavaDoc);
79     }
80
81     /**
82      * Get the printing attribute class which is to be used as the "category"
83      * for this printing attribute value.
84      * <P>
85      * For class PagesPerMinuteColor, the
86      * category is class PagesPerMinuteColor itself.
87      *
88      * @return Printing attribute class (category), an instance of class
89      * {@link java.lang.Class java.lang.Class}.
90      */

91     public final Class JavaDoc<? extends Attribute JavaDoc> getCategory() {
92     return PagesPerMinuteColor JavaDoc.class;
93     }
94
95     /**
96      * Get the name of the category of which this attribute value is an
97      * instance.
98      * <P>
99      * For class PagesPerMinuteColor, the
100      * category name is <CODE>"pages-per-minute-color"</CODE>.
101      *
102      * @return Attribute category name.
103      */

104     public final String JavaDoc getName() {
105     return "pages-per-minute-color";
106     }
107
108 }
109
Popular Tags