1. /*
  2. * @(#)NumberOfInterveningJobs.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.PrintJobAttribute;
  10. /**
  11. * Class NumberOfInterveningJobs is an integer valued printing attribute that
  12. * indicates the number of jobs that are ahead of this job in the relative
  13. * chronological order of expected time to complete (i.e., the current
  14. * scheduled order).
  15. * <P>
  16. * <B>IPP Compatibility:</B> The integer value gives the IPP integer value.
  17. * The category name returned by <CODE>getName()</CODE> gives the IPP
  18. * attribute name.
  19. * <P>
  20. *
  21. * @author Alan Kaminsky
  22. */
  23. public final class NumberOfInterveningJobs extends IntegerSyntax
  24. implements PrintJobAttribute {
  25. /**
  26. * Construct a new number of intervening jobs attribute with the given
  27. * integer value.
  28. *
  29. * @param value Integer value.
  30. *
  31. * @exception IllegalArgumentException
  32. * (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
  33. */
  34. public NumberOfInterveningJobs(int value) {
  35. super(value, 0, Integer.MAX_VALUE);
  36. }
  37. /**
  38. * Returns whether this number of intervening jobs attribute is equivalent
  39. * to the passed in object. To be equivalent, all of the following
  40. * conditions must be true:
  41. * <OL TYPE=1>
  42. * <LI>
  43. * <CODE>object</CODE> is not null.
  44. * <LI>
  45. * <CODE>object</CODE> is an instance of class NumberOfInterveningJobs.
  46. * <LI>
  47. * This number of intervening jobs attribute's value and
  48. * <CODE>object</CODE>'s value are equal.
  49. * </OL>
  50. *
  51. * @param object Object to compare to.
  52. *
  53. * @return True if <CODE>object</CODE> is equivalent to this number of
  54. * intervening jobs attribute, false otherwise.
  55. */
  56. public boolean equals(Object object) {
  57. return (super.equals (object) &&
  58. object instanceof NumberOfInterveningJobs);
  59. }
  60. /**
  61. * Get the printing attribute class which is to be used as the "category"
  62. * for this printing attribute value.
  63. * <P>
  64. * For class NumberOfInterveningJobs, the
  65. * category is class NumberOfInterveningJobs itself.
  66. *
  67. * @return Printing attribute class (category), an instance of class
  68. * {@link java.lang.Class java.lang.Class}.
  69. */
  70. public final Class getCategory() {
  71. return NumberOfInterveningJobs.class;
  72. }
  73. /**
  74. * Get the name of the category of which this attribute value is an
  75. * instance.
  76. * <P>
  77. * For class NumberOfInterveningJobs, the
  78. * category name is <CODE>"number-of-intervening-jobs"</CODE>.
  79. *
  80. * @return Attribute category name.
  81. */
  82. public final String getName() {
  83. return "number-of-intervening-jobs";
  84. }
  85. }