public class SimpleAttributeSet extends Objectimplements MutableAttributeSet , Serializable , Cloneable
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 applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans™ has been added to the java.beans package. Please see XMLEncoder.
AttributeSet.CharacterAttribute , AttributeSet.ColorAttribute , AttributeSet.FontAttribute , AttributeSet.ParagraphAttribute | Modifier and Type | Field and Description |
|---|---|
static AttributeSet |
EMPTY
An empty attribute set.
|
NameAttribute, ResolveAttribute| Constructor and Description |
|---|
SimpleAttributeSet()
Creates a new attribute set.
|
SimpleAttributeSet(AttributeSet
Creates a new attribute set based on a supplied set of attributes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(Object
Adds an attribute to the list.
|
void |
addAttributes(AttributeSet
Adds a set of attributes to the list.
|
Object |
clone()
Clones a set of attributes.
|
boolean |
containsAttribute(Object
Checks whether the attribute list contains a specified attribute name/value pair.
|
boolean |
containsAttributes(AttributeSet
Checks whether the attribute list contains all the specified name/value pairs.
|
AttributeSet |
copyAttributes()
Makes a copy of the attributes.
|
boolean |
equals(Object
Compares this object to the specified object.
|
Object |
getAttribute(Object
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.
|
int |
hashCode()
Returns a hashcode for this set of attributes.
|
boolean |
isDefined(Object
Tells whether a given attribute is defined.
|
boolean |
isEmpty()
Checks whether the set of attributes is empty.
|
boolean |
isEqual(AttributeSet
Compares two attribute sets.
|
void |
removeAttribute(Object
Removes an attribute from the list.
|
void |
removeAttributes(AttributeSet
Removes a set of attributes from the list.
|
void |
removeAttributes(Enumeration
Removes a set of attributes from the list.
|
void |
setResolveParent(AttributeSet
Sets the resolving parent.
|
String |
toString()
Converts the attribute set to a String.
|
public static final AttributeSetEMPTY
public SimpleAttributeSet()
public SimpleAttributeSet(AttributeSetsource)
source - the set of attributes
public boolean isEmpty()
public int getAttributeCount()
getAttributeCount in interface
AttributeSet
public boolean isDefined(ObjectattrName)
isDefined in interface
AttributeSet
attrName - the attribute name
public boolean isEqual(AttributeSetattr)
isEqual in interface
AttributeSet
attr - the second attribute set
public AttributeSetcopyAttributes()
copyAttributes in interface
AttributeSet
public Enumeration<?> getAttributeNames()
getAttributeNames in interface
AttributeSet
Enumeration
public ObjectgetAttribute(Object name)
getAttribute in interface
AttributeSet
name - the attribute name
public boolean containsAttribute(Objectname, Object value)
containsAttribute in interface
AttributeSet
name - the name
value - the value
public boolean containsAttributes(AttributeSetattributes)
containsAttributes in interface
AttributeSet
attributes - the attribute list
public void addAttribute(Objectname, Object value)
addAttribute in interface
MutableAttributeSet
name - the attribute name
value - the attribute value
public void addAttributes(AttributeSetattributes)
addAttributes in interface
MutableAttributeSet
attributes - the set of attributes to add
public void removeAttribute(Objectname)
removeAttribute in interface
MutableAttributeSet
name - the attribute name
public void removeAttributes(Enumeration<?> names)
removeAttributes in interface
MutableAttributeSet
names - the set of names to remove
public void removeAttributes(AttributeSetattributes)
removeAttributes in interface
MutableAttributeSet
attributes - the set of attributes to remove
public AttributeSetgetResolveParent()
getResolveParent in interface
AttributeSet
public void setResolveParent(AttributeSetparent)
setResolveParent in interface
MutableAttributeSet
parent - the parent
public Objectclone()
public int hashCode()
hashCode in class
Object
Object.equals(java.lang.Object) ,
System.identityHashCode(java.lang.Object)
public boolean equals(Objectobj)
true if the object is an equivalent set of attributes.
equals in class
Object
obj - the object to compare this attribute set with
true if the objects are equal;
false otherwise
Object.hashCode() ,
HashMap