1. /*
  2. * @(#)DateTimeAtProcessing.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 java.util.Date;
  9. import javax.print.attribute.DateTimeSyntax;
  10. import javax.print.attribute.PrintJobAttribute;
  11. /**
  12. * Class DateTimeAtProcessing is a printing attribute class, a date-time
  13. * attribute, that indicates the date and time at which the Print Job first
  14. * began processing.
  15. * <P>
  16. * To construct a DateTimeAtProcessing attribute from separate values of the
  17. * year, month, day, hour, minute, and so on, use a {@link java.util.Calendar
  18. * Calendar} object to construct a {@link java.util.Date Date} object, then use
  19. * the {@link java.util.Date Date} object to construct the DateTimeAtProcessing
  20. * attribute. To convert a DateTimeAtProcessing attribute to separate values of
  21. * the year, month, day, hour, minute, and so on, create a {@link
  22. * java.util.Calendar Calendar} object and set it to the {@link java.util.Date
  23. * Date} from the DateTimeAtProcessing attribute.
  24. * <P>
  25. * <B>IPP Compatibility:</B> The information needed to construct an IPP
  26. * "date-time-at-processing" attribute can be obtained as described above. The
  27. * category name returned by <CODE>getName()</CODE> gives the IPP attribute
  28. * name.
  29. * <P>
  30. *
  31. * @author Alan Kaminsky
  32. */
  33. public final class DateTimeAtProcessing extends DateTimeSyntax
  34. implements PrintJobAttribute {
  35. /**
  36. * Construct a new date-time at processing attribute with the given {@link
  37. * java.util.Date Date} value.
  38. *
  39. * @param dateTime {@link java.util.Date Date} value.
  40. *
  41. * @exception NullPointerException
  42. * (unchecked exception) Thrown if <CODE>dateTime</CODE> is null.
  43. */
  44. public DateTimeAtProcessing(Date dateTime) {
  45. super (dateTime);
  46. }
  47. /**
  48. * Returns whether this date-time at processing attribute is equivalent to
  49. * the passed in object. To be equivalent, all of the following conditions
  50. * must be true:
  51. * <OL TYPE=1>
  52. * <LI>
  53. * <CODE>object</CODE> is not null.
  54. * <LI>
  55. * <CODE>object</CODE> is an instance of class DateTimeAtProcessing.
  56. * <LI>
  57. * This date-time at processing attribute's {@link java.util.Date Date}
  58. * value and <CODE>object</CODE>'s {@link java.util.Date Date} value
  59. * are equal.
  60. * </OL>
  61. *
  62. * @param object Object to compare to.
  63. *
  64. * @return True if <CODE>object</CODE> is equivalent to this date-time
  65. * at processing attribute, false otherwise.
  66. */
  67. public boolean equals(Object object) {
  68. return(super.equals (object) &&
  69. object instanceof DateTimeAtProcessing);
  70. }
  71. /**
  72. * Get the printing attribute class which is to be used as the "category"
  73. * for this printing attribute value.
  74. * <P>
  75. * For class DateTimeAtProcessing, the category is class
  76. * DateTimeAtProcessing itself.
  77. *
  78. * @return Printing attribute class (category), an instance of class
  79. * {@link java.lang.Class java.lang.Class}.
  80. */
  81. public final Class getCategory() {
  82. return DateTimeAtProcessing.class;
  83. }
  84. /**
  85. * Get the name of the category of which this attribute value is an
  86. * instance.
  87. * <P>
  88. * For class DateTimeAtProcessing, the category name is
  89. * <CODE>"date-time-at-processing"</CODE>.
  90. *
  91. * @return Attribute category name.
  92. */
  93. public final String getName() {
  94. return "date-time-at-processing";
  95. }
  96. }