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