- java.lang.Object
- 
- javax.swing.text.StyleContext.SmallAttributeSet
 
- 
- All Implemented Interfaces:
- AttributeSet
 - Enclosing class:
- StyleContext
 
 public class StyleContext.SmallAttributeSet extends Object implements AttributeSet 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.
- 
- 
Nested Class Summary- 
Nested classes/interfaces declared in interface javax.swing.text.AttributeSetAttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttribute
 
- 
 - 
Field Summary- 
Fields declared in interface javax.swing.text.AttributeSetNameAttribute, ResolveAttribute
 
- 
 - 
Constructor SummaryConstructors Constructor Description SmallAttributeSet(Object[] attributes)Constructs a SmallAttributeSet.SmallAttributeSet(AttributeSet attrs)Constructs a SmallAttributeSet.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()Clones a set of attributes.booleancontainsAttribute(Object name, Object value)Checks whether a given attribute name/value is defined.booleancontainsAttributes(AttributeSet attrs)Checks whether the attribute set contains all of the given attributes.AttributeSetcopyAttributes()Copies a set of attributes.booleanequals(Object obj)Compares this object to the specified object.ObjectgetAttribute(Object key)Gets the value of an attribute.intgetAttributeCount()Gets the number of attributes that are defined.Enumeration<?>getAttributeNames()Gets the names of all attributes.AttributeSetgetResolveParent()If not overriden, the resolving parent defaults to the parent element.inthashCode()Returns a hashcode for this set of attributes.booleanisDefined(Object key)Checks whether a given attribute is defined.booleanisEqual(AttributeSet attr)Checks whether two attribute sets are equal.StringtoString()Returns a string showing the key/value pairs.
 
- 
- 
- 
Constructor Detail- 
SmallAttributeSetpublic SmallAttributeSet(Object[] attributes) Constructs a SmallAttributeSet.- Parameters:
- attributes- the attributes
 
 - 
SmallAttributeSetpublic SmallAttributeSet(AttributeSet attrs) Constructs a SmallAttributeSet.- Parameters:
- attrs- the attributes
 
 
- 
 - 
Method Detail- 
toStringpublic String toString() Returns a string showing the key/value pairs.
 - 
hashCodepublic int hashCode() Returns a hashcode for this set of attributes.- Overrides:
- hashCodein class- Object
- Returns:
- a hashcode value for this set of attributes.
- See Also:
- Object.equals(java.lang.Object),- System.identityHashCode(java.lang.Object)
 
 - 
equalspublic boolean equals(Object obj) Compares this object to the specified object. The result istrueif the object is an equivalent set of attributes.- Overrides:
- equalsin class- Object
- Parameters:
- obj- the object to compare with.
- Returns:
- trueif the objects are equal;- falseotherwise.
- See Also:
- Object.hashCode(),- HashMap
 
 - 
clonepublic Object clone() Clones a set of attributes. Since the set is immutable, a clone is basically the same set.
 - 
getAttributeCountpublic int getAttributeCount() Gets the number of attributes that are defined.- Specified by:
- getAttributeCountin interface- AttributeSet
- Returns:
- the number of attributes
- See Also:
- AttributeSet.getAttributeCount()
 
 - 
isDefinedpublic boolean isDefined(Object key) Checks whether a given attribute is defined.- Specified by:
- isDefinedin interface- AttributeSet
- Parameters:
- key- the attribute key
- Returns:
- true if the attribute is defined
- See Also:
- AttributeSet.isDefined(java.lang.Object)
 
 - 
isEqualpublic boolean isEqual(AttributeSet attr) Checks whether two attribute sets are equal.- Specified by:
- isEqualin interface- AttributeSet
- Parameters:
- attr- the attribute set to check against
- Returns:
- true if the same
- See Also:
- AttributeSet.isEqual(javax.swing.text.AttributeSet)
 
 - 
copyAttributespublic AttributeSet copyAttributes() Copies a set of attributes.- Specified by:
- copyAttributesin interface- AttributeSet
- Returns:
- the copy
- See Also:
- AttributeSet.copyAttributes()
 
 - 
getAttributepublic Object getAttribute(Object key) Gets the value of an attribute.- Specified by:
- getAttributein interface- AttributeSet
- Parameters:
- key- the attribute name
- Returns:
- the attribute value
- See Also:
- AttributeSet.getAttribute(java.lang.Object)
 
 - 
getAttributeNamespublic Enumeration<?> getAttributeNames() Gets the names of all attributes.- Specified by:
- getAttributeNamesin interface- AttributeSet
- Returns:
- the attribute names
- See Also:
- AttributeSet.getAttributeNames()
 
 - 
containsAttributepublic boolean containsAttribute(Object name, Object value) Checks whether a given attribute name/value is defined.- Specified by:
- containsAttributein interface- AttributeSet
- Parameters:
- name- the attribute name
- value- the attribute value
- Returns:
- true if the name/value is defined
- See Also:
- AttributeSet.containsAttribute(java.lang.Object, java.lang.Object)
 
 - 
containsAttributespublic boolean containsAttributes(AttributeSet attrs) Checks whether the attribute set contains all of the given attributes.- Specified by:
- containsAttributesin interface- AttributeSet
- Parameters:
- attrs- the attributes to check
- Returns:
- true if the element contains all the attributes
- See Also:
- AttributeSet.containsAttributes(javax.swing.text.AttributeSet)
 
 - 
getResolveParentpublic AttributeSet getResolveParent() If not overriden, the resolving parent defaults to the parent element.- Specified by:
- getResolveParentin interface- AttributeSet
- Returns:
- the attributes from the parent
- See Also:
- AttributeSet.getResolveParent()
 
 
- 
 
-