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