Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Swing 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.swing.text
Class StyleContext.SmallAttributeSet

    java.lang.Object
      |
      +--javax.swing.text.StyleContext.SmallAttributeSet

public class StyleContext.SmallAttributeSet
extends java.lang.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.

Constructor Summary
`StyleContext.SmallAttributeSet(AttributeSet attrs)`
`StyleContext.SmallAttributeSet(java.lang.Object[] attributes)`

Method Summary
`java.lang.Object` | `clone()` Clones a set of attributes.
`boolean` | `containsAttribute(java.lang.Object name, java.lang.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(java.lang.Object obj)` Compares this object to the specifed object.
`java.lang.Object` | `getAttribute(java.lang.Object key)` Gets the value of an attribute.
`int` | `getAttributeCount()` Gets the number of attributes that are defined.
`java.util.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(java.lang.Object key)` Checks whether a given attribute is defined.
`boolean` | `isEqual(AttributeSet attr)` Checks whether two attribute sets are equal.
`java.lang.String` | `toString()` Returns a string showing the key/value pairs

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### StyleContext.SmallAttributeSet

    public StyleContext.SmallAttributeSet(java.lang.Object[] attributes)

### StyleContext.SmallAttributeSet

    public StyleContext.SmallAttributeSet(AttributeSet attrs)

Method Detail

### toString

    public java.lang.String toString()

  Returns a string showing the key/value pairs
  Overrides:
    toString in class java.lang.Object

### hashCode

    public int hashCode()

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

### equals

    public boolean equals(java.lang.Object obj)

  Compares this object to the specifed object. The result is `true` if and only if the argument is not `null` and is a `Font` object with the same name, style, and point size as this font.
  Parameters:
    `obj` - the object to compare this font with.
  Returns:
    `true` if the objects are equal; `false` otherwise.
  Overrides:
    equals in class java.lang.Object

### clone

    public java.lang.Object clone()

  Clones a set of attributes. Since the set is immutable, a clone is basically the same set.
  Returns:
    the set of attributes
  Overrides:
    clone in class java.lang.Object

### getAttributeCount

    public int getAttributeCount()

  Gets the number of attributes that are defined.
  Specified by:
    getAttributeCount in interface AttributeSet
  Returns:
    the number of attributes
  See Also:
    `AttributeSet.getAttributeCount()`

### isDefined

    public boolean isDefined(java.lang.Object key)

  Checks whether a given attribute is defined.
  Specified by:
    isDefined in interface AttributeSet
  Parameters:
    `key` - the attribute key
  Returns:
    true if the attribute is defined
  See Also:
    `AttributeSet.isDefined(java.lang.Object)`

### isEqual

    public boolean isEqual(AttributeSet attr)

  Checks whether two attribute sets are equal.
  Specified by:
    isEqual in interface AttributeSet
  Parameters:
    `attr` - the attribute set to check against
  Returns:
    true if the same
  See Also:
    `AttributeSet.isEqual(javax.swing.text.AttributeSet)`

### copyAttributes

    public AttributeSet copyAttributes()

  Copies a set of attributes.
  Specified by:
    copyAttributes in interface AttributeSet
  Returns:
    the copy
  See Also:
    `AttributeSet.copyAttributes()`

### getAttribute

    public java.lang.Object getAttribute(java.lang.Object key)

  Gets the value of an attribute.
  Specified by:
    getAttribute in interface AttributeSet
  Parameters:
    `key` - the attribute name
  Returns:
    the attribute value
  See Also:
    `AttributeSet.getAttribute(java.lang.Object)`

### getAttributeNames

    public java.util.Enumeration getAttributeNames()

  Gets the names of all attributes.
  Specified by:
    getAttributeNames in interface AttributeSet
  Returns:
    the attribute names
  See Also:
    `AttributeSet.getAttributeNames()`

### containsAttribute

    public boolean containsAttribute(java.lang.Object name,
                                     java.lang.Object value)

  Checks whether a given attribute name/value is defined.
  Specified by:
    containsAttribute in 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)`

### containsAttributes

    public boolean containsAttributes(AttributeSet attrs)

  Checks whether the attribute set contains all of the given attributes.
  Specified by:
    containsAttributes in 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)`

### getResolveParent

    public AttributeSet getResolveParent()

  If not overriden, the resolving parent defaults to the parent element.
  Specified by:
    getResolveParent in interface AttributeSet
  Returns:
    the attributes from the parent
  See Also:
    `AttributeSet.getResolveParent()`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Swing 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Submit a bug or feature
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.