All Packages Class Hierarchy This Package Previous Next Index
Interface java.text.AttributeSet
- public interface AttributeSet
- extends Cloneable
This interface provides read-only access to a set of attributes.
An attribute is a name/value pair, identified by name. No two
attributes in a set can have the same name.
Instances of AttributeSet can be mutable through additional
functions on the instance. Interfaces that accept
AttributeSet generally assume that the sets may
be referenced and not copied, thus callers must be careful not
to subsequently mutate these sets.
Implementors must be sure to properly implement equals and
hashCode, so that attribute sets may be compared and placed in
hash tables. This set is equal to another set if each set
is empty, or if the sets have the same number of attributes and
each attribute in this set has an attribute with an equal name
and value in the other set.
By definition, attributes placed in an attribute set must
always be immutable, even if the set itself is not. Thus
clients of AttributeSet can always take references to the
names and values of attributes and rely on these not changing.
The implementation of clone may also make this assumption to
avoid doing a deep clone of the attributes themselves.
- See Also:
- AttributedCharacterIterator, MutableAttributeSet
clone()
- Return a clone of this attribute set.
contains(AttributeSet)
- Returns true if this set contains all the attributes with equal values.
contains(String, Object)
- Returns true if this set contains this attribute with an equal value,
or if the value is null and the attribute is not defined.
get(String)
- Returns the value of the attribute with this name, or null if the
attribute is not defined.
getSize()
- Returns the number of attributes.
isEmpty()
- Returns true if the set is empty.
names()
- Returns an enumeration over the names of the attributes in the set.
isEmpty
public abstract boolean isEmpty()
- Returns true if the set is empty.
getSize
public abstract int getSize()
- Returns the number of attributes.
names
public abstract Enumeration names()
- Returns an enumeration over the names of the attributes in the set.
The elements of the enumeration are all Strings.
get
public abstract Object get(String attributeName)
- Returns the value of the attribute with this name, or null if the
attribute is not defined.
contains
public abstract boolean contains(String attributeName,
Object value)
- Returns true if this set contains this attribute with an equal value,
or if the value is null and the attribute is not defined.
contains
public abstract boolean contains(AttributeSet attributes)
- Returns true if this set contains all the attributes with equal values.
clone
public abstract Object clone()
- Return a clone of this attribute set.
- Overrides:
- clone in class Object
All Packages Class Hierarchy This Package Previous Next Index
Submit a bug or feature