|
|||||||||
| 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
org.pf.util.NamedTextList
public class NamedTextList
A container that holds a collection of NamedText objects.
| Field Summary | |
|---|---|
static NamedText[] |
EMPTY_NAMED_TEXT_ARRAY
|
| Fields inherited from class org.pf.util.NamedValueList |
|---|
EMPTY_NAMED_VALUE_ARRAY |
| Fields inherited from class org.pf.util.AssociationList |
|---|
EMPTY_ASSOCIATION_ARRAY |
| Constructor Summary | |
|---|---|
NamedTextList()
Initialize the new instance with default values. |
|
NamedTextList(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 NamedText. |
void |
add(NamedText namedText)
Adds the specified named text. |
void |
add(java.lang.Object key,
java.lang.Object value)
Adds the specified key and value as new association if both of them are an instance of String. |
void |
add(java.lang.String name,
java.lang.Object value)
Adds the specified name and value as new NamedText if value is an instance of String. |
void |
add(java.lang.String name,
java.lang.String text)
Adds the specified name and text as new NamedText. |
void |
addAll(NamedText[] namedTexts)
Adds all named text elements of the given array to the list. |
java.util.Properties |
asProperties()
Returns all name/text pairs transformed to a Properties object. |
NamedText |
findNamedText(java.lang.String name)
Returns the first named text with the specified name or null if none can be found. |
NamedText[] |
namedTextArray()
Returns all named text pairs as an array |
NamedText[] |
namedTextArray(IObjectFilter filter)
Returns an array of all those elements contained in this list that match the given filter. |
NamedText |
namedTextAt(int index)
Returns the named text at the specified index. |
void |
setNamedTextAt(int index,
NamedText namedText)
Puts the given named text at the specified index. |
java.lang.String |
textAt(int index)
Returns the text (value) at the specified index. |
java.lang.String |
textAt(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.NamedValueList |
|---|
add, addAll, containsName, findNamedValue, nameAt, namedValueArray, namedValueArray, namedValueAt, names, remove, setNamedValueAt, sort, sort, valueAt |
| 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 NamedText[] EMPTY_NAMED_TEXT_ARRAY
| Constructor Detail |
|---|
public NamedTextList()
public NamedTextList(java.util.Map map)
map - A containing key/value pairs to be added to the new object| Method Detail |
|---|
public void add(NamedText namedText)
namedText - The named text to add (must not be null!)public void add(Association association)
add in class NamedValueListassociation - The association to add (must not be null!)
public void add(java.lang.Object key,
java.lang.Object value)
add in class NamedValueListkey - 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)
add in class NamedValueListname - The name of the named value to addvalue - The value of the named value to add
public void add(java.lang.String name,
java.lang.String text)
name - The name of the named text to addtext - The text of the named text to addpublic void addAll(NamedText[] namedTexts)
namedTexts - The named text objects to addpublic NamedText[] namedTextArray()
public NamedText[] namedTextArray(IObjectFilter filter)
filter - The filter that determines which elements to return in the result array
public java.util.Properties asProperties()
public NamedText namedTextAt(int index)
index - The index of the NamedText
public void setNamedTextAt(int index,
NamedText namedText)
index - The index where to put the namedTextnamedText - The named text object to be put at the given index
java.lang.IndexOutOfBoundsException - if the index is out of rangepublic java.lang.String textAt(int index)
index - The index of the NamedTextpublic NamedText findNamedText(java.lang.String name)
name - The name of the named text to look forpublic java.lang.String textAt(java.lang.String name)
name - The identifier for the desired value
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||