1 /* 2 * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 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 * <P> 43 * 44 * @author Alan Kaminsky 45 */ 46 public final class PagesPerMinute extends IntegerSyntax 47 implements PrintServiceAttribute { 48 49 private static final long serialVersionUID = -6366403993072862015L; 50 51 /** 52 * Construct a new pages per minute attribute with the given integer 53 * value. 54 * 55 * @param value Integer value. 56 * 57 * @exception IllegalArgumentException 58 * (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0. 59 */ 60 public PagesPerMinute(int value) { 61 super(value, 0, Integer.MAX_VALUE); 62 } 63 64 /** 65 * Returns whether this pages per minute attribute is equivalent to the 66 * passed in object. To be equivalent, all of the following conditions 67 * must be true: 68 * <OL TYPE=1> 69 * <LI> 70 * <CODE>object</CODE> is not null. 71 * <LI> 72 * <CODE>object</CODE> is an instance of class PagesPerMinute. 73 * <LI> 74 * This pages per minute attribute's value and <CODE>object</CODE>'s 75 * value are equal. 76 * </OL> 77 * 78 * @param object Object to compare to. 79 * 80 * @return True if <CODE>object</CODE> is equivalent to this pages per 81 * minute attribute, false otherwise. 82 */ 83 public boolean equals(Object object) { 84 return (super.equals (object) && 85 object instanceof PagesPerMinute); 86 } 87 88 /** 89 * Get the printing attribute class which is to be used as the "category" 90 * for this printing attribute value. 91 * <P> 92 * For class PagesPerMinute, the category is class PagesPerMinute itself. 93 * 94 * @return Printing attribute class (category), an instance of class 95 * {@link java.lang.Class java.lang.Class}. 96 */ 97 public final Class<? extends Attribute> getCategory() { 98 return PagesPerMinute.class; 99 } 100 101 /** 102 * Get the name of the category of which this attribute value is an 103 * instance. 104 * <P> 105 * For class PagesPerMinute, the 106 * category name is <CODE>"pages-per-minute"</CODE>. 107 * 108 * @return Attribute category name. 109 */ 110 public final String getName() { 111 return "pages-per-minute"; 112 } 113 114 }