001 /*
002 * Copyright 2000-2004 Sun Microsystems, Inc. All Rights Reserved.
003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004 *
005 * This code is free software; you can redistribute it and/or modify it
006 * under the terms of the GNU General Public License version 2 only, as
007 * published by the Free Software Foundation. Sun designates this
008 * particular file as subject to the "Classpath" exception as provided
009 * by Sun in the LICENSE file that accompanied this code.
010 *
011 * This code is distributed in the hope that it will be useful, but WITHOUT
012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014 * version 2 for more details (a copy is included in the LICENSE file that
015 * accompanied this code).
016 *
017 * You should have received a copy of the GNU General Public License version
018 * 2 along with this work; if not, write to the Free Software Foundation,
019 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020 *
021 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022 * CA 95054 USA or visit www.sun.com if you need additional information or
023 * have any questions.
024 */
025 package javax.print.attribute.standard;
026
027 import javax.print.attribute.Attribute;
028 import javax.print.attribute.IntegerSyntax;
029 import javax.print.attribute.PrintServiceAttribute;
030
031 /**
032 * Class PagesPerMinuteColor is an integer valued printing attribute that
033 * indicates the nominal number of pages per minute to the nearest whole number
034 * which may be generated by this printer when printing color (e.g., simplex,
035 * color). For purposes of this attribute, "color" means the same as for the
036 * {@link ColorSupported ColorSupported} attribute, namely, the device is
037 * capable of any type of color printing at all, including highlight color as
038 * well as full process color. This attribute is informative, not a service
039 * guarantee. Generally, it is the value used in the marketing literature to
040 * describe the color capabilities of this device. A value of 0 indicates a
041 * device that takes more than two minutes to process a page. If a color device
042 * has several color modes, it may use the pages-per- minute value for this
043 * attribute that corresponds to the mode that produces the highest number.
044 * <P>
045 * A black and white only printer must not include the PagesPerMinuteColor
046 * attribute in its attribute set or service registration. If this attribute is
047 * present, then the {@link ColorSupported ColorSupported} printer description
048 * attribute must also be present and have a value of SUPPORTED.
049 * <P>
050 * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
051 * category name returned by <CODE>getName()</CODE> gives the IPP attribute
052 * name.
053 * <P>
054 *
055 * @author Alan Kaminsky
056 */
057 public final class PagesPerMinuteColor extends IntegerSyntax implements
058 PrintServiceAttribute {
059
060 static final long serialVersionUID = 1684993151687470944L;
061
062 /**
063 * Construct a new pages per minute color attribute with the given integer
064 * value.
065 *
066 * @param value Integer value.
067 *
068 * @exception IllegalArgumentException
069 * (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
070 */
071 public PagesPerMinuteColor(int value) {
072 super (value, 0, Integer.MAX_VALUE);
073 }
074
075 /**
076 * Returns whether this pages per minute color attribute is equivalent to
077 * the passed in object. To be equivalent, all of the following conditions
078 * must be true:
079 * <OL TYPE=1>
080 * <LI>
081 * <CODE>object</CODE> is not null.
082 * <LI>
083 * <CODE>object</CODE> is an instance of class PagesPerMinuteColor.
084 * <LI>
085 * This pages per minute attribute's value and <CODE>object</CODE>'s
086 * value are equal.
087 * </OL>
088 *
089 * @param object Object to compare to.
090 *
091 * @return True if <CODE>object</CODE> is equivalent to this pages per
092 * minute color attribute, false otherwise.
093 */
094 public boolean equals(Object object) {
095 return (super .equals(object) && object instanceof PagesPerMinuteColor);
096 }
097
098 /**
099 * 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 }
|