|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
public interface AssociationListInterface
AssociationListInterface combines the OrderedCollection interface and the DictionaryInterface interface, yielding a collection whose items may be accessed by either an index or a key. Items may be added in order or by an object key, or both. Items added by just key and not index are added to the end of the list. The items and keys Enumerations return items in the implicit order. Since this interface implements the collection interface, key/value pairs may be added multiple times. There is an ordered collection bias to this object; it's treated as an ordered collection that supports keys, rather than a dictionary that supports ordering.
| Method Summary | |
|---|---|
abstract void |
add(int index,
java.lang.Object key,
java.lang.Object item)
Add an item into this association list at the specified index. |
abstract void |
applyToPairs(com.sas.util.ApplyInterface action)
Applies an action to all key/value pairs in the association list. |
abstract java.lang.Object |
clone()
Clone the object. |
abstract java.lang.Object |
get(java.lang.Object key,
int index)
Fetch the item corresponding to a key, starting at a specific location. |
abstract java.lang.Object |
getKey(int index)
Get the key corresponding to a position. |
abstract java.lang.Object |
getKey(java.lang.Object item,
int start)
Get the key corresponding to an item. |
abstract java.util.Enumeration |
getPairs()
Returns an enumeration of all the key/value pairs from an association list. |
abstract java.util.Enumeration |
getPairs(int start,
int end)
Returns an enumeration of the key/value item pairs from an association list. |
abstract void |
removeAllAt(java.lang.Object key)
Remove all items with the specified key. |
abstract void |
set(int index,
java.lang.Object key,
java.lang.Object item)
Put an item into this association list, replacing a previous item that was there by the same index/key (although such behavior is defined by the implementation). |
abstract void |
setKey(int index,
java.lang.Object key)
Set the key corresponding to a position. |
| Methods inherited from interface com.sas.collection.OrderedCollectionInterface |
|---|
add, addItems, removeAt, set, setSize |
| Methods inherited from interface com.sas.collection.StaticOrderedCollectionInterface |
|---|
equals, getIndex, getItems, getLastIndex |
| Methods inherited from interface com.sas.util.IndexedGetInterface |
|---|
get |
| Methods inherited from interface com.sas.collection.Sortable |
|---|
sort, sort |
| Methods inherited from interface com.sas.collection.DictionaryInterface |
|---|
remove, removeAt, set |
| Methods inherited from interface com.sas.collection.StaticDictionaryInterface |
|---|
containsKey, get, getKey, getKeys, getKeys |
| Methods inherited from interface com.sas.collection.CollectionInterface |
|---|
add, addItems, removeAll, removeAll |
| Methods inherited from interface com.sas.collection.StaticCollectionInterface |
|---|
apply, contains |
| Methods inherited from interface com.sas.collection.ContentsChangedSource |
|---|
addContentsChangedListener, removeContentsChangedListener |
| Methods inherited from interface com.sas.beans.PropertyChangeSource |
|---|
addPropertyChangeListener, removePropertyChangeListener |
| Methods inherited from interface com.sas.util.Countable |
|---|
count |
| Methods inherited from interface com.sas.util.Enumerable |
|---|
getItems |
| Method Detail |
|---|
java.util.Enumeration getPairs()
getPairs(0, count())
In each returned Pair, pair.getFirst() is the key; pair.getSecond()
is the value
java.util.Enumeration getPairs(int start,
int end)
start - the index of the first item, zero based.end - one past the index of the last item to include in the enumeration, zero based.
pair.getFirst() is the key; pair.getSecond()
is the value
java.lang.IndexOutOfBoundsException - if start
is not in the range [0, count()-1], or start >last
or end is not in the range [0, count()]Pairvoid applyToPairs(com.sas.util.ApplyInterface action)
action - An object that provides a function which takes an
object as an argument and then does something to it.
action.apply(pair) is excecuted on successive key/value pairs until all pairs in the
this association list have been operated on, or until the method
returns ApplyInterface.ABORTPair
void set(int index,
java.lang.Object key,
java.lang.Object item)
index - where in the implicit order to store the item.key - the key by which the item may be retrieved later.item - the value to put into this association list
void add(int index,
java.lang.Object key,
java.lang.Object item)
get(index) and getKey(index)
index - where in the implicit order to insert the item.key - the key by which the item may be retrieved later.item - the value to put into this association list
java.lang.Object getKey(java.lang.Object item,
int start)
item - the item whose key you wish to find.start - the index of where to start searching
java.lang.Object getKey(int index)
index - return the key corresponding to this index
java.lang.IndexOutOfBoundsException - if index
is not in the range [0, count()-1]
void setKey(int index,
java.lang.Object key)
index - replace the key at this indexkey - the new key
java.lang.IndexOutOfBoundsException - if index
is not in the range [0, count()-1]
java.lang.Object get(java.lang.Object key,
int index)
key - the Object key with which the item was added to this association listindex - start searching for the key at this index
NoSuchElementException - when there is no entry for
the specified key. (Note that null
is a valid value for a key.)
java.lang.IndexOutOfBoundsException - if
if the index is invalidStaticDictionaryInterface.get(java.lang.Object),
IndexedGetInterface.get(int)void removeAllAt(java.lang.Object key)
key - remove all items with this key.
java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface CollectionInterfaceclone in interface DictionaryInterfaceclone in interface OrderedCollectionInterfaceclone in interface com.sas.PublicClonableclone in interface StaticCollectionInterfaceclone in interface StaticDictionaryInterfaceclone in interface StaticOrderedCollectionInterfacejava.lang.CloneNotSupportedException - if the object could not be cloned.
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||