public class

StyleContext.SmallAttributeSet

extends Object
implements AttributeSet
java.lang.Object
   ↳ javax.swing.text.StyleContext.SmallAttributeSet

Class Overview

This class holds a small number of attributes in an array. The storage format is key, value, key, value, etc. The size of the set is the length of the array divided by two. By default, this is the class that will be used to store attributes when held in the compact sharable form.

Summary

[Expand]
Inherited Fields
From interface javax.swing.text.AttributeSet
Public Constructors
StyleContext.SmallAttributeSet(Object[] attributes)
StyleContext.SmallAttributeSet(AttributeSet attrs)
Public Methods
Object clone()
Clones a set of attributes.
boolean containsAttribute(Object name, Object value)
Checks whether a given attribute name/value is defined.
boolean containsAttributes(AttributeSet attrs)
Checks whether the attribute set contains all of the given attributes.
AttributeSet copyAttributes()
Copies a set of attributes.
boolean equals(Object obj)
Compares this object to the specifed object.
Object getAttribute(Object key)
Gets the value of an attribute.
int getAttributeCount()
Gets the number of attributes that are defined.
Enumeration<?> getAttributeNames()
Gets the names of all attributes.
AttributeSet getResolveParent()
If not overriden, the resolving parent defaults to the parent element.
int hashCode()
Returns a hashcode for this set of attributes.
boolean isDefined(Object key)
Checks whether a given attribute is defined.
boolean isEqual(AttributeSet attr)
Checks whether two attribute sets are equal.
String toString()
Returns a string showing the key/value pairs
[Expand]
Inherited Methods
From class java.lang.Object
From interface javax.swing.text.AttributeSet

Public Constructors

public StyleContext.SmallAttributeSet (Object[] attributes)

public StyleContext.SmallAttributeSet (AttributeSet attrs)

Public Methods

public Object clone ()

Clones a set of attributes. Since the set is immutable, a clone is basically the same set.

Returns
  • the set of attributes

public boolean containsAttribute (Object name, Object value)

Checks whether a given attribute name/value is defined.

Parameters
name the attribute name
value the attribute value
Returns
  • true if the name/value is defined

public boolean containsAttributes (AttributeSet attrs)

Checks whether the attribute set contains all of the given attributes.

Parameters
attrs the attributes to check
Returns
  • true if the element contains all the attributes

public AttributeSet copyAttributes ()

Copies a set of attributes.

Returns
  • the copy
See Also

public boolean equals (Object obj)

Compares this object to the specifed object. The result is true if the object is an equivalent set of attributes.

Parameters
obj the object to compare with.
Returns
  • true if the objects are equal; false otherwise.

public Object getAttribute (Object key)

Gets the value of an attribute.

Parameters
key the attribute name
Returns
  • the attribute value

public int getAttributeCount ()

Gets the number of attributes that are defined.

Returns
  • the number of attributes

public Enumeration<?> getAttributeNames ()

Gets the names of all attributes.

Returns
  • the attribute names

public AttributeSet getResolveParent ()

If not overriden, the resolving parent defaults to the parent element.

Returns
  • the attributes from the parent

public int hashCode ()

Returns a hashcode for this set of attributes.

Returns
  • a hashcode value for this set of attributes.

public boolean isDefined (Object key)

Checks whether a given attribute is defined.

Parameters
key the attribute key
Returns
  • true if the attribute is defined

public boolean isEqual (AttributeSet attr)

Checks whether two attribute sets are equal.

Parameters
attr the attribute set to check against
Returns
  • true if the same

public String toString ()

Returns a string showing the key/value pairs

Returns
  • a string representation of the object.