Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/print/attribute/standard/Fidelity.java
38918 views
/*1* Copyright (c) 2000, 2006, 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 javax.print.attribute.Attribute;27import javax.print.attribute.EnumSyntax;28import javax.print.attribute.PrintJobAttribute;29import javax.print.attribute.PrintRequestAttribute;3031/**32* Class Fidelity is a printing attribute class, an enumeration,33* that indicates whether total fidelity to client supplied print request34* attributes is required.35* If FIDELITY_TRUE is specified and a service cannot print the job exactly36* as specified it must reject the job.37* If FIDELITY_FALSE is specified a reasonable attempt to print the job is38* acceptable. If not supplied the default is FIDELITY_FALSE.39*40* <P>41* <B>IPP Compatibility:</B> The IPP boolean value is "true" for FIDELITY_TRUE42* and "false" for FIDELITY_FALSE. The category name returned by43* <CODE>getName()</CODE> is the IPP attribute name. The enumeration's44* integer value is the IPP enum value. The <code>toString()</code> method45* returns the IPP string representation of the attribute value.46* See <a href="http://www.ietf.org/rfc/rfc2911.txt">RFC 2911</a> Section 15.1 for47* a fuller description of the IPP fidelity attribute.48* <P>49*50*/51public final class Fidelity extends EnumSyntax52implements PrintJobAttribute, PrintRequestAttribute {5354private static final long serialVersionUID = 6320827847329172308L;5556/**57* The job must be printed exactly as specified. or else rejected.58*/59public static final Fidelity60FIDELITY_TRUE = new Fidelity(0);6162/**63* The printer should make reasonable attempts to print the job,64* even if it cannot print it exactly as specified.65*/66public static final Fidelity67FIDELITY_FALSE = new Fidelity(1);6869/**70* Construct a new fidelity enumeration value with the71* given integer value.72*73* @param value Integer value.74*/75protected Fidelity(int value) {76super (value);77}7879private static final String[] myStringTable = {80"true",81"false"82};838485private static final Fidelity[] myEnumValueTable = {86FIDELITY_TRUE,87FIDELITY_FALSE88};8990/**91* Returns the string table for class Fidelity.92*/93protected String[] getStringTable() {94return myStringTable;95}9697/**98* Returns the enumeration value table for class Fidelity.99*/100protected EnumSyntax[] getEnumValueTable() {101return myEnumValueTable;102} /**103* Get the printing attribute class which is to be used as the "category"104* for this printing attribute value.105* <P>106* For class Fidelity the category is class Fidelity itself.107*108* @return Printing attribute class (category), an instance of class109* {@link java.lang.Class java.lang.Class}.110*/111public final Class<? extends Attribute> getCategory() {112return Fidelity.class;113}114115/**116* Get the name of the category of which this attribute value is an117* instance.118* <P>119* For class Fidelity the category name is120* <CODE>"ipp-attribute-fidelity"</CODE>.121*122* @return Attribute category name.123*/124public final String getName() {125return "ipp-attribute-fidelity";126}127128}129130131