net.wimpi.pim.contact.db
Interface ContactGroupCollection

All Known Implementing Classes:
ContactGroupCollectionImpl

public interface ContactGroupCollection

Interface modeling a ContactGroupCollection.

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

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

Method Detail

contains

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

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

contains

public boolean contains(ContactGroup group)
Tests if this ContactGroupCollection contains a given contact group.

Parameters:
group - the group as ContactGroup.
Returns:
true if contains group, false otherwise.

containsByName

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

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

get

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

Parameters:
UID - the unique identifier of a group as String.
Returns:
the group as ContactGroup.

getByName

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

Parameters:
name - the name of the group as String.
Returns:
the group as ContactGroup.

toArray

public ContactGroup[] toArray()
Returns all contact groups in this ContactGroupCollection.

Returns:
the list of groups as ContactGroup[].

toArray

public ContactGroup[] toArray(ContactGroupFilter filter)
Returns all contact groups in this ContactGroupCollection, that pass the given filter.

Parameters:
filter - the filter as ContactGroupFilter.
Returns:
the list of contacts as ContactGroup[].

add

public boolean add(ContactGroup group)
Adds a given contact group to this ContactGroupCollection. Contact groups should have unique names, thus, when adding a group with an existing name, this method should not add the group and return false.

Parameters:
group - the contact group as ContactGroup.
Returns:
true if successful, false otherwise.

remove

public ContactGroup remove(java.lang.String UID)
Removes a given contact group from this ContactGroupCollection.

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

remove

public void remove(ContactGroup group)
Removes a given contact group from this ContactGroupCollection.

Parameters:
group - the contact group as ContactGroup.

iterator

public java.util.Iterator iterator()
Returns an iterator over all groups in this ContactGroupCollection.

Returns:
an ,tt>Iterator instance.

iterator

public java.util.Iterator iterator(ContactGroupFilter filter)
Returns an iterator over all contact groups in this ContactGroupCollection, that pass the given filter.

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

size

public int size()
Returns the number of groups in this ContactGroupCollection.

Returns:
the number of groups as int.


Copyright © 2001-2003 jpim team.