Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.ui
Class AttributeKey

java.lang.Object
  |
  +--oracle.cabo.ui.AttributeKey

public final class AttributeKey
extends java.lang.Object

Key class used to quickly retrieve attribute values from UINodes and AttributeMaps.

AttributeKeys can not be instantiated directly, instead, the factory method getAttributeKey is called with the name of the AttributeKey to retrieve.

AttributeKeys have two performance advantages over Strings when used as keys.

  1. AttributeKeys are singletons and can thus use instance equality to check for equality.
  2. AttributeKeys that are requested often can be assigned an index that can then be used by AttributeMap implementations to speed up value retrieval for these attributes. Both the FlaggedAttributeMap and the IndexedAttributeMap take advantage of this feature.

See Also:
AttributeMap, UINode.getAttributeValue(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.AttributeKey), MutableUINode.setAttributeValue(oracle.cabo.ui.AttributeKey, java.lang.Object)

Method Summary
 boolean equals(java.lang.Object otherObject)
           
 int getAttributeIndex()
          Returns the 0-based index of this AttributeKey, or -1 if the AttributeKey has no index.
static AttributeKey getAttributeKey(java.lang.String attrName)
          Returns an AttributeKey for the given name, creating the AttributeKey instance if necessary.
 java.lang.String getAttributeName()
          Returns the name of this AttributeKey.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getAttributeKey

public static AttributeKey getAttributeKey(java.lang.String attrName)
Returns an AttributeKey for the given name, creating the AttributeKey instance if necessary. This is the only public way to create an AttributeKey.

AttributeKeys created by this method do not have indices.


getAttributeIndex

public int getAttributeIndex()
Returns the 0-based index of this AttributeKey, or -1 if the AttributeKey has no index.

getAttributeName

public java.lang.String getAttributeName()
Returns the name of this AttributeKey. This is the name used to create the AttributeKey in getAttributeKey.

See Also:
getAttributeKey(java.lang.String)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object otherObject)
Overrides:
equals in class java.lang.Object

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

Copyright © 2002,2003, Oracle. All Rights Reserved.