Path: blob/master/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfInterveningJobs.java
41161 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.PrintJobAttribute;3233/**34* Class {@code NumberOfInterveningJobs} is an integer valued printing attribute35* that indicates the number of jobs that are ahead of this job in the relative36* chronological order of expected time to complete (i.e., the current scheduled37* order).38* <p>39* <b>IPP Compatibility:</b> The integer value gives the IPP integer value. The40* category name returned by {@code getName()} gives the IPP attribute name.41*42* @author Alan Kaminsky43*/44public final class NumberOfInterveningJobs extends IntegerSyntax45implements PrintJobAttribute {4647/**48* Use serialVersionUID from JDK 1.4 for interoperability.49*/50@Serial51private static final long serialVersionUID = 2568141124844982746L;5253/**54* Construct a new number of intervening jobs attribute with the given55* integer value.56*57* @param value Integer value58* @throws IllegalArgumentException if {@code value} is negative59*/60public NumberOfInterveningJobs(int value) {61super(value, 0, Integer.MAX_VALUE);62}6364/**65* Returns whether this number of intervening jobs attribute is equivalent66* to the passed in object. To be equivalent, all of the following67* conditions must be true:68* <ol type=1>69* <li>{@code object} is not {@code null}.70* <li>{@code object} is an instance of class71* {@code NumberOfInterveningJobs}.72* <li>This number of intervening jobs attribute's value and73* {@code object}'s value are equal.74* </ol>75*76* @param object {@code Object} to compare to77* @return {@code true} if {@code object} is equivalent to this number of78* intervening jobs attribute, {@code false} otherwise79*/80public boolean equals(Object object) {81return (super.equals (object) &&82object instanceof NumberOfInterveningJobs);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 NumberOfInterveningJobs}, the category is class90* {@code NumberOfInterveningJobs} 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 NumberOfInterveningJobs.class;97}9899/**100* Get the name of the category of which this attribute value is an101* instance.102* <p>103* For class {@code NumberOfInterveningJobs}, the category name is104* {@code "number-of-intervening-jobs"}.105*106* @return attribute category name107*/108public final String getName() {109return "number-of-intervening-jobs";110}111}112113114