|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pf.util.AssociationList
public class AssociationList
A container that holds a collection of Association objects. No null values are allowed. Neither for association keys nor for association values.
| Field Summary | |
|---|---|
static Association[] |
EMPTY_ASSOCIATION_ARRAY
|
| Constructor Summary | |
|---|---|
AssociationList()
Initialize the new instance with default values. |
|
AssociationList(java.util.Map map)
Initialize the new instance with values from the given map. |
|
| Method Summary | |
|---|---|
void |
add(Association association)
Adds the specified association. |
void |
add(java.lang.Object key,
java.lang.Object value)
Adds the specified key and value as new association. |
void |
addAll(Association[] associations)
Adds all association elements of the given array to the list. |
void |
addAll(java.util.Map map)
Add all entries of the specified map as associations |
java.util.Map |
addAllToMap(java.util.Map map)
Returns the given map object with all associations added to it. |
java.util.HashMap |
asHashMap()
Returns all associations transformed to a HashMap where the association keys became the map keys and the association values became the map values. |
java.util.Hashtable |
asHashtable()
Returns all associations transformed to a Hashtable where the association keys became the map keys and the association values became the map values. |
java.util.List |
asList()
Returns all associations as list |
Association[] |
associationArray()
Returns all associations as an array |
Association[] |
associationArray(IObjectFilter filter)
Returns an array of all those elements contained in this list that match the given filter. |
Association |
associationAt(int index)
Returns the association at the specified index. |
void |
clear()
Removes all association from the list. |
boolean |
containsKey(java.lang.Object key)
Returns true if the given key is in the list |
Association |
findAssociation(java.lang.Object key)
Returns the association with the given key or null if the key can't be found. |
int |
indexOf(java.lang.Object key)
Returns the index of the given key or -1 if the key can't be found. |
boolean |
isEmpty()
Returns true if this list has no elements |
java.lang.Object |
keyAt(int index)
Returns the key of the association at the specified index. |
java.util.List |
keys()
Returns all values that are currently stored (might contain duplicates) |
void |
processEach(IObjectProcessor associationProcessor)
Calls the given associationProcessor once for each association in this list. |
void |
put(Association association)
Adds the specified association. |
void |
put(java.lang.Object key,
java.lang.Object value)
Puts the given value under the specified key. |
void |
putAll(Association[] associations)
Adds all association elements of the given array to the list. |
void |
putAll(java.util.Map map)
Puts all key-value pairs of the given map to the list. |
boolean |
remove(Association association)
Removes the given association from this list. |
Association |
remove(int index)
Removes the association at the given index. |
void |
removeAll(java.util.Collection assocCollection)
Removes all association that are contained in the given collection. |
Association |
removeKey(java.lang.Object key)
Removes the association with the given key. |
void |
setAssociationAt(int index,
Association associaction)
Puts the given association at the specified index. |
int |
size()
Returns the number of associations in this list |
java.lang.Object |
valueAt(int index)
Returns the value of the association at the specified index. |
java.lang.Object |
valueAt(java.lang.Object key)
Returns the value associated with the specified key or null if the key cannot be found. |
java.util.List |
values()
Returns all values that are currently stored (might contain dublicates) |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Association[] EMPTY_ASSOCIATION_ARRAY
| Constructor Detail |
|---|
public AssociationList()
public AssociationList(java.util.Map map)
| Method Detail |
|---|
public void clear()
public int size()
public boolean isEmpty()
public void add(Association association)
association - The association to add (must not be null!)
public void add(java.lang.Object key,
java.lang.Object value)
key - The key of the association to addvalue - The value of the association to addpublic void addAll(java.util.Map map)
map - The map that contains all the key/value pairs to addpublic void addAll(Association[] associations)
associations - The associations to addpublic Association[] associationArray()
public Association[] associationArray(IObjectFilter filter)
filter - The filter that determines which elements to return in the result array
public java.util.List asList()
public java.util.Hashtable asHashtable()
public java.util.HashMap asHashMap()
public java.util.Map addAllToMap(java.util.Map map)
map - A valid map objectpublic void processEach(IObjectProcessor associationProcessor)
associationProcessor - The processor to be called for each associationpublic Association associationAt(int index)
index - The index of the Association
public void setAssociationAt(int index,
Association associaction)
index - The index of the association to setassociaction - The association to put at the given index
java.lang.IndexOutOfBoundsException - if the index is out of rangepublic java.lang.Object keyAt(int index)
index - The index of the Associationpublic java.lang.Object valueAt(int index)
index - The index of the Associationpublic java.lang.Object valueAt(java.lang.Object key)
key - The identifier for the desired valuepublic Association findAssociation(java.lang.Object key)
key - The key to identify the associationpublic boolean remove(Association association)
public Association remove(int index)
public Association removeKey(java.lang.Object key)
public void removeAll(java.util.Collection assocCollection)
public java.util.List values()
public java.util.List keys()
public boolean containsKey(java.lang.Object key)
key - The key to look for
public void put(java.lang.Object key,
java.lang.Object value)
public void put(Association association)
association - The association to add (must not be null!)public void putAll(Association[] associations)
associations - The associations to addpublic void putAll(java.util.Map map)
map - The associations to addpublic int indexOf(java.lang.Object key)
key - The key to look for
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||