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