corny.addressbook.data
Class MutableMultiValue<T>

java.lang.Object
  extended by corny.addressbook.data.MultiValue<T>
      extended by corny.addressbook.data.MutableMultiValue<T>
Type Parameters:
T - Type of Values in this MultiValue instance
All Implemented Interfaces:
Searchable, java.lang.Iterable<MultiValue.KeyValuePair<T>>

public class MutableMultiValue<T>
extends MultiValue<T>

Data model class for multi value properties of Address Book contacts, like a list of phone numbers. This subclass implements methods to modify the content of the MultiValue instance.

Author:
Corny

Nested Class Summary
 
Nested classes/interfaces inherited from class corny.addressbook.data.MultiValue
MultiValue.KeyValuePair<T>, MultiValue.MultiValueLabel
 
Constructor Summary
MutableMultiValue()
          Creates a new, empty MutableMultiValue instance.
MutableMultiValue(java.util.List<MultiValue.KeyValuePair<T>> pairs)
          Creates a new MutableMultiValue.
 
Method Summary
 void addValue(MultiValue.KeyValuePair<T> value)
          Adds a value to the end of the List
 void addValue(MultiValue.KeyValuePair<T> value, int index)
          Adds a value at the specified index of the list
 java.util.List<MultiValue.KeyValuePair<T>> getValues()
           
 
Methods inherited from class corny.addressbook.data.MultiValue
addSearchStringsToList, equals, getFirstHomeValue, getFirstMobileValue, getFirstValue, getFirstWorkValue, getValues, iterator, mutableClone, size, toString, translateBackwards
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MutableMultiValue

public MutableMultiValue()
Creates a new, empty MutableMultiValue instance.


MutableMultiValue

public MutableMultiValue(java.util.List<MultiValue.KeyValuePair<T>> pairs)
Creates a new MutableMultiValue.

Parameters:
pairs - Pairs of the new MutableMultiValue
Method Detail

getValues

public java.util.List<MultiValue.KeyValuePair<T>> getValues()
Returns:
All KeyValuePairs of this MultiValue instance

addValue

public void addValue(MultiValue.KeyValuePair<T> value)
Adds a value to the end of the List

Parameters:
value - New value

addValue

public void addValue(MultiValue.KeyValuePair<T> value,
                     int index)
Adds a value at the specified index of the list

Parameters:
value - New value
index - List index