sferyx.administration.renderers
Class BigAttributeSet

java.lang.Object
  extended by sferyx.administration.renderers.BigAttributeSet
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.text.AttributeSet, javax.swing.text.MutableAttributeSet

public class BigAttributeSet
extends java.lang.Object
implements javax.swing.text.MutableAttributeSet, java.io.Serializable, java.lang.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 XMLEncoder.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.swing.text.AttributeSet
javax.swing.text.AttributeSet.CharacterAttribute, javax.swing.text.AttributeSet.ColorAttribute, javax.swing.text.AttributeSet.FontAttribute, javax.swing.text.AttributeSet.ParagraphAttribute
 
Field Summary
static javax.swing.text.AttributeSet EMPTY
          An empty attribute set.
 
Fields inherited from interface javax.swing.text.AttributeSet
NameAttribute, ResolveAttribute
 
Constructor Summary
BigAttributeSet()
          Creates a new attribute set.
BigAttributeSet(javax.swing.text.AttributeSet source)
          Creates a new attribute set based on a supplied set of attributes.
 
Method Summary
 void addAttribute(java.lang.Object name, java.lang.Object value)
          Adds an attribute to the list.
 void addAttributes(javax.swing.text.AttributeSet attributes)
          Adds a set of attributes to the list.
 java.lang.Object clone()
          Clones a set of attributes.
 boolean containsAttribute(java.lang.Object name, java.lang.Object value)
          Checks whether the attribute list contains a specified attribute name/value pair.
 boolean containsAttributes(javax.swing.text.AttributeSet attributes)
          Checks whether the attribute list contains all the specified name/value pairs.
 javax.swing.text.AttributeSet copyAttributes()
          Makes a copy of the attributes.
 boolean equals(java.lang.Object obj)
          Compares this object to the specified object.
 java.lang.Object getAttribute(java.lang.Object name)
          Gets the value of an attribute.
 int getAttributeCount()
          Gets a count of the number of attributes.
 java.util.Enumeration getAttributeNames()
          Gets the names of the attributes in the set.
 javax.swing.text.AttributeSet getResolveParent()
          Gets the resolving parent.
 int hashCode()
          Returns a hashcode for this set of attributes.
 boolean isDefined(java.lang.Object attrName)
          Tells whether a given attribute is defined.
 boolean isEmpty()
          Checks whether the set of attributes is empty.
 boolean isEqual(javax.swing.text.AttributeSet attr)
          Compares two attribute sets.
 void removeAttribute(java.lang.Object name)
          Removes an attribute from the list.
 void removeAttributes(javax.swing.text.AttributeSet attributes)
          Removes a set of attributes from the list.
 void removeAttributes(java.util.Enumeration names)
          Removes a set of attributes from the list.
 void setResolveParent(javax.swing.text.AttributeSet parent)
          Sets the resolving parent.
 java.lang.String toString()
          Converts the attribute set to a String.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static final javax.swing.text.AttributeSet EMPTY
An empty attribute set.

Constructor Detail

BigAttributeSet

public BigAttributeSet()
Creates a new attribute set.


BigAttributeSet

public BigAttributeSet(javax.swing.text.AttributeSet source)
Creates a new attribute set based on a supplied set of attributes.

Parameters:
source - the set of attributes
Method Detail

isEmpty

public boolean isEmpty()
Checks whether the set of attributes is empty.

Returns:
true if the set is empty else false

getAttributeCount

public int getAttributeCount()
Gets a count of the number of attributes.

Specified by:
getAttributeCount in interface javax.swing.text.AttributeSet
Returns:
the count

isDefined

public boolean isDefined(java.lang.Object attrName)
Tells whether a given attribute is defined.

Specified by:
isDefined in interface javax.swing.text.AttributeSet
Parameters:
attrName - the attribute name
Returns:
true if the attribute is defined

isEqual

public boolean isEqual(javax.swing.text.AttributeSet attr)
Compares two attribute sets.

Specified by:
isEqual in interface javax.swing.text.AttributeSet
Parameters:
attr - the second attribute set
Returns:
true if the sets are equal, false otherwise

copyAttributes

public javax.swing.text.AttributeSet copyAttributes()
Makes a copy of the attributes.

Specified by:
copyAttributes in interface javax.swing.text.AttributeSet
Returns:
the copy

getAttributeNames

public java.util.Enumeration getAttributeNames()
Gets the names of the attributes in the set.

Specified by:
getAttributeNames in interface javax.swing.text.AttributeSet
Returns:
the names as an Enumeration

getAttribute

public java.lang.Object getAttribute(java.lang.Object name)
Gets the value of an attribute.

Specified by:
getAttribute in interface javax.swing.text.AttributeSet
Parameters:
name - the attribute name
Returns:
the value

containsAttribute

public boolean containsAttribute(java.lang.Object name,
                                 java.lang.Object value)
Checks whether the attribute list contains a specified attribute name/value pair.

Specified by:
containsAttribute in interface javax.swing.text.AttributeSet
Parameters:
name - the name
value - the value
Returns:
true if the name/value pair is in the list

containsAttributes

public boolean containsAttributes(javax.swing.text.AttributeSet attributes)
Checks whether the attribute list contains all the specified name/value pairs.

Specified by:
containsAttributes in interface javax.swing.text.AttributeSet
Parameters:
attributes - the attribute list
Returns:
true if the list contains all the name/value pairs

addAttribute

public void addAttribute(java.lang.Object name,
                         java.lang.Object value)
Adds an attribute to the list.

Specified by:
addAttribute in interface javax.swing.text.MutableAttributeSet
Parameters:
name - the attribute name
value - the attribute value

addAttributes

public void addAttributes(javax.swing.text.AttributeSet attributes)
Adds a set of attributes to the list.

Specified by:
addAttributes in interface javax.swing.text.MutableAttributeSet
Parameters:
attributes - the set of attributes to add

removeAttribute

public void removeAttribute(java.lang.Object name)
Removes an attribute from the list.

Specified by:
removeAttribute in interface javax.swing.text.MutableAttributeSet
Parameters:
name - the attribute name

removeAttributes

public void removeAttributes(java.util.Enumeration names)
Removes a set of attributes from the list.

Specified by:
removeAttributes in interface javax.swing.text.MutableAttributeSet
Parameters:
names - the set of names to remove

removeAttributes

public void removeAttributes(javax.swing.text.AttributeSet attributes)
Removes a set of attributes from the list.

Specified by:
removeAttributes in interface javax.swing.text.MutableAttributeSet
Parameters:
attributes - the set of attributes to remove

getResolveParent

public javax.swing.text.AttributeSet getResolveParent()
Gets the resolving parent. This is the set of attributes to resolve through if an attribute isn't defined locally. This is null if there are no other sets of attributes to resolve through.

Specified by:
getResolveParent in interface javax.swing.text.AttributeSet
Returns:
the parent

setResolveParent

public void setResolveParent(javax.swing.text.AttributeSet parent)
Sets the resolving parent.

Specified by:
setResolveParent in interface javax.swing.text.MutableAttributeSet
Parameters:
parent - the parent

clone

public java.lang.Object clone()
Clones a set of attributes.

Overrides:
clone in class java.lang.Object
Returns:
the new set of attributes

hashCode

public int hashCode()
Returns a hashcode for this set of attributes.

Overrides:
hashCode in class java.lang.Object
Returns:
a hashcode value for this set of attributes.

equals

public boolean equals(java.lang.Object obj)
Compares this object to the specified object. The result is true if the object is an equivalent set of attributes.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare this attribute set with
Returns:
true if the objects are equal; false otherwise

toString

public java.lang.String toString()
Converts the attribute set to a String.

Overrides:
toString in class java.lang.Object
Returns:
the string