public class NamedTextList extends NamedValueList<java.lang.String> implements IConfigSettings
Modifier and Type | Field and Description |
---|---|
static NamedText[] |
EMPTY_NAMED_TEXT_ARRAY |
EMPTY_NAMED_VALUE_ARRAY
EMPTY_ASSOCIATION_ARRAY
Constructor and Description |
---|
NamedTextList()
Initialize the new instance with default values.
|
NamedTextList(java.util.Map<java.lang.String,java.lang.String> map)
Initialize the new instance with values from the given map.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Association<java.lang.String,java.lang.String> 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.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.
|
protected java.lang.Class<NamedText> |
elementClass()
Returns the class all contained elements must be an instance of
Subclasses usually must override this method.
|
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<NamedText> 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.
|
protected Association<java.lang.String,java.lang.String> |
newElement(java.lang.String key,
java.lang.String value) |
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.
|
protected java.lang.Class<java.lang.String> |
valueClass()
Returns the class all contained objects must be an instance of.
|
add, addAll, containsName, findNamedValue, getNames, getValue, keyClass, nameAt, namedValueArray, namedValueArray, namedValueAt, names, remove, setNamedValueAt, sort, sort, valueAt
addAll, addAll, addAll, addAllToMap, addOrPutAll, asHashMap, asHashtable, asList, associationArray, associationArray, associationAt, basicAdd, clear, collectElements, collUtil, containsKey, findAssociation, findValue, getList, indexOf, isCorrectElementType, isCorrectKeyType, isCorrectValueType, isEmpty, isValidAssociation, keyAt, keys, processEach, put, put, putAll, putAll, remove, remove, removeAll, removeKey, setAssociationAt, setList, size, valueAt, values
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getNames, getValue, isEmpty
public static final NamedText[] EMPTY_NAMED_TEXT_ARRAY
public NamedTextList()
public NamedTextList(java.util.Map<java.lang.String,java.lang.String> map)
map
- A containing key/value pairs to be added to the new objectpublic void add(NamedText namedText)
namedText
- The named text to add (must not be null!)public void add(Association<java.lang.String,java.lang.String> association)
add
in class NamedValueList<java.lang.String>
association
- The association to add (must not be null!)public void add(java.lang.String name, java.lang.String text)
add
in class NamedValueList<java.lang.String>
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<NamedText> filter)
filter
- The filter that determines which elements to return in the result arraypublic java.util.Properties asProperties()
public NamedText namedTextAt(int index)
index
- The index of the NamedTextpublic void setNamedTextAt(int index, NamedText namedText)
index
- The index where to put the namedTextnamedText
- The named text object to be put at the given indexjava.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 valueprotected Association<java.lang.String,java.lang.String> newElement(java.lang.String key, java.lang.String value)
newElement
in class NamedValueList<java.lang.String>
protected java.lang.Class<NamedText> elementClass()
elementClass
in class NamedValueList<java.lang.String>
protected java.lang.Class<java.lang.String> valueClass()
valueClass
in class AssociationList<java.lang.String,java.lang.String>