1. /*
  2. * @(#)JobMediaSheetsCompleted.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 JobMediaSheetsCompleted is an integer valued printing attribute class
  13. * that specifies the number of media sheets which have completed marking and
  14. * stacking for the entire job so far, whether those sheets have been processed
  15. * on one side or on both.
  16. * <P>
  17. * The JobMediaSheetsCompleted attribute describes the progress of the job. This
  18. * attribute is intended to be a counter. That is, the JobMediaSheetsCompleted
  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. * JobMediaSheetsCompleted 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 JobMediaSheetsCompleted 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 JobMediaSheets
  33. * @see JobMediaSheetsSupported
  34. * @see JobKOctetsProcessed
  35. * @see JobImpressionsCompleted
  36. *
  37. * @author Alan Kaminsky
  38. */
  39. public final class JobMediaSheetsCompleted extends IntegerSyntax
  40. implements PrintJobAttribute {
  41. private static final long serialVersionUID = 1739595973810840475L;
  42. /**
  43. * Construct a new job media sheets 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 JobMediaSheetsCompleted(int value) {
  52. super (value, 0, Integer.MAX_VALUE);
  53. }
  54. /**
  55. * Returns whether this job media sheets completed attribute is equivalent
  56. * to 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 JobMediaSheetsCompleted.
  63. * <LI>
  64. * This job media sheets 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 media
  71. * sheets completed attribute, false otherwise.
  72. */
  73. public boolean equals(Object object) {
  74. return (super.equals (object) &&
  75. object instanceof JobMediaSheetsCompleted);
  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 JobMediaSheetsCompleted, the category is class
  82. * JobMediaSheetsCompleted 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 JobMediaSheetsCompleted.class;
  89. }
  90. /**
  91. * Get the name of the category of which this attribute value is an
  92. * instance.
  93. * <P>
  94. * For class JobMediaSheetsCompleted, the category name is
  95. * <CODE>"job-media-sheets-completed"</CODE>.
  96. *
  97. * @return Attribute category name.
  98. */
  99. public final String getName() {
  100. return "job-media-sheets-completed";
  101. }
  102. }