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