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.
AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttribute
NameAttribute, ResolveAttribute
public SmallAttributeSet(Object[] attributes)
public SmallAttributeSet(AttributeSet attrs)
public String toString()
Returns a string showing the key/value pairs
public int hashCode()
Returns a hashcode for this set of attributes.
hashCode
in class Object
Object.equals(java.lang.Object)
, System.identityHashCode(java.lang.Object)
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.
equals
in class Object
obj
- the object to compare with.true
if the objects are equal; false
otherwise.Object.hashCode()
, HashMap
public Object clone()
Clones a set of attributes. Since the set is immutable, a clone is basically the same set.
public int getAttributeCount()
Gets the number of attributes that are defined.
getAttributeCount
in interface AttributeSet
AttributeSet.getAttributeCount()
public boolean isDefined(Object key)
Checks whether a given attribute is defined.
isDefined
in interface AttributeSet
key
- the attribute keyAttributeSet.isDefined(java.lang.Object)
public boolean isEqual(AttributeSet attr)
Checks whether two attribute sets are equal.
isEqual
in interface AttributeSet
attr
- the attribute set to check againstAttributeSet.isEqual(javax.swing.text.AttributeSet)
public AttributeSet copyAttributes()
Copies a set of attributes.
copyAttributes
in interface AttributeSet
AttributeSet.copyAttributes()
public Object getAttribute(Object key)
Gets the value of an attribute.
getAttribute
in interface AttributeSet
key
- the attribute nameAttributeSet.getAttribute(java.lang.Object)
public Enumeration<?> getAttributeNames()
Gets the names of all attributes.
getAttributeNames
in interface AttributeSet
AttributeSet.getAttributeNames()
public boolean containsAttribute(Object name, Object value)
Checks whether a given attribute name/value is defined.
containsAttribute
in interface AttributeSet
name
- the attribute namevalue
- the attribute valueAttributeSet.containsAttribute(java.lang.Object, java.lang.Object)
public boolean containsAttributes(AttributeSet attrs)
Checks whether the attribute set contains all of the given attributes.
containsAttributes
in interface AttributeSet
attrs
- the attributes to checkAttributeSet.containsAttributes(javax.swing.text.AttributeSet)
public AttributeSet getResolveParent()
If not overriden, the resolving parent defaults to the parent element.
getResolveParent
in interface AttributeSet
AttributeSet.getResolveParent()
© 1993–2017, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.