public class SimpleAttributeSet extends Object implements 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 source)
Creates a new attribute set based on a supplied set of attributes.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
boolean |
equals(Object obj)
Compares this object to the specified object.
|
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.
|
int |
hashCode()
Returns a hashcode for this set of attributes.
|
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(AttributeSet attributes)
Removes a set of attributes from the list.
|
void |
removeAttributes(Enumeration<?> names)
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.
|
public static final AttributeSet EMPTY
public SimpleAttributeSet()
public SimpleAttributeSet(AttributeSet source)
source - the set of attributespublic boolean isEmpty()
public int getAttributeCount()
getAttributeCount in interface AttributeSetpublic boolean isDefined(Object attrName)
isDefined in interface AttributeSetattrName - the attribute namepublic boolean isEqual(AttributeSet attr)
isEqual in interface AttributeSetattr - the second attribute setpublic AttributeSet copyAttributes()
copyAttributes in interface AttributeSetpublic Enumeration<?> getAttributeNames()
getAttributeNames in interface AttributeSetEnumerationpublic Object getAttribute(Object name)
getAttribute in interface AttributeSetname - the attribute namepublic boolean containsAttribute(Object name, Object value)
containsAttribute in interface AttributeSetname - the namevalue - the valuepublic boolean containsAttributes(AttributeSet attributes)
containsAttributes in interface AttributeSetattributes - the attribute listpublic void addAttribute(Object name, Object value)
addAttribute in interface MutableAttributeSetname - the attribute namevalue - the attribute valuepublic void addAttributes(AttributeSet attributes)
addAttributes in interface MutableAttributeSetattributes - the set of attributes to addpublic void removeAttribute(Object name)
removeAttribute in interface MutableAttributeSetname - the attribute namepublic void removeAttributes(Enumeration<?> names)
removeAttributes in interface MutableAttributeSetnames - the set of names to removepublic void removeAttributes(AttributeSet attributes)
removeAttributes in interface MutableAttributeSetattributes - the set of attributes to removepublic AttributeSet getResolveParent()
getResolveParent in interface AttributeSetpublic void setResolveParent(AttributeSet parent)
setResolveParent in interface MutableAttributeSetparent - the parentpublic Object clone()
public int hashCode()
hashCode in class ObjectObject.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)public boolean equals(Object obj)
true if the object is an equivalent
set of attributes.equals in class Objectobj - the object to compare this attribute set withtrue if the objects are equal;
false otherwiseObject.hashCode(),
HashMap Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2016, Oracle and/or its affiliates. All rights reserved.
DRAFT 9-internal+0-2016-01-26-133437.ivan.openjdk9onspinwait