1. /*
  2. * @(#)JobPrioritySupported.java 1.4 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.IntegerSyntax;
  9. import javax.print.attribute.SupportedValuesAttribute;
  10. /**
  11. * Class JobPrioritySupported is an integer valued printing attribute class
  12. * that specifies whether a Print Service instance supports the {@link
  13. * JobPriority JobPriority} attribute and the number of different job priority
  14. * levels supported.
  15. * <P>
  16. * The client can always specify any {@link JobPriority JobPriority} value
  17. * from 1 to 100 for a job. However, the Print Service instance may support
  18. * fewer than 100 different job priority levels. If this is the case, the
  19. * Print Service instance automatically maps the client-specified job priority
  20. * value to one of the supported job priority levels, dividing the 100 job
  21. * priority values equally among the available job priority levels.
  22. * <P>
  23. * <B>IPP Compatibility:</B> The integer value gives the IPP integer value.
  24. * The category name returned by <CODE>getName()</CODE> gives the IPP
  25. * attribute name.
  26. * <P>
  27. *
  28. * @author Alan Kaminsky
  29. */
  30. public final class JobPrioritySupported extends IntegerSyntax
  31. implements SupportedValuesAttribute {
  32. /**
  33. * Construct a new job priority supported attribute with the given integer
  34. * value.
  35. *
  36. * @param value Number of different job priority levels supported.
  37. *
  38. * @exception IllegalArgumentException
  39. * (Unchecked exception) Thrown if <CODE>value</CODE> is less than 1
  40. * or greater than 100.
  41. */
  42. public JobPrioritySupported(int value) {
  43. super (value, 1, 100);
  44. }
  45. /**
  46. * Returns whether this job priority supported attribute is equivalent to
  47. * the passed in object. To be equivalent, all of the following conditions
  48. * must be true:
  49. * <OL TYPE=1>
  50. * <LI>
  51. * <CODE>object</CODE> is not null.
  52. * <LI>
  53. * <CODE>object</CODE> is an instance of class JobPrioritySupported.
  54. * <LI>
  55. * This job priority supported attribute's value and
  56. * <CODE>object</CODE>'s value are equal.
  57. * </OL>
  58. *
  59. * @param object Object to compare to.
  60. *
  61. * @return True if <CODE>object</CODE> is equivalent to this job
  62. * priority supported attribute, false otherwise.
  63. */
  64. public boolean equals (Object object) {
  65. return (super.equals(object) &&
  66. object instanceof JobPrioritySupported);
  67. }
  68. /**
  69. * Get the printing attribute class which is to be used as the "category"
  70. * for this printing attribute value.
  71. * <P>
  72. * For class JobPrioritySupported, the
  73. * category is class JobPrioritySupported itself.
  74. *
  75. * @return Printing attribute class (category), an instance of class
  76. * {@link java.lang.Class java.lang.Class}.
  77. */
  78. public final Class getCategory() {
  79. return JobPrioritySupported.class;
  80. }
  81. /**
  82. * Get the name of the category of which this attribute value is an
  83. * instance.
  84. * <P>
  85. * For class JobPrioritySupported, the
  86. * category name is <CODE>"job-priority-supported"</CODE>.
  87. *
  88. * @return Attribute category name.
  89. */
  90. public final String getName() {
  91. return "job-priority-supported";
  92. }
  93. }