1. /*
  2. * @(#)MutableAttributeSet.java 1.12 00/02/02
  3. *
  4. * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package javax.swing.text;
  11. import java.util.Enumeration;
  12. /**
  13. * A generic interface for a mutable collection of unique attributes.
  14. *
  15. * Implementations will probably want to provide a constructor of the
  16. * form:<tt>
  17. * public XXXAttributeSet(ConstAttributeSet source);</tt>
  18. *
  19. * @version 1.12 02/02/00
  20. */
  21. public interface MutableAttributeSet extends AttributeSet {
  22. /**
  23. * Creates a new attribute set similar to this one except that it contains
  24. * an attribute with the given name and value. The object must be
  25. * immutable, or not mutated by any client.
  26. *
  27. * @param name the name
  28. * @param value the value
  29. */
  30. public void addAttribute(Object name, Object value);
  31. /**
  32. * Creates a new attribute set similar to this one except that it contains
  33. * the given attributes and values.
  34. *
  35. * @param attributes the set of attributes
  36. */
  37. public void addAttributes(AttributeSet attributes);
  38. /**
  39. * Creates a new attribute set similar to this one except that it contains
  40. * no attribute with the given name.
  41. *
  42. * @param name the attribute name
  43. */
  44. public void removeAttribute(Object name);
  45. /**
  46. * Creates a new attribute set similar to this one except that it contains
  47. * no attribute with any of the given names.
  48. *
  49. * @param names the set of names
  50. */
  51. public void removeAttributes(Enumeration names);
  52. /**
  53. * Creates a new attribute set similar to this one except that it contains
  54. * no attribute with any of the given names and values. Existing
  55. * attributes with the same name and different value will remain.
  56. *
  57. * @param attributes the set of attributes
  58. */
  59. public void removeAttributes(AttributeSet attributes);
  60. /**
  61. * Sets the resolving parent. This is the set
  62. * of attributes to resolve through if an attribute
  63. * isn't defined locally.
  64. *
  65. * @param parent the parent
  66. */
  67. public void setResolveParent(AttributeSet parent);
  68. }