home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / text / MutableAttributeSet.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  3.2 KB  |  95 lines

  1. /*
  2.  * @(#)MutableAttributeSet.java    1.3 98/03/18
  3.  *
  4.  * Copyright 1997 Sun Microsystems, Inc. 901 San Antonio Road, 
  5.  * Palo Alto, California, 94303, U.S.A.  All Rights Reserved.
  6.  * 
  7.  * This software is the confidential and proprietary information of Sun
  8.  * Microsystems, Inc. ("Confidential Information").  You shall not
  9.  * disclose such Confidential Information and shall use it only in
  10.  * accordance with the terms of the license agreement you entered into
  11.  * with Sun.
  12.  * 
  13.  * CopyrightVersion 1.2
  14.  *  
  15.  * (C) Copyright Taligent, Inc. 1997 - All Rights Reserved
  16.  * (C) Copyright IBM Corp. 1997 - All Rights Reserved
  17.  *
  18.  * The original version of this source code is copyright
  19.  * and owned by Taligent, Inc., a wholly-owned subsidiary of IBM. These
  20.  * materials are provided under terms of a License Agreement between Taligent
  21.  * and Sun. This technology is protected by multiple US and International
  22.  * patents. This notice and attribution to Taligent may not be removed.
  23.  * Taligent is a registered trademark of Taligent, Inc.
  24.  * 
  25.  * 
  26.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  27.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  28.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  29.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  30.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  31.  * THIS SOFTWARE OR ITS DERIVATIVES.
  32.  * 
  33.  * 
  34.  */
  35.  
  36. package java.text;
  37.  
  38. import java.util.Enumeration;
  39.  
  40. /**
  41.  * A generic interface for a mutable collection of unique attributes.
  42.  * <p>
  43.  * Functions taking AttributeSet as an argument maintain no reference to
  44.  * the attribute set itself.  Thus a mutable attribute set may be safely
  45.  * passed to these functions, and later modifications to that set will
  46.  * not affect the contents of this set.
  47.  * <p>
  48.  * Implementations will probably want to provide a constructor of the
  49.  * form:<br><code>
  50.  * public XXXMutableAttributeSet(AttributeSet source);</code><br>
  51.  *
  52.  * @see TextAttributeSet
  53.  */
  54. public interface MutableAttributeSet extends AttributeSet {
  55.     /**
  56.      * Remove any existing attribute with the specified name, and add a new
  57.      * attribute with the specified name and value.
  58.      *
  59.      * @param name the name of the attribute to add
  60.      * @param value the value of the attribute to add
  61.      */
  62.     public void add(String name, Object value);
  63.  
  64.     /**
  65.      * Remove any existing attributes with the specified names, and add the
  66.      * new attributes.
  67.      *
  68.      * @param attributes the set of attributes to add
  69.      */
  70.     public void add(AttributeSet attributes);
  71.  
  72.     /**
  73.      * Remove any existing attribute with the specified name.
  74.      *
  75.      * @param name the name of the attribute to remove
  76.      */
  77.     public void remove(String name);
  78.  
  79.     /**
  80.      * Remove any existing attributes with the specified names.
  81.      *
  82.      * @param names an enumeration over the names of attributes to remove.  The
  83.      * elements of the enumeration are Strings.
  84.      */
  85.     public void remove(Enumeration names);
  86.  
  87.     /**
  88.      * Remove all attributes and add the specified attributes.
  89.      *
  90.      * @param attributes the set of attributes to add
  91.      */
  92.     public void set(AttributeSet attributes);
  93. }
  94.  
  95.