< prev index next >

src/java.desktop/share/classes/javax/print/attribute/standard/Fidelity.java

Print this page


   1 /*
   2  * Copyright (c) 2000, 2013, 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.EnumSyntax;
  29 import javax.print.attribute.PrintJobAttribute;
  30 import javax.print.attribute.PrintRequestAttribute;
  31 
  32 /**
  33  * Class Fidelity is a printing attribute class, an enumeration,
  34  * that indicates whether total fidelity to client supplied print request
  35  * attributes is required.
  36  * If FIDELITY_TRUE is specified and a service cannot print the job exactly
  37  * as specified it must reject the job.
  38  * If FIDELITY_FALSE is specified a reasonable attempt to print the job is
  39  * acceptable. If not supplied the default is FIDELITY_FALSE.
  40  *
  41  * <P>
  42  * <B>IPP Compatibility:</B> The IPP boolean value is "true" for FIDELITY_TRUE
  43  * and "false" for FIDELITY_FALSE. The category name returned by
  44  * {@code getName()} is the IPP attribute name.  The enumeration's
  45  * integer value is the IPP enum value.  The {@code toString()} method
  46  * returns the IPP string representation of the attribute value.
  47  * See <a href="http://www.ietf.org/rfc/rfc2911.txt">RFC 2911</a> Section 15.1 for
  48  * a fuller description of the IPP fidelity attribute.
  49  *
  50  */
  51 public final class Fidelity extends EnumSyntax
  52         implements PrintJobAttribute, PrintRequestAttribute {
  53 



  54     private static final long serialVersionUID = 6320827847329172308L;
  55 
  56     /**
  57      * The job must be printed exactly as specified. or else rejected.
  58      */
  59     public static final Fidelity
  60         FIDELITY_TRUE = new Fidelity(0);
  61 
  62     /**
  63      * The printer should make reasonable attempts to print the job,
  64      * even if it cannot print it exactly as specified.
  65      */
  66     public static final Fidelity
  67         FIDELITY_FALSE = new Fidelity(1);
  68 
  69     /**
  70      * Construct a new fidelity enumeration value with the
  71      * given integer value.
  72      *
  73      * @param  value  Integer value.
  74      */
  75     protected Fidelity(int value) {
  76         super (value);
  77     }
  78 



  79     private static final String[] myStringTable = {
  80         "true",
  81         "false"
  82     };
  83 
  84 


  85     private static final Fidelity[] myEnumValueTable = {
  86         FIDELITY_TRUE,
  87         FIDELITY_FALSE
  88     };
  89 
  90     /**
  91      * Returns the string table for class Fidelity.
  92      */
  93     protected String[] getStringTable() {
  94         return myStringTable;
  95     }
  96 
  97     /**
  98      * Returns the enumeration value table for class Fidelity.
  99      */
 100     protected EnumSyntax[] getEnumValueTable() {
 101         return 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 class
 109      *          {@link java.lang.Class java.lang.Class}.
 110      */
 111     public final Class<? extends Attribute> getCategory() {
 112         return Fidelity.class;
 113     }
 114 
 115     /**
 116      * Get the name of the category of which this attribute value is an
 117      * instance.
 118      * <P>
 119      * For class Fidelity the category name is
 120      * {@code "ipp-attribute-fidelity"}.
 121      *
 122      * @return  Attribute category name.
 123      */
 124     public final String getName() {
 125         return "ipp-attribute-fidelity";
 126     }
 127 
 128 }
   1 /*
   2  * Copyright (c) 2000, 2017, 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 
  26 package javax.print.attribute.standard;
  27 
  28 import javax.print.attribute.Attribute;
  29 import javax.print.attribute.EnumSyntax;
  30 import javax.print.attribute.PrintJobAttribute;
  31 import javax.print.attribute.PrintRequestAttribute;
  32 
  33 /**
  34  * Class {@code Fidelity} is a printing attribute class, an enumeration, that
  35  * indicates whether total fidelity to client supplied print request attributes
  36  * is required. If {@code FIDELITY_TRUE} is specified and a service cannot print
  37  * the job exactly as specified it must reject the job. If
  38  * {@code FIDELITY_FALSE} is specified a reasonable attempt to print the job is
  39  * acceptable. If not supplied the default is {@code FIDELITY_FALSE}.
  40  * <p>
  41  * <b>IPP Compatibility:</b> The IPP boolean value is "true" for
  42  * {@code FIDELITY_TRUE} and "false" for {@code FIDELITY_FALSE}. The category
  43  * name returned by {@code getName()} is the IPP attribute name. The
  44  * enumeration's integer value is the IPP enum value. The {@code toString()}
  45  * method returns the IPP string representation of the attribute value. See
  46  * <a href="http://www.ietf.org/rfc/rfc2911.txt">RFC 2911</a> Section 15.1 for a
  47  * fuller description of the IPP fidelity attribute.



  48  */
  49 public final class Fidelity extends EnumSyntax
  50         implements PrintJobAttribute, PrintRequestAttribute {
  51 
  52     /**
  53      * Use serialVersionUID from JDK 1.4 for interoperability.
  54      */
  55     private static final long serialVersionUID = 6320827847329172308L;
  56 
  57     /**
  58      * The job must be printed exactly as specified. or else rejected.
  59      */
  60     public static final Fidelity
  61         FIDELITY_TRUE = new Fidelity(0);
  62 
  63     /**
  64      * The printer should make reasonable attempts to print the job, even if it
  65      * cannot print it exactly as specified.
  66      */
  67     public static final Fidelity
  68         FIDELITY_FALSE = new Fidelity(1);
  69 
  70     /**
  71      * Construct a new fidelity enumeration value with the given integer value.

  72      *
  73      * @param  value Integer value
  74      */
  75     protected Fidelity(int value) {
  76         super (value);
  77     }
  78 
  79     /**
  80      * The string table for class {@code Fidelity}.
  81      */
  82     private static final String[] myStringTable = {
  83         "true",
  84         "false"
  85     };
  86 
  87     /**
  88      * The enumeration value table for class {@code Fidelity}.
  89      */
  90     private static final Fidelity[] myEnumValueTable = {
  91         FIDELITY_TRUE,
  92         FIDELITY_FALSE
  93     };
  94 
  95     /**
  96      * Returns the string table for class {@code Fidelity}.
  97      */
  98     protected String[] getStringTable() {
  99         return myStringTable;
 100     }
 101 
 102     /**
 103      * Returns the enumeration value table for class {@code Fidelity}.
 104      */
 105     protected EnumSyntax[] getEnumValueTable() {
 106         return myEnumValueTable;
 107     }
 108 
 109     /**
 110      * Get the printing attribute class which is to be used as the "category"
 111      * for this printing attribute value.
 112      * <p>
 113      * For class {@code Fidelity} the category is class
 114      * {@code Fidelity} itself.
 115      *
 116      * @return printing attribute class (category), an instance of class
 117      *         {@link Class java.lang.Class}
 118      */
 119     public final Class<? extends Attribute> getCategory() {
 120         return Fidelity.class;
 121     }
 122 
 123     /**
 124      * Get the name of the category of which this attribute value is an
 125      * instance.
 126      * <p>
 127      * For class {@code Fidelity} the category name is
 128      * {@code "ipp-attribute-fidelity"}.
 129      *
 130      * @return attribute category name
 131      */
 132     public final String getName() {
 133         return "ipp-attribute-fidelity";
 134     }

 135 }
< prev index next >