javax.swing.text
Interface AttributeSet

All Known Subinterfaces:
MutableAttributeSet, Style
All Known Implementing Classes:
javax.swing.text.AbstractDocument.AbstractElement, javax.swing.text.SimpleAttributeSet.EmptyAttributeSet, javax.swing.text.StyleContext.NamedStyle, SimpleAttributeSet, javax.swing.text.StyleContext.SmallAttributeSet

public interface AttributeSet

Unsafe:


Field Summary
static Object NameAttribute
          Suppressed: Attribute name used to name the collection of attributes.
static Object ResolveAttribute
          Suppressed: Attribute name used to identify the resolving parent set of attributes, if one is defined.
 
Method Summary
 boolean containsAttribute(Object name, Object value)
          Enabled: Returns true if this set contains this attribute with an equal value.
 boolean containsAttributes(AttributeSet attributes)
          Enabled: Returns true if this set contains all the attributes with equal values.
 AttributeSet copyAttributes()
          Enabled: Returns an attribute set that is guaranteed not to change over time.
 Object getAttribute(Object key)
          Enabled: Fetches the value of the given attribute.
 int getAttributeCount()
          Enabled: Returns the number of attributes contained in this set.
 Enumeration getAttributeNames()
          Enabled: Returns an enumeration over the names of the attributes in the set.
 AttributeSet getResolveParent()
          Enabled: Gets the resolving parent.
 boolean isDefined(Object attrName)
          Enabled: Checks whether the named attribute has a value specified in the set without resolving through another attribute set.
 boolean isEqual(AttributeSet attr)
          Enabled: Determines if the two attribute sets are equivalent.
 

Field Detail

NameAttribute

public static final Object NameAttribute
Suppressed: Attribute name used to name the collection of attributes.


ResolveAttribute

public static final Object ResolveAttribute
Suppressed: Attribute name used to identify the resolving parent set of attributes, if one is defined.

Method Detail

getAttributeCount

public int getAttributeCount()
Enabled: Returns the number of attributes contained in this set.

Returns:
the number of attributes >= 0

isDefined

public boolean isDefined(Object attrName)
Enabled: Checks whether the named attribute has a value specified in the set without resolving through another attribute set.

Parameters:
attrName - the attribute name
Returns:
true if the attribute has a value specified

isEqual

public boolean isEqual(AttributeSet attr)
Enabled: Determines if the two attribute sets are equivalent.

Parameters:
attr - an attribute set
Returns:
true if the sets are equivalent

copyAttributes

public AttributeSet copyAttributes()
Enabled: Returns an attribute set that is guaranteed not to change over time.

Returns:
a copy of the attribute set

getAttribute

public Object getAttribute(Object key)
Enabled: Fetches the value of the given attribute. If the value is not found locally, the search is continued upward through the resolving parent (if one exists) until the value is either found or there are no more parents. If the value is not found, null is returned.

Parameters:
key - the non-null key of the attribute binding
Returns:
the value

getAttributeNames

public Enumeration getAttributeNames()
Enabled: Returns an enumeration over the names of the attributes in the set. The values of the Enumeration may be anything and are not constrained to a particular Object type. The set does not include the resolving parent, if one is defined.

Returns:
the names

containsAttribute

public boolean containsAttribute(Object name,
                                 Object value)
Enabled: Returns true if this set contains this attribute with an equal value.

Parameters:
name - the non-null attribute name
value - the value
Returns:
true if the set contains the attribute with an equal value

containsAttributes

public boolean containsAttributes(AttributeSet attributes)
Enabled: Returns true if this set contains all the attributes with equal values.

Parameters:
attributes - the set of attributes to check against
Returns:
true if this set contains all the attributes with equal values

getResolveParent

public AttributeSet getResolveParent()
Enabled: Gets the resolving parent.

Returns:
the parent


comments?