net.wimpi.pim.contact.basicimpl
Class ExtensionsImpl

java.lang.Object
  |
  +--net.wimpi.pim.contact.basicimpl.ExtensionsImpl
All Implemented Interfaces:
Extensions, java.io.Serializable

public class ExtensionsImpl
extends java.lang.Object
implements Extensions

A basic and simple implementation of the Extensions.

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

Field Summary
protected  java.util.Map m_Extensions
           
 
Constructor Summary
ExtensionsImpl()
           
 
Method Summary
 void add(Extension ext)
          Adds an extension to this Extensions collection.
 Extension get(java.lang.String xidentifier)
          Returns the extension with the given identifier.
 Extension get(java.lang.String xidentifier, int idx)
          Returns the extension with the given identifier and the given index.
 java.util.Iterator iterator(java.lang.String xidentifier)
          Returns an iterator over all elements of this Extensions collection with a given identifier.
 Extension[] list(java.lang.String xidentifier)
          Returns a list of extensions with the given identifier.
 java.lang.String[] listIdentifiers()
          Returns a list identifiers of all extensions in this Extensions collection.
 void remove(Extension ext)
          Removes the given extension from this Extensions collection.
 void remove(java.lang.String xidentifier)
          Removes all extensions with the given identifier from this Extensions collection.
 Extension remove(java.lang.String xidentifier, int idx)
          Removes the extension with the given identifier and index from this Extensions collection.
 int size()
          Returns the total number of extensions associated with this Extensions collection.
 int size(java.lang.String xidentifier)
          Returns the number of extensions associated with this Extensions collection with a given identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_Extensions

protected java.util.Map m_Extensions
Constructor Detail

ExtensionsImpl

public ExtensionsImpl()
Method Detail

listIdentifiers

public java.lang.String[] listIdentifiers()
Description copied from interface: Extensions
Returns a list identifiers of all extensions in this Extensions collection.

Specified by:
listIdentifiers in interface Extensions
Returns:
the list of identifiers as String[].

list

public Extension[] list(java.lang.String xidentifier)
Description copied from interface: Extensions
Returns a list of extensions with the given identifier.

Specified by:
list in interface Extensions
Parameters:
xidentifier - an identifier as String.
Returns:
the list as Extension[].

iterator

public java.util.Iterator iterator(java.lang.String xidentifier)
Description copied from interface: Extensions
Returns an iterator over all elements of this Extensions collection with a given identifier.

Specified by:
iterator in interface Extensions
Parameters:
xidentifier - an identifier as String.
Returns:
an Iterator over all Extension instances.

get

public Extension get(java.lang.String xidentifier)
Description copied from interface: Extensions
Returns the extension with the given identifier. Note that this is a convenience method, which will return the first extension with the given identifier from the collection.

Specified by:
get in interface Extensions
Parameters:
xidentifier - an identifier as String.
Returns:
the Extension instance.

get

public Extension get(java.lang.String xidentifier,
                     int idx)
              throws java.lang.IndexOutOfBoundsException
Description copied from interface: Extensions
Returns the extension with the given identifier and the given index.

Specified by:
get in interface Extensions
Parameters:
xidentifier - an identifier as String.
idx - the index as int.
Returns:
the Extension instance.
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of bounds.

add

public void add(Extension ext)
Description copied from interface: Extensions
Adds an extension to this Extensions collection.

Specified by:
add in interface Extensions
Parameters:
ext - the Extension to be added.

remove

public void remove(Extension ext)
Description copied from interface: Extensions
Removes the given extension from this Extensions collection.

Specified by:
remove in interface Extensions
Parameters:
ext - the extension as Extension instance.

remove

public void remove(java.lang.String xidentifier)
Description copied from interface: Extensions
Removes all extensions with the given identifier from this Extensions collection.

Specified by:
remove in interface Extensions
Parameters:
xidentifier - an identifier as String.

remove

public Extension remove(java.lang.String xidentifier,
                        int idx)
                 throws java.lang.IndexOutOfBoundsException
Description copied from interface: Extensions
Removes the extension with the given identifier and index from this Extensions collection.

Specified by:
remove in interface Extensions
Parameters:
xidentifier - an identifier as String.
idx - the index as int.
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of bounds.

size

public int size()
Description copied from interface: Extensions
Returns the total number of extensions associated with this Extensions collection.

Specified by:
size in interface Extensions
Returns:
the number as int.

size

public int size(java.lang.String xidentifier)
Description copied from interface: Extensions
Returns the number of extensions associated with this Extensions collection with a given identifier.

Specified by:
size in interface Extensions
Parameters:
xidentifier - an identifier as String.
Returns:
the number as int.


Copyright © 2001-2003 jpim team.