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