1. /*
  2. * @(#)JobImpressions.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.PrintRequestAttribute;
  10. import javax.print.attribute.PrintJobAttribute;
  11. /**
  12. * Class JobImpressions is an integer valued printing attribute class that
  13. * specifies the total size in number of impressions of the document(s) being
  14. * submitted. An "impression" is the image (possibly many print-stream pages in
  15. * different configurations) imposed onto a single media page.
  16. * <P>
  17. * The JobImpressions attribute describes the size of the job. This attribute is
  18. * not intended to be a counter; it is intended to be useful routing and
  19. * scheduling information if known. The printer may try to compute the
  20. * JobImpressions attribute's value if it is not supplied in the Print Request.
  21. * Even if the client does supply a value for the JobImpressions attribute in
  22. * the Print Request, the printer may choose to change the value if the printer
  23. * is able to compute a value which is more accurate than the client supplied
  24. * value. The printer may be able to determine the correct value for the
  25. * JobImpressions attribute either right at job submission time or at any later
  26. * point in time.
  27. * <P>
  28. * As with {@link JobKOctets JobKOctets}, the JobImpressions value must not
  29. * include the multiplicative factors contributed by the number of copies
  30. * specified by the {@link Copies Copies} attribute, independent of whether the
  31. * device can process multiple copies without making multiple passes over the
  32. * job or document data and independent of whether the output is collated or
  33. * not. Thus the value is independent of the implementation and reflects the
  34. * size of the document(s) measured in impressions independent of the number of
  35. * copies.
  36. * <P>
  37. * As with {@link JobKOctets JobKOctets}, the JobImpressions value must also not
  38. * include the multiplicative factor due to a copies instruction embedded in the
  39. * document data. If the document data actually includes replications of the
  40. * document data, this value will include such replication. In other words, this
  41. * value is always the number of impressions in the source document data, rather
  42. * than a measure of the number of impressions to be produced by the job.
  43. * <P>
  44. * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
  45. * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  46. * name.
  47. * <P>
  48. *
  49. * @see JobImpressionsSupported
  50. * @see JobImpressionsCompleted
  51. * @see JobKOctets
  52. * @see JobMediaSheets
  53. *
  54. * @author Alan Kaminsky
  55. */
  56. public final class JobImpressions extends IntegerSyntax
  57. implements PrintRequestAttribute, PrintJobAttribute {
  58. /**
  59. * Construct a new job impressions attribute with the given integer value.
  60. *
  61. * @param value Integer value.
  62. *
  63. * @exception IllegalArgumentException
  64. * (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
  65. */
  66. public JobImpressions(int value) {
  67. super(value, 0, Integer.MAX_VALUE);
  68. }
  69. /**
  70. * Returns whether this job impressions attribute is equivalent to the
  71. * passed in object. To be equivalent, all of the following conditions must
  72. * be true:
  73. * <OL TYPE=1>
  74. * <LI>
  75. * <CODE>object</CODE> is not null.
  76. * <LI>
  77. * <CODE>object</CODE> is an instance of class JobImpressions.
  78. * <LI>
  79. * This job impressions attribute's value and <CODE>object</CODE>'s value
  80. * are equal.
  81. * </OL>
  82. *
  83. * @param object Object to compare to.
  84. *
  85. * @return True if <CODE>object</CODE> is equivalent to this job
  86. * impressions attribute, false otherwise.
  87. */
  88. public boolean equals(Object object) {
  89. return super.equals (object) && object instanceof JobImpressions;
  90. }
  91. /**
  92. * Get the printing attribute class which is to be used as the "category"
  93. * for this printing attribute value.
  94. * <P>
  95. * For class JobImpressions, the category is class JobImpressions itself.
  96. *
  97. * @return Printing attribute class (category), an instance of class
  98. * {@link java.lang.Class java.lang.Class}.
  99. */
  100. public final Class getCategory() {
  101. return JobImpressions.class;
  102. }
  103. /**
  104. * Get the name of the category of which this attribute value is an
  105. * instance.
  106. * <P>
  107. * For class JobImpressions, the category name is
  108. * <CODE>"job-impressions"</CODE>.
  109. *
  110. * @return Attribute category name.
  111. */
  112. public final String getName() {
  113. return "job-impressions";
  114. }
  115. }