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