net.wimpi.pim.contact.db
Interface ContactCollection

All Known Implementing Classes:
ContactCollectionImpl

public interface ContactCollection

Interface modeling a ContactCollection.

Version:
0.1 (22/07/2003)
Author:
Dieter Wimberger (wimpi)

Method Summary
 void add(Contact contact)
          Adds a given contact to this ContactCollection.
 boolean contains(Contact contact)
          Tests if this ContactCollection contains a given contact.
 boolean contains(java.lang.String UID)
          Tests if this ContactCollection contains a given contact.
 boolean containsByName(java.lang.String name)
          Tests if this ContactCollection contains a contact with the given name.
 Contact get(java.lang.String UID)
          Returns the Contact instance for a given unique identifier.
 Contact getByName(java.lang.String name)
          Returns the Contact instance with a given name.
 java.util.Iterator iterator()
          Returns an iterator over all contacts in this ContactCollection.
 java.util.Iterator iterator(ContactFilter filter)
          Returns an iterator over all contacts in this ContactCollection, that pass the given filter.
 void remove(Contact contact)
          Removes a given contact from this ContactCollection.
 Contact remove(java.lang.String UID)
          Removes a given contact from this ContactCollection.
 int size()
          Returns the number of contacts in this ContactCollection.
 Contact[] toArray()
          Returns all contacts in this ContactCollection.
 Contact[] toArray(ContactFilter filter)
          Returns all contacts in this ContactCollection, that pass the given filter.
 

Method Detail

contains

public boolean contains(java.lang.String UID)
Tests if this ContactCollection contains a given contact.

Parameters:
UID - the unique identifier of the contact as String.
Returns:
true if contains contact, false otherwise.

contains

public boolean contains(Contact contact)
Tests if this ContactCollection contains a given contact.

Parameters:
contact - the contact as Contact.
Returns:
true if contains contact, false otherwise.

containsByName

public boolean containsByName(java.lang.String name)
Tests if this ContactCollection contains a contact with the given name.

Parameters:
name - the formatted name of the contact as String.
Returns:
true if contains contact, false otherwise.

get

public Contact get(java.lang.String UID)
Returns the Contact instance for a given unique identifier.

Parameters:
UID - the unique identifier of a contact as String.
Returns:
the contact as Contact.

getByName

public Contact getByName(java.lang.String name)
Returns the Contact instance with a given name.

Parameters:
name - the formatted name of the contact as String.
Returns:
the contact as Contact.

toArray

public Contact[] toArray()
Returns all contacts in this ContactCollection.

Returns:
the list of contacts as Contact[].

toArray

public Contact[] toArray(ContactFilter filter)
Returns all contacts in this ContactCollection, that pass the given filter.

Parameters:
filter - the filter as ContactFilter.
Returns:
the list of contacts as Contact[].

add

public void add(Contact contact)
Adds a given contact to this ContactCollection.

Parameters:
contact - the contact as Contact.

remove

public Contact remove(java.lang.String UID)
Removes a given contact from this ContactCollection.

Parameters:
UID - the unique identifier of a contact as String.
Returns:
the removed Contact instance, or null otherwise.

remove

public void remove(Contact contact)
Removes a given contact from this ContactCollection.

Parameters:
contact - the contact as Contact.

iterator

public java.util.Iterator iterator()
Returns an iterator over all contacts in this ContactCollection.

Returns:
an Iterator instance.

iterator

public java.util.Iterator iterator(ContactFilter filter)
Returns an iterator over all contacts in this ContactCollection, that pass the given filter.

Parameters:
filter - the filter as ContactFilter.
Returns:
an Iterator instance.

size

public int size()
Returns the number of contacts in this ContactCollection.

Returns:
the number of contacts as int.


Copyright © 2001-2003 jpim team.