|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pf.util.AssociationList
org.pf.util.NamedValueList
public class NamedValueList
A container that holds a collection of NamedValue objects.
| Field Summary | |
|---|---|
static NamedValue[] |
EMPTY_NAMED_VALUE_ARRAY
|
| Fields inherited from class org.pf.util.AssociationList |
|---|
EMPTY_ASSOCIATION_ARRAY |
| Constructor Summary | |
|---|---|
NamedValueList()
Initialize the new instance with default values. |
|
NamedValueList(java.util.Map map)
Initialize the new instance with values from the given map. |
|
| Method Summary | |
|---|---|
void |
add(Association association)
Adds the specified association only if it is an instance of NamedValue. |
void |
add(NamedValue namedValue)
Adds the specified named value. |
void |
add(java.lang.Object key,
java.lang.Object value)
Adds the specified key and value as new association. |
void |
add(java.lang.String name,
java.lang.Object value)
Adds the specified name and value as new NamedValue. |
void |
addAll(NamedValue[] namedValues)
Adds all named value elements of the given array to the list. |
boolean |
containsName(java.lang.String name)
Returns true if this list contains an entry with the given name (case-sensitive) |
NamedValue |
findNamedValue(java.lang.String name)
Returns the first named value with the specified name or null if none can be found. |
java.lang.String |
nameAt(int index)
Returns the name (key) of the named value at the specified index. |
NamedValue[] |
namedValueArray()
Returns all named values as an array |
NamedValue[] |
namedValueArray(IObjectFilter filter)
Returns an array of all those elements contained in this list that match the given filter. |
NamedValue |
namedValueAt(int index)
Returns the named value at the specified index. |
java.util.List |
names()
Returns all names in this list |
NamedValue |
remove(java.lang.String name)
Remove the NamedValue identified by the given name. |
void |
setNamedValueAt(int index,
NamedValue namedValue)
Puts the given named value at the specified index. |
void |
sort()
Sorts the elments in this list by name in ascending order. |
void |
sort(boolean ascending)
Sorts the elments in this list by name. |
java.lang.Object |
valueAt(java.lang.String name)
Returns the value associated with the specified name or null if the name cannot be found. |
| Methods inherited from class org.pf.util.AssociationList |
|---|
addAll, addAll, addAllToMap, asHashMap, asHashtable, asList, associationArray, associationArray, associationAt, clear, containsKey, findAssociation, indexOf, isEmpty, keyAt, keys, processEach, put, put, putAll, putAll, remove, remove, removeAll, removeKey, setAssociationAt, size, valueAt, valueAt, values |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final NamedValue[] EMPTY_NAMED_VALUE_ARRAY
| Constructor Detail |
|---|
public NamedValueList()
public NamedValueList(java.util.Map map)
| Method Detail |
|---|
public void add(NamedValue namedValue)
namedValue - The named value to add (must not be null!)public void add(Association association)
add in class AssociationListassociation - The association to add (must not be null!)
public void add(java.lang.Object key,
java.lang.Object value)
add in class AssociationListkey - The key of the association to addvalue - The value of the association to add
public void add(java.lang.String name,
java.lang.Object value)
name - The name of the named value to addvalue - The value of the named value to addpublic void addAll(NamedValue[] namedValues)
namedValues - The values to addpublic NamedValue[] namedValueArray()
public NamedValue[] namedValueArray(IObjectFilter filter)
filter - The filter that determines which elements to return in the result array
public NamedValue namedValueAt(int index)
index - The index of the NamedValue
public void setNamedValueAt(int index,
NamedValue namedValue)
index - The index where to put the namedValuenamedValue - The named value object to be put at the given index
java.lang.IndexOutOfBoundsException - if the index is out of rangepublic java.lang.String nameAt(int index)
index - The index of the NamedValuepublic NamedValue findNamedValue(java.lang.String name)
name - The name of the named value to look forpublic boolean containsName(java.lang.String name)
public void sort()
public void sort(boolean ascending)
ascending - If true, elements will be sorted in ascending order. Otherwise in descending order.public java.lang.Object valueAt(java.lang.String name)
name - The identifier for the desired valuepublic NamedValue remove(java.lang.String name)
public java.util.List names()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||