KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)PagesPerMinute.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 PagesPerMinute is an integer valued printing attribute that indicates
15  * the nominal number of pages per minute to the nearest whole number which may
16  * be generated by this printer (e.g., simplex, black-and-white). This attribute
17  * is informative, not a service guarantee. Generally, it is the value used in
18  * the marketing literature to describe the device. A value of 0 indicates a
19  * device that takes more than two minutes to process a page.
20  * <P>
21  * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
22  * category name returned by <CODE>getName()</CODE> gives the IPP attribute
23  * name.
24  * <P>
25  *
26  * @author Alan Kaminsky
27  */

28 public final class PagesPerMinute extends IntegerSyntax JavaDoc
29     implements PrintServiceAttribute JavaDoc {
30
31     private static final long serialVersionUID = -6366403993072862015L;
32
33     /**
34      * Construct a new pages per minute attribute with the given integer
35      * value.
36      *
37      * @param value Integer value.
38      *
39      * @exception IllegalArgumentException
40      * (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
41      */

42     public PagesPerMinute(int value) {
43     super(value, 0, Integer.MAX_VALUE);
44     }
45
46     /**
47      * Returns whether this pages per minute attribute is equivalent to the
48      * passed in object. To be equivalent, all of the following conditions
49      * must be true:
50      * <OL TYPE=1>
51      * <LI>
52      * <CODE>object</CODE> is not null.
53      * <LI>
54      * <CODE>object</CODE> is an instance of class PagesPerMinute.
55      * <LI>
56      * This pages per minute attribute's value and <CODE>object</CODE>'s
57      * value are equal.
58      * </OL>
59      *
60      * @param object Object to compare to.
61      *
62      * @return True if <CODE>object</CODE> is equivalent to this pages per
63      * minute attribute, false otherwise.
64      */

65     public boolean equals(Object JavaDoc object) {
66     return (super.equals (object) &&
67         object instanceof PagesPerMinute JavaDoc);
68     }
69
70     /**
71      * Get the printing attribute class which is to be used as the "category"
72      * for this printing attribute value.
73      * <P>
74      * For class PagesPerMinute, the category is class PagesPerMinute itself.
75      *
76      * @return Printing attribute class (category), an instance of class
77      * {@link java.lang.Class java.lang.Class}.
78      */

79     public final Class JavaDoc<? extends Attribute JavaDoc> getCategory() {
80     return PagesPerMinute JavaDoc.class;
81     }
82
83     /**
84      * Get the name of the category of which this attribute value is an
85      * instance.
86      * <P>
87      * For class PagesPerMinute, the
88      * category name is <CODE>"pages-per-minute"</CODE>.
89      *
90      * @return Attribute category name.
91      */

92     public final String JavaDoc getName() {
93     return "pages-per-minute";
94     }
95
96 }
97
Popular Tags