net.wimpi.pim.contact.basicimpl
Class SimpleExtension

java.lang.Object
  |
  +--net.wimpi.pim.contact.basicimpl.GenericExtension
        |
        +--net.wimpi.pim.contact.basicimpl.SimpleExtension
All Implemented Interfaces:
Extension, java.io.Serializable

public class SimpleExtension
extends GenericExtension
implements java.io.Serializable

Class implementing a simple Extension.

This class can be used to handle simple extensions of the type:
X-KIDS: Mary;Joe;Tom

Version:
0.1 (22/07/2003)
Author:
Dieter Wimberger
See Also:
Serialized Form

Field Summary
protected  java.util.List m_Values
           
 
Fields inherited from class net.wimpi.pim.contact.basicimpl.GenericExtension
m_Identifier, m_Parameters, m_Value
 
Constructor Summary
SimpleExtension(java.lang.String identifier)
           
 
Method Summary
 void addValue(java.lang.String value)
          Adds a value to this SimpleExtension.
 GenericExtension createExtension()
          Returns a new SimpleExtension with the same identifier as this SimpleExtension instance.
 java.lang.String getValue()
          Returns the value of this GenericExtension.
 java.lang.String getValue(int index)
          Returns the Value at the given index.
 int getValueCount()
          Returns the number of values associated with this SimpleExtension.
 java.lang.String[] listValues()
          Returns all values of this this SimpleExtension.
 java.lang.String removeValue(int index)
          Removes and returns the value at the given index.
 java.lang.String setValue(int index, java.lang.String value)
          Sets the value at the given index, returning the replaced one.
 void setValue(java.lang.String value)
          Sets the value of this GenericExtension.
 
Methods inherited from class net.wimpi.pim.contact.basicimpl.GenericExtension
getIdentifier, getParameters, getParameterValues, listParameters, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_Values

protected java.util.List m_Values
Constructor Detail

SimpleExtension

public SimpleExtension(java.lang.String identifier)
Method Detail

setValue

public void setValue(java.lang.String value)
Description copied from class: GenericExtension
Sets the value of this GenericExtension.

Overrides:
setValue in class GenericExtension
Parameters:
value - a value as String.

getValue

public java.lang.String getValue()
Description copied from class: GenericExtension
Returns the value of this GenericExtension.

Overrides:
getValue in class GenericExtension
Returns:
the value as String.

listValues

public java.lang.String[] listValues()
Returns all values of this this SimpleExtension.

Returns:
the values as String[].

getValue

public java.lang.String getValue(int index)
                          throws java.lang.IndexOutOfBoundsException
Returns the Value at the given index.

Parameters:
index - the index as int.
Returns:
the value as String.
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of bounds.

setValue

public java.lang.String setValue(int index,
                                 java.lang.String value)
                          throws java.lang.IndexOutOfBoundsException
Sets the value at the given index, returning the replaced one.

Parameters:
index - the index as int.
value - the value as String.
Returns:
the replaced value as String.
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of bounds.

addValue

public void addValue(java.lang.String value)
Adds a value to this SimpleExtension.

Parameters:
value - the value as String.

removeValue

public java.lang.String removeValue(int index)
                             throws java.lang.IndexOutOfBoundsException
Removes and returns the value at the given index.

Parameters:
index - the index as int.
Returns:
the removed value as String.
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of bounds.

getValueCount

public int getValueCount()
Returns the number of values associated with this SimpleExtension.

Returns:
the number as int.

createExtension

public GenericExtension createExtension()
Returns a new SimpleExtension with the same identifier as this SimpleExtension instance.

Specified by:
createExtension in class GenericExtension
Returns:
a new SimpleExtension instance.


Copyright © 2001-2003 jpim team.