1. /*
  2. * @(#)HashPrintRequestAttributeSet.java 1.6 03/12/19
  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;
  8. import java.io.Serializable;
  9. /**
  10. * Class HashPrintRequestAttributeSet inherits its implementation from
  11. * class {@link HashAttributeSet HashAttributeSet} and enforces the
  12. * semantic restrictions of interface
  13. * {@link PrintRequestAttributeSet PrintRequestAttributeSet}.
  14. * <P>
  15. *
  16. * @author Alan Kaminsky
  17. */
  18. public class HashPrintRequestAttributeSet extends HashAttributeSet
  19. implements PrintRequestAttributeSet, Serializable {
  20. private static final long serialVersionUID = 2364756266107751933L;
  21. /**
  22. * Construct a new, empty print request attribute set.
  23. */
  24. public HashPrintRequestAttributeSet() {
  25. super (PrintRequestAttribute.class);
  26. }
  27. /**
  28. * Construct a new print request attribute set,
  29. * initially populated with the given value.
  30. *
  31. * @param attribute Attribute value to add to the set.
  32. *
  33. * @exception NullPointerException
  34. * (unchecked exception) Thrown if <CODE>attribute</CODE> is null.
  35. */
  36. public HashPrintRequestAttributeSet(PrintRequestAttribute attribute) {
  37. super (attribute, PrintRequestAttribute.class);
  38. }
  39. /**
  40. * Construct a new print request attribute set, initially populated with
  41. * the values from the given array. The new attribute set is populated
  42. * by adding the elements of <CODE>attributes</CODE> array to the set in
  43. * sequence, starting at index 0. Thus, later array elements may replace
  44. * earlier array elements if the array contains duplicate attribute
  45. * values or attribute categories.
  46. *
  47. * @param attributes Array of attribute values to add to the set.
  48. * If null, an empty attribute set is constructed.
  49. *
  50. * @exception NullPointerException
  51. * (unchecked exception)
  52. * Thrown if any element of <CODE>attributes</CODE> is null.
  53. */
  54. public HashPrintRequestAttributeSet(PrintRequestAttribute[] attributes) {
  55. super (attributes, PrintRequestAttribute.class);
  56. }
  57. /**
  58. * Construct a new attribute set, initially populated with the
  59. * values from the given set where the members of the attribute set
  60. * are restricted to the <code>(PrintRequestAttributeSe</code> interface.
  61. *
  62. * @param attributes set of attribute values to initialise the set. If
  63. * null, an empty attribute set is constructed.
  64. *
  65. * @exception ClassCastException
  66. * (unchecked exception) Thrown if any element of
  67. * <CODE>attributes</CODE> is not an instance of
  68. * <CODE>(PrintRequestAttributeSe</CODE>.
  69. */
  70. public HashPrintRequestAttributeSet(PrintRequestAttributeSet attributes)
  71. {
  72. super(attributes, PrintRequestAttribute.class);
  73. }
  74. }