1. /*
  2. * @(#)Fidelity.java 1.5 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.print.attribute.standard;
  8. import javax.print.attribute.EnumSyntax;
  9. import javax.print.attribute.PrintJobAttribute;
  10. import javax.print.attribute.PrintRequestAttribute;
  11. /**
  12. * Class Fidelity is a printing attribute class, an enumeration,
  13. * that indicates whether total fidelity to client supplied print request
  14. * attributes is required.
  15. * If FIDELITY_TRUE is specified and a service cannot print the job exactly
  16. * as specified it must reject the job.
  17. * If FIDELITY_FALSE is specified a reasonable attempt to print the job is
  18. * acceptable. If not supplied the default is FIDELITY_FALSE.
  19. *
  20. * <P>
  21. * <B>IPP Compatibility:</B> The IPP boolean value is "true" for FIDELITY_TRUE
  22. * and "false" for FIDELITY_FALSE. The category name returned by
  23. * <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
  24. * integer value is the IPP enum value. The <code>toString()</code> method
  25. * returns the IPP string representation of the attribute value.
  26. * See <a href="www.ietf.org/rfc/rfc2911.txt">RFC 2911</a> Section 15.1 for
  27. * a fuller description of the IPP fidelity attribute.
  28. * <P>
  29. *
  30. */
  31. public final class Fidelity extends EnumSyntax
  32. implements PrintJobAttribute, PrintRequestAttribute {
  33. /**
  34. * The job must be printed exactly as specified. or else rejected.
  35. */
  36. public static final Fidelity
  37. FIDELITY_TRUE = new Fidelity(0);
  38. /**
  39. * The printer should make reasonable attempts to print the job,
  40. * even if it cannot print it exactly as specified.
  41. */
  42. public static final Fidelity
  43. FIDELITY_FALSE = new Fidelity(1);
  44. /**
  45. * Construct a new fidelity enumeration value with the
  46. * given integer value.
  47. *
  48. * @param value Integer value.
  49. */
  50. protected Fidelity(int value) {
  51. super (value);
  52. }
  53. private static final String[] myStringTable = {
  54. "true",
  55. "false"
  56. };
  57. private static final Fidelity[] myEnumValueTable = {
  58. FIDELITY_TRUE,
  59. FIDELITY_FALSE
  60. };
  61. /**
  62. * Returns the string table for class Fidelity.
  63. */
  64. protected String[] getStringTable() {
  65. return myStringTable;
  66. }
  67. /**
  68. * Returns the enumeration value table for class Fidelity.
  69. */
  70. protected EnumSyntax[] getEnumValueTable() {
  71. return myEnumValueTable;
  72. } /**
  73. * Get the printing attribute class which is to be used as the "category"
  74. * for this printing attribute value.
  75. * <P>
  76. * For class Fidelity the category is class Fidelity itself.
  77. *
  78. * @return Printing attribute class (category), an instance of class
  79. * {@link java.lang.Class java.lang.Class}.
  80. */
  81. public final Class getCategory() {
  82. return Fidelity.class;
  83. }
  84. /**
  85. * Get the name of the category of which this attribute value is an
  86. * instance.
  87. * <P>
  88. * For class Fidelity the category name is
  89. * <CODE>"ipp-attribute-fidelity"</CODE>.
  90. *
  91. * @return Attribute category name.
  92. */
  93. public final String getName() {
  94. return "ipp-attribute-fidelity";
  95. }
  96. }