1. /*
  2. * @(#)PrinterIsAcceptingJobs.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.PrintServiceAttribute;
  10. /**
  11. * Class PrinterIsAcceptingJobs is a printing attribute class, an enumeration,
  12. * that indicates whether the printer is currently able to accept jobs. This
  13. * value is independent of the {@link PrinterState PrinterState} and {@link
  14. * PrinterStateReasons PrinterStateReasons} attributes because its value does
  15. * not affect the current job; rather it affects future jobs. If the value is
  16. * NOT_ACCEPTING_JOBS, the printer will reject jobs even when the {@link
  17. * PrinterState PrinterState} is IDLE. If value is ACCEPTING_JOBS, the Printer
  18. * will accept jobs even when the {@link PrinterState PrinterState} is STOPPED.
  19. * <P>
  20. * <B>IPP Compatibility:</B> The IPP boolean value is "true" for ACCEPTING_JOBS
  21. * and "false" for NOT_ACCEPTING_JOBS. TThe category name returned by
  22. * <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
  23. * integer value is the IPP enum value. The <code>toString()</code> method
  24. * returns the IPP string representation of the attribute value.
  25. * <P>
  26. *
  27. * @author Alan Kaminsky
  28. */
  29. public final class PrinterIsAcceptingJobs extends EnumSyntax
  30. implements PrintServiceAttribute {
  31. /**
  32. * The printer is currently rejecting any jobs sent to it.
  33. */
  34. public static final PrinterIsAcceptingJobs
  35. NOT_ACCEPTING_JOBS = new PrinterIsAcceptingJobs(0);
  36. /**
  37. * The printer is currently acccepting jobs.
  38. */
  39. public static final PrinterIsAcceptingJobs
  40. ACCEPTING_JOBS = new PrinterIsAcceptingJobs(1);
  41. /**
  42. * Construct a new printer is accepting jobs enumeration value with the
  43. * given integer value.
  44. *
  45. * @param value Integer value.
  46. */
  47. protected PrinterIsAcceptingJobs(int value) {
  48. super (value);
  49. }
  50. private static final String[] myStringTable = {
  51. "not-accepting-jobs",
  52. "accepting-jobs"
  53. };
  54. private static final PrinterIsAcceptingJobs[] myEnumValueTable = {
  55. NOT_ACCEPTING_JOBS,
  56. ACCEPTING_JOBS
  57. };
  58. /**
  59. * Returns the string table for class PrinterIsAcceptingJobs.
  60. */
  61. protected String[] getStringTable() {
  62. return myStringTable;
  63. }
  64. /**
  65. * Returns the enumeration value table for class PrinterIsAcceptingJobs.
  66. */
  67. protected EnumSyntax[] getEnumValueTable() {
  68. return myEnumValueTable;
  69. }
  70. /**
  71. * Get the printing attribute class which is to be used as the "category"
  72. * for this printing attribute value.
  73. * <P>
  74. * For class PrinterIsAcceptingJobs, the
  75. * category is class PrinterIsAcceptingJobs itself.
  76. *
  77. * @return Printing attribute class (category), an instance of class
  78. * {@link java.lang.Class java.lang.Class}.
  79. */
  80. public final Class getCategory() {
  81. return PrinterIsAcceptingJobs.class;
  82. }
  83. /**
  84. * Get the name of the category of which this attribute value is an
  85. * instance.
  86. * <P>
  87. * For class PrinterIsAcceptingJobs, the
  88. * category name is <CODE>"printer-is-accepting-jobs"</CODE>.
  89. *
  90. * @return Attribute category name.
  91. */
  92. public final String getName() {
  93. return "printer-is-accepting-jobs";
  94. }
  95. }