Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/print/attribute/standard/OutputDeviceAssigned.java
38918 views
/*1* Copyright (c) 2000, 2004, 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*/24package javax.print.attribute.standard;2526import java.util.Locale;2728import javax.print.attribute.Attribute;29import javax.print.attribute.TextSyntax;30import javax.print.attribute.PrintJobAttribute;3132/**33* Class OutputDeviceAssigned is a printing attribute class, a text attribute,34* that identifies the output device to which the service has assigned this35* job. If an output device implements an embedded Print Service instance, the36* printer need not set this attribute. If a print server implements a37* Print Service instance, the value may be empty (zero- length string) or not38* returned until the service assigns an output device to the job. This39* attribute is particularly useful when a single service supports multiple40* devices (so called "fan-out").41* <P>42* <B>IPP Compatibility:</B> The string value gives the IPP name value. The43* locale gives the IPP natural language. The category name returned by44* <CODE>getName()</CODE> gives the IPP attribute name.45* <P>46*47* @author Alan Kaminsky48*/49public final class OutputDeviceAssigned extends TextSyntax50implements PrintJobAttribute {5152private static final long serialVersionUID = 5486733778854271081L;5354/**55* Constructs a new output device assigned attribute with the given device56* name and locale.57*58* @param deviceName Device name.59* @param locale Natural language of the text string. null60* is interpreted to mean the default locale as returned61* by <code>Locale.getDefault()</code>62*63* @exception NullPointerException64* (unchecked exception) Thrown if <CODE>deviceName</CODE> is null.65*/66public OutputDeviceAssigned(String deviceName, Locale locale) {6768super (deviceName, locale);69}7071// Exported operations inherited and overridden from class Object.7273/**74* Returns whether this output device assigned attribute is equivalent to75* the passed in object. To be equivalent, all of the following conditions76* must be true:77* <OL TYPE=1>78* <LI>79* <CODE>object</CODE> is not null.80* <LI>81* <CODE>object</CODE> is an instance of class OutputDeviceAssigned.82* <LI>83* This output device assigned attribute's underlying string and84* <CODE>object</CODE>'s underlying string are equal.85* <LI>86* This output device assigned attribute's locale and87* <CODE>object</CODE>'s locale are equal.88* </OL>89*90* @param object Object to compare to.91*92* @return True if <CODE>object</CODE> is equivalent to this output93* device assigned attribute, false otherwise.94*/95public boolean equals(Object object) {96return (super.equals (object) &&97object instanceof OutputDeviceAssigned);98}99100/**101* Get the printing attribute class which is to be used as the "category"102* for this printing attribute value.103* <P>104* For class OutputDeviceAssigned, the105* category is class OutputDeviceAssigned itself.106*107* @return Printing attribute class (category), an instance of class108* {@link java.lang.Class java.lang.Class}.109*/110public final Class<? extends Attribute> getCategory() {111return OutputDeviceAssigned.class;112}113114/**115* Get the name of the category of which this attribute value is an116* instance.117* <P>118* For class OutputDeviceAssigned, the119* category name is <CODE>"output-device-assigned"</CODE>.120*121* @return Attribute category name.122*/123public final String getName() {124return "output-device-assigned";125}126127}128129130