com.sas.util.selectors
Class AssociationListSelector

java.lang.Object
  |
  +--com.sas.Component
        |
        +--com.sas.util.selectors.BaseSelector
              |
              +--com.sas.util.selectors.IntegerIndexedSelector
                    |
                    +--com.sas.util.selectors.AssociationListSelector
All Implemented Interfaces:
ComponentInterface, ContentsChangedListener, LinkPropertiesInterface, ModelInterface, MultipleValueEventSourceInterface, com.sas.beans.PropertyChangeSource, SelectorInterface, VetoableChangeSource, ViewInterface

public class AssociationListSelector
extends com.sas.util.selectors.IntegerIndexedSelector

A selector which handles collections which implement AssociationListInterface. This includes AssociationList. The key may be an integer, in which case the selected item is the value alist.get(integerKey()). if the key is not an integer, the selected item is the value alist.get(get())

See Also:
Serialized Form

Field Summary
static String RB_KEY
           
 
Fields inherited from class com.sas.util.selectors.BaseSelector
lastKey, lastValue
 
Constructor Summary
AssociationListSelector()
          Default constructor.
AssociationListSelector(Object collection, Object key)
          Construct an AssociationListSelector for a AssociationList and key
 
Method Summary
static int computeIntegerKey(Object key)
          Convert a key/value into an integer.
static ExtendedBeanInfo getExtendedBeanInfo()
           
 Object getKey(Object value)
          Return the key that corresponds to a value
 Object getValue(int index)
          Get the value of the ith element from the association list.
 Object getValue(Object key)
          Get the value from the association list, based on the key.
 int keyAsInteger(Object value)
          Find the integer key associated with the value
 
Methods inherited from class com.sas.util.selectors.BaseSelector
contentsChanged, firePropertyChange, forgetKey, forgetValue, getCollection, getKey, getValue, isFound, listen, maybeFireKey, maybeFireValue, propertyChange, setCollection, setFound, setKey, setValue, unlisten, update
 
Methods inherited from class com.sas.Component
addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachModel, attachView, beansIsDesignTime, beansSetDesignTime, clone, clone, detachModel, detachView, dumpComponent, firePropertyChange, fireVetoableChange, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getLinkInfo, getModelInterface, getRequiredInterfaces, getResources, getStringResource, getViewInterfaceSupportInfo, initialize, initializeComponent, isDesignTime, isLinked, queryLinks, queryLinks, refresh, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setComponentDescription, setComponentSupportInfo, setDefaultValues, setLinkInfo, setModelInterface, setRequiredInterfaces, setViewInterfaceSupportInfo, supportsListenerInterface, supportsRequiredInterfaces, trapInterfaceEvents, validateObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RB_KEY

public static final String RB_KEY
Constructor Detail

AssociationListSelector

public AssociationListSelector()
Default constructor.

AssociationListSelector

public AssociationListSelector(Object collection,
                               Object key)
Construct an AssociationListSelector for a AssociationList and key
Parameters:
collection - The collection from which elements are selected
key - The key, which should be an Integer or some value from which an integer can be selected
Method Detail

getExtendedBeanInfo

public static ExtendedBeanInfo getExtendedBeanInfo()

getValue

public Object getValue(int index)
Get the value of the ith element from the association list.
Overrides:
getValue in class com.sas.util.selectors.IntegerIndexedSelector
Parameters:
i - the item index
Returns:
the value at aList.get(index)

getValue

public Object getValue(Object key)
Get the value from the association list, based on the key. If the key represents an integer, use getValue(int), else use associationList.get(Object)
Overrides:
getValue in class com.sas.util.selectors.IntegerIndexedSelector
Parameters:
key - The key for the item
Returns:
the corresponding value from the association list.

keyAsInteger

public int keyAsInteger(Object value)
Find the integer key associated with the value
Overrides:
keyAsInteger in class com.sas.util.selectors.IntegerIndexedSelector
Parameters:
value - a value within the association list.
Returns:
the integer index where the value was found.
See Also:
StaticOrderedCollectionInterface.getIndex(Object, int)

getKey

public Object getKey(Object value)
Return the key that corresponds to a value
Overrides:
getKey in class BaseSelector
Following copied from class: com.sas.util.selectors.BaseSelector
Returns:
the selection key.

computeIntegerKey

public static int computeIntegerKey(Object key)
Convert a key/value into an integer.
Parameters:
key - some value
Returns:
int the integer value of the key.
Throws:
IllegalArgumentException - if the key cannot be interpreted as an integer.




Copyright © 2005 SAS Institute Inc. All Rights Reserved.
javadoc generated Thu, 16 Feb 2006 02:31:41