Package Summary  Overview Summary

class:SimpleAttributeSet [NONE]

All Implemented Interfaces:
Serializable, Cloneable, AttributeSet, MutableAttributeSet

public class SimpleAttributeSetextends 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 JavaBeans has been added to the java.beans package. Please see XMLEncoder.

field:EMPTY [NONE]

  • EMPTY

    public static final  AttributeSet EMPTY
    An empty attribute set.

constructor:SimpleAttributeSet() [NONE]

  • SimpleAttributeSet

    public SimpleAttributeSet()
    Creates a new attribute set.
  • constructor:SimpleAttributeSet(javax.swing.text.AttributeSet) [NONE]

    SimpleAttributeSet

    public SimpleAttributeSet (AttributeSet source)
    Creates a new attribute set based on a supplied set of attributes.
    Parameters:
    source - the set of attributes

    method:isEmpty() [NONE]

  • isEmpty

    public boolean isEmpty()
    Checks whether the set of attributes is empty.
    Returns:
    true if the set is empty else false
  • method:getAttributeCount() [NONE]

    getAttributeCount

    public int getAttributeCount()
    Gets a count of the number of attributes.
    Specified by:
    getAttributeCount in interface AttributeSet
    Returns:
    the count

    method:isDefined(java.lang.Object) [NONE]

    isDefined

    public boolean isDefined (Object attrName)
    Tells whether a given attribute is defined.
    Specified by:
    isDefined in interface AttributeSet
    Parameters:
    attrName - the attribute name
    Returns:
    true if the attribute is defined

    method:isEqual(javax.swing.text.AttributeSet) [NONE]

    isEqual

    public boolean isEqual (AttributeSet attr)
    Compares two attribute sets.
    Specified by:
    isEqual in interface AttributeSet
    Parameters:
    attr - the second attribute set
    Returns:
    true if the sets are equal, false otherwise

    method:copyAttributes() [NONE]

    copyAttributes

    public AttributeSet copyAttributes()
    Makes a copy of the attributes.
    Specified by:
    copyAttributes in interface AttributeSet
    Returns:
    the copy

    method:getAttributeNames() [NONE]

    getAttributeNames

    public Enumeration<?> getAttributeNames()
    Gets the names of the attributes in the set.
    Specified by:
    getAttributeNames in interface AttributeSet
    Returns:
    the names as an Enumeration

    method:getAttribute(java.lang.Object) [NONE]

    getAttribute

    public Object getAttribute (Object name)
    Gets the value of an attribute.
    Specified by:
    getAttribute in interface AttributeSet
    Parameters:
    name - the attribute name
    Returns:
    the value

    method:containsAttribute(java.lang.Object,java.lang.Object) [NONE]

    containsAttribute

    public boolean containsAttribute (Object name, Object value)
    Checks whether the attribute list contains a specified attribute name/value pair.
    Specified by:
    containsAttribute in interface AttributeSet
    Parameters:
    name - the name
    value - the value
    Returns:
    true if the name/value pair is in the list

    method:containsAttributes(javax.swing.text.AttributeSet) [NONE]

    containsAttributes

    public boolean containsAttributes (AttributeSet attributes)
    Checks whether the attribute list contains all the specified name/value pairs.
    Specified by:
    containsAttributes in interface AttributeSet
    Parameters:
    attributes - the attribute list
    Returns:
    true if the list contains all the name/value pairs

    method:addAttribute(java.lang.Object,java.lang.Object) [NONE]

    addAttribute

    public void addAttribute (Object name, Object value)
    Adds an attribute to the list.
    Specified by:
    addAttribute in interface MutableAttributeSet
    Parameters:
    name - the attribute name
    value - the attribute value

    method:addAttributes(javax.swing.text.AttributeSet) [NONE]

    addAttributes

    public void addAttributes (AttributeSet attributes)
    Adds a set of attributes to the list.
    Specified by:
    addAttributes in interface MutableAttributeSet
    Parameters:
    attributes - the set of attributes to add

    method:removeAttribute(java.lang.Object) [NONE]

    removeAttribute

    public void removeAttribute (Object name)
    Removes an attribute from the list.
    Specified by:
    removeAttribute in interface MutableAttributeSet
    Parameters:
    name - the attribute name

    method:removeAttributes(java.util.Enumeration) [NONE]

    removeAttributes

    public void removeAttributes (Enumeration<?> names)
    Removes a set of attributes from the list.
    Specified by:
    removeAttributes in interface MutableAttributeSet
    Parameters:
    names - the set of names to remove

    method:removeAttributes(javax.swing.text.AttributeSet) [NONE]

    removeAttributes

    public void removeAttributes (AttributeSet attributes)
    Removes a set of attributes from the list.
    Specified by:
    removeAttributes in interface MutableAttributeSet
    Parameters:
    attributes - the set of attributes to remove

    method:getResolveParent() [NONE]

    getResolveParent

    public 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 AttributeSet
    Returns:
    the parent

    method:setResolveParent(javax.swing.text.AttributeSet) [NONE]

    setResolveParent

    public void setResolveParent (AttributeSet parent)
    Sets the resolving parent.
    Specified by:
    setResolveParent in interface MutableAttributeSet
    Parameters:
    parent - the parent

    method:clone() [NONE]

    clone

    public Object clone()
    Clones a set of attributes.
    Overrides:
    clone in class Object
    Returns:
    the new set of attributes
    See Also:

    method:hashCode() [NONE]

    hashCode

    public int hashCode()
    Returns a hashcode for this set of attributes.
    Overrides:
    hashCode in class Object
    Returns:
    a hashcode value for this set of attributes.
    See Also:

    method:equals(java.lang.Object) [NONE]

    equals

    public boolean equals (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 Object
    Parameters:
    obj - the object to compare this attribute set with
    Returns:
    true if the objects are equal; false otherwise
    See Also:

    method:toString() [NONE]

    toString

    public String toString()
    Converts the attribute set to a String.
    Overrides:
    toString in class Object
    Returns:
    the string

    © 2023 Oracle Corporation and/or its affiliates