net.wimpi.pim.contact.model
Interface Extensions

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
ExtensionsImpl

public interface Extensions
extends java.io.Serializable

Interface modeling a collection of extensions.

Version:
(created Mar 18, 2003)
Author:
Dieter Wimberger (wimpi)

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.
 

Method Detail

listIdentifiers

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

Returns:
the list of identifiers as String[].

iterator

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

Parameters:
xidentifier - an identifier as String.
Returns:
an Iterator over all Extension instances.

list

public Extension[] list(java.lang.String xidentifier)
Returns a list of extensions with the given identifier.

Parameters:
xidentifier - an identifier as String.
Returns:
the list as Extension[].

get

public Extension get(java.lang.String xidentifier)
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.

Parameters:
xidentifier - an identifier as String.
Returns:
the Extension instance.

get

public Extension get(java.lang.String xidentifier,
                     int idx)
              throws java.lang.IndexOutOfBoundsException
Returns the extension with the given identifier and the given index.

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)
Adds an extension to this Extensions collection.

Parameters:
ext - the Extension to be added.

remove

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

Parameters:
ext - the extension as Extension instance.

remove

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

Parameters:
xidentifier - an identifier as String.

remove

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

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()
Returns the total number of extensions associated with this Extensions collection.

Returns:
the number as int.

size

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

Parameters:
xidentifier - an identifier as String.
Returns:
the number as int.


Copyright © 2001-2003 jpim team.