Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Class java.awt.swing.text.SimpleAttributeSet

java.lang.Object
    |
    +----java.awt.swing.text.SimpleAttributeSet

public class SimpleAttributeSet
extends Object
implements MutableAttributeSet, Serializable
A straightforward implementation of MutableAttributeSet using a hash table.

Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.


Field Summary
static AttributeSet  EMPTY
An empty attribute set.
 

Constructor Summary
 SimpleAttributeSet()
Creates a new attribute set.
 SimpleAttributeSet(AttributeSet source)
Creates a new attribute set based on a supplied set of attributes.
 

Method Summary
void  addAttribute(Object name, Object value)
Adds an attribute to the list.
void  addAttributes(AttributeSet attributes)
Adds a set of attributes to the list.
Object  clone()
Clones a set of attributes.
boolean  containsAttribute(Object name, Object value)
Checks whether the attribute list contains a specified attribute name/value pair.
boolean  containsAttributes(AttributeSet attributes)
Checks whether the attribute list contains all the specified name/value pairs.
AttributeSet  copyAttributes()
Makes a copy of the attributes.
Object  getAttribute(Object name)
Gets the value of an attribute.
int  getAttributeCount()
Gets a count of the number of attributes.
Enumeration  getAttributeNames()
Gets the names of the attributes in the set.
AttributeSet  getResolveParent()
Gets the resolving parent.
boolean  isDefined(Object attrName)
Tells whether a given attribute is defined.
boolean  isEmpty()
Checks whether the set of attributes is empty.
boolean  isEqual(AttributeSet attr)
Compares two attribute sets.
void  removeAttribute(Object name)
Removes an attribute from the list.
void  removeAttributes(Enumeration names)
Removes a set of attributes from the list.
void  removeAttributes(AttributeSet attributes)
Removes a set of attributes from the list.
void  setResolveParent(AttributeSet parent)
Sets the resolving parent.
String  toString()
Converts the attribute set to a String.
 
Methods inherited from class java.lang.Object
 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

public static final AttributeSet EMPTY
An empty attribute set.
Constructor Detail

SimpleAttributeSet

public SimpleAttributeSet()
Creates a new attribute set.

SimpleAttributeSet

public SimpleAttributeSet(AttributeSet source)
Creates a new attribute set based on a supplied set of attributes.
Parameters:
source - the set of attributes
Method Detail

isEmpty

public boolean isEmpty()
Checks whether the set of attributes is empty.
Returns:
true if the set is empty else false

getAttributeCount

public int getAttributeCount()
Gets a count of the number of attributes.
Returns:
the count

isDefined

public boolean isDefined(Object attrName)
Tells whether a given attribute is defined.
Parameters:
attrName - the attribute name
Returns:
true if the attribute is defined

isEqual

public boolean isEqual(AttributeSet attr)
Compares two attribute sets.
Parameters:
attr - the second attribute set
Returns:
true if equathe listl

copyAttributes

public AttributeSet copyAttributes()
Makes a copy of the attributes.
Returns:
the copy

getAttributeNames

public Enumeration getAttributeNames()
Gets the names of the attributes in the set.
Returns:
the names as an Enumeration

getAttribute

public Object getAttribute(Object name)
Gets the value of an attribute.
Parameters:
name - the attribute name
Returns:
the value

containsAttribute

public boolean containsAttribute(Object name,
                                 Object value)
Checks whether the attribute list contains a specified attribute name/value pair.
Parameters:
name - the name
value - the value
Returns:
true if the name/value pair is in the list

containsAttributes

public boolean containsAttributes(AttributeSet attributes)
Checks whether the attribute list contains all the specified name/value pairs.
Parameters:
attributes - the attribute list
Returns:
true if the list contains all the name/value pairs

addAttribute

public void addAttribute(Object name,
                         Object value)
Adds an attribute to the list.
Implements:
addAttribute in interface MutableAttributeSet
Parameters:
name - the attribute name
value - the attribute value

addAttributes

public void addAttributes(AttributeSet attributes)
Adds a set of attributes to the list.
Implements:
addAttributes in interface MutableAttributeSet
Parameters:
attributes - the set of attributes to add

removeAttribute

public void removeAttribute(Object name)
Removes an attribute from the list.
Implements:
removeAttribute in interface MutableAttributeSet
Parameters:
name - the attribute name

removeAttributes

public void removeAttributes(Enumeration names)
Removes a set of attributes from the list.
Implements:
removeAttributes in interface MutableAttributeSet
Parameters:
names - the set of names to remove

removeAttributes

public void removeAttributes(AttributeSet attributes)
Removes a set of attributes from the list.
Implements:
removeAttributes in interface MutableAttributeSet
Parameters:
attributes - the set of attributes to remove

clone

public Object clone()
Clones a set of attributes.
Returns:
the new set of attributes
Overrides:
clone in class Object

getResolveParent

public AttributeSet getResolveParent()
Gets the resolving parent. This is the set of attributes to resolve through if an attribute isn't defined locally. This is null if there are no other sets of attributes to resolve through.
Returns:
the parent

setResolveParent

public void setResolveParent(AttributeSet parent)
Sets the resolving parent.
Implements:
setResolveParent in interface MutableAttributeSet
Parameters:
parent - the parent

toString

public String toString()
Converts the attribute set to a String.
Returns:
the string
Overrides:
toString in class Object

Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Submit a bug or feature
Submit comments/suggestions about new javadoc look.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.