net.wimpi.pim.contact.db.serializable
Class ContactCollectionImpl

java.lang.Object
  |
  +--net.wimpi.pim.contact.db.serializable.ContactCollectionImpl
All Implemented Interfaces:
ContactCollection, java.io.Serializable

public class ContactCollectionImpl
extends java.lang.Object
implements ContactCollection, java.io.Serializable

Class representing a serializable ContactCollection. implementation.

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

Nested Class Summary
protected  class ContactCollectionImpl.ContactGroupImpl
           
 
Field Summary
protected  java.util.Map m_Contacts
           
protected  int m_ModCount
           
protected  java.util.Map m_NameIndex
           
 
Constructor Summary
ContactCollectionImpl()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_Contacts

protected java.util.Map m_Contacts

m_NameIndex

protected java.util.Map m_NameIndex

m_ModCount

protected transient int m_ModCount
Constructor Detail

ContactCollectionImpl

public ContactCollectionImpl()
Method Detail

contains

public boolean contains(java.lang.String UID)
Description copied from interface: ContactCollection
Tests if this ContactCollection contains a given contact.

Specified by:
contains in interface ContactCollection
Parameters:
UID - the unique identifier of the contact as String.
Returns:
true if contains contact, false otherwise.

contains

public boolean contains(Contact contact)
Description copied from interface: ContactCollection
Tests if this ContactCollection contains a given contact.

Specified by:
contains in interface ContactCollection
Parameters:
contact - the contact as Contact.
Returns:
true if contains contact, false otherwise.

containsByName

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

Specified by:
containsByName in interface ContactCollection
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)
Description copied from interface: ContactCollection
Returns the Contact instance for a given unique identifier.

Specified by:
get in interface ContactCollection
Parameters:
UID - the unique identifier of a contact as String.
Returns:
the contact as Contact.

getByName

public Contact getByName(java.lang.String name)
Description copied from interface: ContactCollection
Returns the Contact instance with a given name.

Specified by:
getByName in interface ContactCollection
Parameters:
name - the formatted name of the contact as String.
Returns:
the contact as Contact.

toArray

public Contact[] toArray()
Description copied from interface: ContactCollection
Returns all contacts in this ContactCollection.

Specified by:
toArray in interface ContactCollection
Returns:
the list of contacts as Contact[].

toArray

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

Specified by:
toArray in interface ContactCollection
Parameters:
filter - the filter as ContactFilter.
Returns:
the list of contacts as Contact[].

add

public void add(Contact contact)
Description copied from interface: ContactCollection
Adds a given contact to this ContactCollection.

Specified by:
add in interface ContactCollection
Parameters:
contact - the contact as Contact.

remove

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

Specified by:
remove in interface 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)
Description copied from interface: ContactCollection
Removes a given contact from this ContactCollection.

Specified by:
remove in interface ContactCollection
Parameters:
contact - the contact as Contact.

iterator

public java.util.Iterator iterator()
Description copied from interface: ContactCollection
Returns an iterator over all contacts in this ContactCollection.

Specified by:
iterator in interface ContactCollection
Returns:
an Iterator instance.

iterator

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

Specified by:
iterator in interface ContactCollection
Parameters:
filter - the filter as ContactFilter.
Returns:
an Iterator instance.

size

public int size()
Description copied from interface: ContactCollection
Returns the number of contacts in this ContactCollection.

Specified by:
size in interface ContactCollection
Returns:
the number of contacts as int.


Copyright © 2001-2003 jpim team.