| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
SimpleAttributeSet attribute = new SimpleAttributeSet();
Based on 249 examples
public class SimpleAttributeSet extends Object implements MutableAttributeSet, Serializable, Cloneable
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 applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeansTM
has been added to the java.beans
package.
Please see {@link java.beans.XMLEncoder}.
Field Summary | |
---|---|
static AttributeSet |
EMPTY
An empty attribute set. |
Constructor Summary | |
---|---|
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 |
Makes a copy of the attributes. |
boolean |
Compares this object to the specified object. |
Object |
getAttribute(Object name) Gets the value of an attribute. |
int |
Gets a count of the number of attributes. |
Enumeration |
Gets the names of the attributes in the set. |
AttributeSet |
Gets the resolving parent. |
int |
hashCode() Returns a hashcode for this set of attributes. |
boolean |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final AttributeSet EMPTY
Constructor Detail |
---|
public SimpleAttributeSet()
public SimpleAttributeSet(AttributeSet source)
source
- the set of attributesMethod Detail |
---|
public void addAttribute(Object name, Object value)
name
- the attribute namevalue
- the attribute valuepublic void addAttributes(AttributeSet attributes)
attributes
- the set of attributes to addpublic Object clone()
clone
in class Object
public boolean containsAttribute(Object name, Object value)
name
- the namevalue
- the valuepublic boolean containsAttributes(AttributeSet attributes)
attributes
- the attribute listpublic AttributeSet copyAttributes()
public boolean equals(Object obj)
true
if the object is an equivalent
set of attributes.
equals
in class Object
obj
- the object to compare this attribute set withtrue
if the objects are equal;
false
otherwisepublic Object getAttribute(Object name)
name
- the attribute namepublic int getAttributeCount()
public Enumeration getAttributeNames()
Enumeration
public AttributeSet getResolveParent()
public int hashCode()
hashCode
in class Object
public boolean isDefined(Object attrName)
attrName
- the attribute namepublic boolean isEmpty()
public boolean isEqual(AttributeSet attr)
attr
- the second attribute setpublic void removeAttribute(Object name)
name
- the attribute namepublic void removeAttributes(AttributeSet attributes)
attributes
- the set of attributes to removepublic void removeAttributes(Enumeration names)
names
- the set of names to removepublic void setResolveParent(AttributeSet parent)
parent
- the parentpublic String toString()
toString
in class Object
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |