1. /*
  2. * @(#)JobMessageFromOperator.java 1.6 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 java.util.Locale;
  9. import javax.print.attribute.TextSyntax;
  10. import javax.print.attribute.PrintJobAttribute;
  11. /**
  12. * Class JobMessageFromOperator is a printing attribute class, a text attribute,
  13. * that provides a message from an operator, system administrator, or
  14. * "intelligent" process to indicate to the end user the reasons for
  15. * modification or other management action taken on a job.
  16. * <P>
  17. * A Print Job's attribute set includes zero instances or one instance of a
  18. * JobMessageFromOperator attribute, not more than one instance. A new
  19. * JobMessageFromOperator attribute replaces an existing JobMessageFromOperator
  20. * attribute, if any. In other words, JobMessageFromOperator is not intended to
  21. * be a history log. If it wishes, the client can detect changes to a Print
  22. * Job's JobMessageFromOperator attribute and maintain the client's own history
  23. * log of the JobMessageFromOperator attribute values.
  24. * <P>
  25. * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
  26. * locale gives the IPP natural language. The category name returned by
  27. * <CODE>getName()</CODE> gives the IPP attribute name.
  28. * <P>
  29. *
  30. * @author Alan Kaminsky
  31. */
  32. public final class JobMessageFromOperator extends TextSyntax
  33. implements PrintJobAttribute {
  34. /**
  35. * Constructs a new job message from operator attribute with the given
  36. * message and locale.
  37. *
  38. * @param message Message.
  39. * @param locale Natural language of the text string. null
  40. * is interpreted to mean the default locale as returned
  41. * by <code>Locale.getDefault()</code>
  42. *
  43. * @exception NullPointerException
  44. * (unchecked exception) Thrown if <CODE>message</CODE> is null.
  45. */
  46. public JobMessageFromOperator(String message, Locale locale) {
  47. super (message, locale);
  48. }
  49. /**
  50. * Returns whether this job message from operator attribute is equivalent to
  51. * the passed in object. To be equivalent, all of the following conditions
  52. * must be true:
  53. * <OL TYPE=1>
  54. * <LI>
  55. * <CODE>object</CODE> is not null.
  56. * <LI>
  57. * <CODE>object</CODE> is an instance of class JobMessageFromOperator.
  58. * <LI>
  59. * This job message from operator attribute's underlying string and
  60. * <CODE>object</CODE>'s underlying string are equal.
  61. * <LI>
  62. * This job message from operator attribute's locale and
  63. * <CODE>object</CODE>'s locale are equal.
  64. * </OL>
  65. *
  66. * @param object Object to compare to.
  67. *
  68. * @return True if <CODE>object</CODE> is equivalent to this job
  69. * message from operator attribute, false otherwise.
  70. */
  71. public boolean equals(Object object) {
  72. return (super.equals (object) &&
  73. object instanceof JobMessageFromOperator);
  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 JobMessageFromOperator, the
  80. * category is class JobMessageFromOperator 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 getCategory() {
  86. return JobMessageFromOperator.class;
  87. }
  88. /**
  89. * Get the name of the category of which this attribute value is an
  90. * instance.
  91. * <P>
  92. * For class JobMessageFromOperator, the
  93. * category name is <CODE>"job-message-from-operator"</CODE>.
  94. *
  95. * @return Attribute category name.
  96. */
  97. public final String getName() {
  98. return "job-message-from-operator";
  99. }
  100. }