Path: blob/master/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinute.java
41171 views
/*1* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.print.attribute.standard;2627import java.io.Serial;2829import javax.print.attribute.Attribute;30import javax.print.attribute.IntegerSyntax;31import javax.print.attribute.PrintServiceAttribute;3233/**34* Class {@code PagesPerMinute} is an integer valued printing attribute that35* indicates the nominal number of pages per minute to the nearest whole number36* which may be generated by this printer (e.g., simplex, black-and-white). This37* attribute is informative, not a service guarantee. Generally, it is the value38* used in the marketing literature to describe the device. A value of 039* indicates a device that takes more than two minutes to process a page.40* <p>41* <b>IPP Compatibility:</b> The integer value gives the IPP integer value. The42* category name returned by {@code getName()} gives the IPP attribute name.43*44* @author Alan Kaminsky45*/46public final class PagesPerMinute extends IntegerSyntax47implements PrintServiceAttribute {4849/**50* Use serialVersionUID from JDK 1.4 for interoperability.51*/52@Serial53private static final long serialVersionUID = -6366403993072862015L;5455/**56* Construct a new pages per minute attribute with the given integer value.57*58* @param value Integer value59* @throws IllegalArgumentException if {@code value} is negative60*/61public PagesPerMinute(int value) {62super(value, 0, Integer.MAX_VALUE);63}6465/**66* Returns whether this pages per minute attribute is equivalent to the67* passed in object. To be equivalent, all of the following conditions must68* be true:69* <ol type=1>70* <li>{@code object} is not {@code null}.71* <li>{@code object} is an instance of class {@code PagesPerMinute}.72* <li>This pages per minute attribute's value and {@code object}'s value73* are equal.74* </ol>75*76* @param object {@code Object} to compare to77* @return {@code true} if {@code object} is equivalent to this pages per78* minute attribute, {@code false} otherwise79*/80public boolean equals(Object object) {81return (super.equals (object) &&82object instanceof PagesPerMinute);83}8485/**86* Get the printing attribute class which is to be used as the "category"87* for this printing attribute value.88* <p>89* For class {@code PagesPerMinute}, the category is class90* {@code PagesPerMinute} itself.91*92* @return printing attribute class (category), an instance of class93* {@link Class java.lang.Class}94*/95public final Class<? extends Attribute> getCategory() {96return PagesPerMinute.class;97}9899/**100* Get the name of the category of which this attribute value is an101* instance.102* <p>103* For class {@code PagesPerMinute}, the category name is104* {@code "pages-per-minute"}.105*106* @return attribute category name107*/108public final String getName() {109return "pages-per-minute";110}111}112113114