1. /*
  2. * @(#)JobImpressionsCompleted.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 JobImpressionsCompleted is an integer valued printing attribute class
  12. * that specifies the number of impressions completed for the job so far. For
  13. * printing devices, the impressions completed includes interpreting, marking,
  14. * and stacking the output.
  15. * <P>
  16. * The JobImpressionsCompleted attribute describes the progress of the job. This
  17. * attribute is intended to be a counter. That is, the JobImpressionsCompleted
  18. * value for a job that has not started processing must be 0. When the job's
  19. * {@link JobState JobState} is PROCESSING or PROCESSING_STOPPED, the
  20. * JobImpressionsCompleted value is intended to increase as the job is
  21. * processed; it indicates the amount of the job that has been processed at the
  22. * time the Print Job's attribute set is queried or at the time a print job
  23. * event is reported. When the job enters the COMPLETED, CANCELED, or ABORTED
  24. * states, the JobImpressionsCompleted value is the final value for the job.
  25. * <P>
  26. * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
  27. * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  28. * name.
  29. * <P>
  30. *
  31. * @see JobImpressions
  32. * @see JobImpressionsSupported
  33. * @see JobKOctetsProcessed
  34. * @see JobMediaSheetsCompleted
  35. *
  36. * @author Alan Kaminsky
  37. */
  38. public final class JobImpressionsCompleted extends IntegerSyntax
  39. implements PrintJobAttribute {
  40. /**
  41. * Construct a new job impressions completed attribute with the given
  42. * integer value.
  43. *
  44. * @param value Integer value.
  45. *
  46. * @exception IllegalArgumentException
  47. * (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
  48. */
  49. public JobImpressionsCompleted(int value) {
  50. super (value, 0, Integer.MAX_VALUE);
  51. }
  52. /**
  53. * Returns whether this job impressions completed attribute is equivalent
  54. * tp the passed in object. To be equivalent, all of the following
  55. * conditions must be true:
  56. * <OL TYPE=1>
  57. * <LI>
  58. * <CODE>object</CODE> is not null.
  59. * <LI>
  60. * <CODE>object</CODE> is an instance of class JobImpressionsCompleted.
  61. * <LI>
  62. * This job impressions completed attribute's value and
  63. * <CODE>object</CODE>'s value are equal.
  64. * </OL>
  65. *
  66. * @param object Object to compare to.
  67. *
  68. * @return True if <CODE>object</CODE> is equivalent to this job
  69. * impressions completed attribute, false otherwise.
  70. */
  71. public boolean equals(Object object) {
  72. return(super.equals (object) &&
  73. object instanceof JobImpressionsCompleted);
  74. }
  75. /**
  76. * Get the printing attribute class which is to be used as the "category"
  77. * for this printing attribute value.
  78. * <P>
  79. * For class JobImpressionsCompleted, the category is class
  80. * JobImpressionsCompleted itself.
  81. *
  82. * @return Printing attribute class (category), an instance of class
  83. * {@link java.lang.Class java.lang.Class}.
  84. */
  85. public final Class getCategory() {
  86. return JobImpressionsCompleted.class;
  87. }
  88. /**
  89. * Get the name of the category of which this attribute value is an
  90. * instance.
  91. * <P>
  92. * For class JobImpressionsCompleted, the category name is
  93. * <CODE>"job-impressions-completed"</CODE>.
  94. *
  95. * @return Attribute category name.
  96. */
  97. public final String getName() {
  98. return "job-impressions-completed";
  99. }
  100. }