public abstract class VCardParameters.VCardParameterList<T> extends AbstractList<T>
A list that converts the raw string values of a parameter to another kind of value (for example, Integers).
This list is backed by the VCardParameters
object. Any changes
made to the list will affect the VCardParameters
object and vice
versa.
If a String value cannot be converted to the appropriate data type, an
IllegalStateException
is thrown.
Modifier and Type | Field and Description |
---|---|
protected String |
parameterName |
protected List<String> |
parameterValues |
modCount
Constructor and Description |
---|
VCardParameterList(String parameterName) |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
_asObject(String value)
Converts a String value to its object form.
|
protected abstract String |
_asString(T value)
Converts the object to a String value for storing in the
VCardParameters object. |
protected IllegalStateException |
_exception(String value,
Exception thrown)
Creates the exception that is thrown when the raw string value cannot
be parsed into its object form.
|
void |
add(int index,
T value) |
T |
get(int index) |
T |
remove(int index) |
T |
set(int index,
T value) |
int |
size() |
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
parallelStream, removeIf, stream
protected final String parameterName
protected final List<String> parameterValues
public VCardParameterList(String parameterName)
parameterName
- the name of the parameter (case insensitive)public int size()
size
in interface Collection<T>
size
in interface List<T>
size
in class AbstractCollection<T>
protected abstract String _asString(T value)
VCardParameters
object.value
- the valueprotected abstract T _asObject(String value) throws Exception
value
- the string valueException
- if there is a problem parsing the stringprotected IllegalStateException _exception(String value, Exception thrown)
value
- the raw string valuethrown
- the thrown exceptionCopyright © 2012–2023 Michael Angstadt. All rights reserved.