1. /*
  2. * @(#)PagesPerMinuteColor.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.PrintServiceAttribute;
  11. /**
  12. * Class PagesPerMinuteColor is an integer valued printing attribute that
  13. * indicates the nominal number of pages per minute to the nearest whole number
  14. * which may be generated by this printer when printing color (e.g., simplex,
  15. * color). For purposes of this attribute, "color" means the same as for the
  16. * {@link ColorSupported ColorSupported} attribute, namely, the device is
  17. * capable of any type of color printing at all, including highlight color as
  18. * well as full process color. This attribute is informative, not a service
  19. * guarantee. Generally, it is the value used in the marketing literature to
  20. * describe the color capabilities of this device. A value of 0 indicates a
  21. * device that takes more than two minutes to process a page. If a color device
  22. * has several color modes, it may use the pages-per- minute value for this
  23. * attribute that corresponds to the mode that produces the highest number.
  24. * <P>
  25. * A black and white only printer must not include the PagesPerMinuteColor
  26. * attribute in its attribute set or service registration. If this attribute is
  27. * present, then the {@link ColorSupported ColorSupported} printer description
  28. * attribute must also be present and have a value of SUPPORTED.
  29. * <P>
  30. * <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
  31. * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  32. * name.
  33. * <P>
  34. *
  35. * @author Alan Kaminsky
  36. */
  37. public final class PagesPerMinuteColor extends IntegerSyntax
  38. implements PrintServiceAttribute {
  39. static final long serialVersionUID = 1684993151687470944L;
  40. /**
  41. * Construct a new pages per minute color attribute with the given integer
  42. * 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 PagesPerMinuteColor(int value) {
  50. super(value, 0, Integer.MAX_VALUE);
  51. }
  52. /**
  53. * Returns whether this pages per minute color attribute is equivalent to
  54. * the passed in object. To be equivalent, all of the following conditions
  55. * 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 PagesPerMinuteColor.
  61. * <LI>
  62. * This pages per minute attribute's value and <CODE>object</CODE>'s
  63. * 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 pages per
  69. * minute color attribute, false otherwise.
  70. */
  71. public boolean equals(Object object) {
  72. return (super.equals(object) &&
  73. object instanceof PagesPerMinuteColor);
  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 PagesPerMinuteColor, the
  80. * category is class PagesPerMinuteColor 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<? extends Attribute> getCategory() {
  86. return PagesPerMinuteColor.class;
  87. }
  88. /**
  89. * Get the name of the category of which this attribute value is an
  90. * instance.
  91. * <P>
  92. * For class PagesPerMinuteColor, the
  93. * category name is <CODE>"pages-per-minute-color"</CODE>.
  94. *
  95. * @return Attribute category name.
  96. */
  97. public final String getName() {
  98. return "pages-per-minute-color";
  99. }
  100. }