net.wimpi.pim.contact.basicimpl
Class ContactImpl

java.lang.Object
  |
  +--net.wimpi.pim.util.AbstractIdentifiable
        |
        +--net.wimpi.pim.contact.basicimpl.ContactImpl
All Implemented Interfaces:
Contact, Identifiable, java.io.Serializable

public class ContactImpl
extends AbstractIdentifiable
implements Contact

A basic and simple implementation of a Contact.

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

Field Summary
protected  java.util.List m_Addresses
           
protected  java.util.List m_Categories
           
protected  java.lang.String m_Classification
           
protected  Communications m_Communications
           
protected  Extensions m_Extensions
           
protected  boolean m_Frequent
           
protected  GeographicalInformation m_GeoInfo
           
protected  Key m_Key
           
protected  Address m_LastAddedAddress
           
protected  java.lang.String m_Note
           
protected  OrganizationalIdentity m_OrganizationalIdentity
           
protected  PersonalIdentity m_PersonalIdentity
           
protected  Address m_PreferredAddress
           
protected  java.util.Date m_Revision
           
protected  Sound m_Sound
           
protected  java.lang.String m_Url
           
 
Constructor Summary
ContactImpl()
           
 
Method Summary
 void addAddress(Address addr)
          Adds an address to this Contact.
 void addCategory(java.lang.String category)
          Adds a category to this Contact.
 java.lang.String getAccessClassification()
          Returns the access classification of this Contact.
 Address getAddress(java.lang.String uid)
          Returns the address at the given index.
 int getAddressCount()
          Returns the number of addresses associated with this Contact.
 java.util.Iterator getAddresses()
          Returns all addresses associated with this Contact.
 java.lang.String getCategoriesList()
           
 java.lang.String getCategory(int index)
          Returns the category at the given index.
 int getCategoryCount()
          Returns the number of categories associated with this Contact.
 Communications getCommunications()
          Returns the Communications instance associated with this Contact.
 java.util.Date getCurrentRevisionDate()
          Returns the current revision date of this Contact.
 Extensions getExtensions()
          Returns the extensions associated with this Contact.
 GeographicalInformation getGeographicalInformation()
          Returns the GeographicalInformation instance associated with this Contact.
 Address getLastAddedAddress()
          Returns the last added address.
 java.lang.String getNote()
          Returns the note associated with this Contact.
 OrganizationalIdentity getOrganizationalIdentity()
          Returns the OrganizationalIdentity of this Contact.
 PersonalIdentity getPersonalIdentity()
          Returns the PersonalIdentity of this Contact.
 Address getPreferredAddress()
          Returns the preferred address of this Contact instance.
 Key getPublicKey()
          Returns the public key associated with this Contact.
 Sound getSound()
          Returns the sound associated with this Contact.
 java.lang.String getURL()
          Returns an URL associated with this Contact.
 boolean hasCommunications()
          Tests if this Contact has a Communications instance.
 boolean hasExtensions()
          Tests if this Contact has extensions.
 boolean hasGeographicalInformation()
          Tests if this Contact has a GeographicalInformation instance.
 boolean hasOrganizationalIdentity()
          Tests if this Contact has a OrganizationalIdentity.
 boolean hasPersonalIdentity()
          Tests if this Contact has a PersonalIdentity.
 boolean hasPublicKey()
          Tests if this Contact has a public key.
 boolean hasSound()
          Tests if this Contact has a sound associated with it.
 boolean isFrequent()
          Tests if this Contact is frequently used.
 boolean isPreferredAddress(Address address)
          Tests if the given address is the preferred one of this Contact.
 Address[] listAddresses()
          Returns all addresses associated with this Contact.
 Address[] listAddressesByType(int TYPE)
          Returns the addresses of a given type of this Contact instance.
 java.lang.String[] listCategories()
          Returns all categories of this this Contact.
 void removeAddress(Address addr)
          Removes and returns the Address at the given index.
 void removeAllCategories()
          Removes all categories.
 java.lang.String removeCategory(int index)
          Removes and returns the category at the given index.
 void setAccessClassification(java.lang.String classification)
          Sets the access classification of this Contact.
 void setCategoriesList(java.lang.String list)
           
 java.lang.String setCategory(int index, java.lang.String cat)
          Sets the category at the given index, returning the replaced one.
 void setCommunications(Communications communications)
          Sets the Communications instance associated with this Contact.
 void setCurrentRevisionDate(java.util.Date revision)
          Sets the current revision date of this Contact.
 void setExtensions(Extensions extensions)
          Sets the extensions associated with this Contact.
 void setFrequent(boolean b)
          Sets the frequent flag of this Contact.
 void setGeographicalInformation(GeographicalInformation geoinfo)
          Sets the GeographicalInformation instance associated with this Contact.
 void setNote(java.lang.String note)
          Sets the note associated with this Contact.
 void setOrganizationalIdentity(OrganizationalIdentity identity)
          Sets the OrganizationalIdentity of this Contact.
 void setPersonalIdentity(PersonalIdentity identity)
          Sets the PersonalIdentity of this Contact.
 void setPreferredAddress(Address address)
          Sets the preferred address of this Contact instance.
 void setPublicKey(Key key)
          Sets the public key associated with this Contact.
 void setSound(Sound sound)
          Sets the sound associated with this Contact.
 void setURL(java.lang.String url)
          Sets the URL associated with this Contact.
 
Methods inherited from class net.wimpi.pim.util.AbstractIdentifiable
equals, getUID, setUID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.wimpi.pim.util.Identifiable
getUID
 

Field Detail

m_Url

protected java.lang.String m_Url

m_Frequent

protected boolean m_Frequent

m_Note

protected java.lang.String m_Note

m_Revision

protected java.util.Date m_Revision

m_Classification

protected java.lang.String m_Classification

m_Addresses

protected java.util.List m_Addresses

m_Categories

protected java.util.List m_Categories

m_PreferredAddress

protected Address m_PreferredAddress

m_LastAddedAddress

protected Address m_LastAddedAddress

m_PersonalIdentity

protected PersonalIdentity m_PersonalIdentity

m_OrganizationalIdentity

protected OrganizationalIdentity m_OrganizationalIdentity

m_Communications

protected Communications m_Communications

m_GeoInfo

protected GeographicalInformation m_GeoInfo

m_Key

protected Key m_Key

m_Sound

protected Sound m_Sound

m_Extensions

protected Extensions m_Extensions
Constructor Detail

ContactImpl

public ContactImpl()
Method Detail

getPersonalIdentity

public PersonalIdentity getPersonalIdentity()
Description copied from interface: Contact
Returns the PersonalIdentity of this Contact.

Specified by:
getPersonalIdentity in interface Contact
Returns:
a PersonalIdentity instance.

setPersonalIdentity

public void setPersonalIdentity(PersonalIdentity identity)
Description copied from interface: Contact
Sets the PersonalIdentity of this Contact.

Specified by:
setPersonalIdentity in interface Contact
Parameters:
identity - a PersonalIdentity instance.

hasPersonalIdentity

public boolean hasPersonalIdentity()
Description copied from interface: Contact
Tests if this Contact has a PersonalIdentity.

Specified by:
hasPersonalIdentity in interface Contact
Returns:
true if it has, false otherwise.

getOrganizationalIdentity

public OrganizationalIdentity getOrganizationalIdentity()
Description copied from interface: Contact
Returns the OrganizationalIdentity of this Contact.

Specified by:
getOrganizationalIdentity in interface Contact
Returns:
an OrganizationalIdentity instance.

setOrganizationalIdentity

public void setOrganizationalIdentity(OrganizationalIdentity identity)
Description copied from interface: Contact
Sets the OrganizationalIdentity of this Contact.

Specified by:
setOrganizationalIdentity in interface Contact
Parameters:
identity - an OrganizationalIdentity instance.

hasOrganizationalIdentity

public boolean hasOrganizationalIdentity()
Description copied from interface: Contact
Tests if this Contact has a OrganizationalIdentity.

Specified by:
hasOrganizationalIdentity in interface Contact
Returns:
true if it has, false otherwise.

getAddresses

public java.util.Iterator getAddresses()
Description copied from interface: Contact
Returns all addresses associated with this Contact.

Specified by:
getAddresses in interface Contact
Returns:
an Iterator over all Address instances.

listAddresses

public Address[] listAddresses()
Description copied from interface: Contact
Returns all addresses associated with this Contact.

Specified by:
listAddresses in interface Contact
Returns:
the addresses as Address[].

getAddress

public Address getAddress(java.lang.String uid)
Description copied from interface: Contact
Returns the address at the given index.

Specified by:
getAddress in interface Contact
Parameters:
uid - the unique identifier as String.
Returns:
the Address instance.

getLastAddedAddress

public Address getLastAddedAddress()
Description copied from interface: Contact
Returns the last added address. This method will return null, if no address was added.

Specified by:
getLastAddedAddress in interface Contact
Returns:
an Address instance.

addAddress

public void addAddress(Address addr)
Description copied from interface: Contact
Adds an address to this Contact.

Specified by:
addAddress in interface Contact
Parameters:
addr - the Address to be added.

removeAddress

public void removeAddress(Address addr)
                   throws java.lang.IndexOutOfBoundsException
Description copied from interface: Contact
Removes and returns the Address at the given index.

Specified by:
removeAddress in interface Contact
Parameters:
addr - the Address instance to be removed.
java.lang.IndexOutOfBoundsException

getPreferredAddress

public Address getPreferredAddress()
Description copied from interface: Contact
Returns the preferred address of this Contact instance.

Specified by:
getPreferredAddress in interface Contact
Returns:
the preferred address as Address.

setPreferredAddress

public void setPreferredAddress(Address address)
Description copied from interface: Contact
Sets the preferred address of this Contact instance.

Specified by:
setPreferredAddress in interface Contact
Parameters:
address - the preferred address as Address.

isPreferredAddress

public boolean isPreferredAddress(Address address)
Description copied from interface: Contact
Tests if the given address is the preferred one of this Contact.

Specified by:
isPreferredAddress in interface Contact
Parameters:
address - the address to be tested as Address.
Returns:
true if preferred, false otherwise.

getAddressCount

public int getAddressCount()
Description copied from interface: Contact
Returns the number of addresses associated with this Contact.

Specified by:
getAddressCount in interface Contact
Returns:
the number as int.

listAddressesByType

public Address[] listAddressesByType(int TYPE)
Description copied from interface: Contact
Returns the addresses of a given type of this Contact instance.

Specified by:
listAddressesByType in interface Contact
Returns:
int the type as int.
See Also:
Address

getCommunications

public Communications getCommunications()
Description copied from interface: Contact
Returns the Communications instance associated with this Contact.

Specified by:
getCommunications in interface Contact
Returns:
the Communications instance.

setCommunications

public void setCommunications(Communications communications)
Description copied from interface: Contact
Sets the Communications instance associated with this Contact.

Specified by:
setCommunications in interface Contact
Parameters:
communications - the Communications instance.

hasCommunications

public boolean hasCommunications()
Description copied from interface: Contact
Tests if this Contact has a Communications instance.

Specified by:
hasCommunications in interface Contact
Returns:
true if it has, false otherwise.

getGeographicalInformation

public GeographicalInformation getGeographicalInformation()
Description copied from interface: Contact
Returns the GeographicalInformation instance associated with this Contact.

Specified by:
getGeographicalInformation in interface Contact
Returns:
the GeographicalInformation instance.

setGeographicalInformation

public void setGeographicalInformation(GeographicalInformation geoinfo)
Description copied from interface: Contact
Sets the GeographicalInformation instance associated with this Contact.

Specified by:
setGeographicalInformation in interface Contact
Parameters:
geoinfo - the GeographicalInformation instance.

hasGeographicalInformation

public boolean hasGeographicalInformation()
Description copied from interface: Contact
Tests if this Contact has a GeographicalInformation instance.

Specified by:
hasGeographicalInformation in interface Contact
Returns:
true if it has, false otherwise.

getCategoriesList

public java.lang.String getCategoriesList()

setCategoriesList

public void setCategoriesList(java.lang.String list)

listCategories

public java.lang.String[] listCategories()
Description copied from interface: Contact
Returns all categories of this this Contact.

Specified by:
listCategories in interface Contact
Returns:
the categories as String[].

getCategory

public java.lang.String getCategory(int index)
                             throws java.lang.IndexOutOfBoundsException
Description copied from interface: Contact
Returns the category at the given index.

Specified by:
getCategory in interface Contact
Parameters:
index - the index as int.
Returns:
the category as String.
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of bounds.

setCategory

public java.lang.String setCategory(int index,
                                    java.lang.String cat)
Description copied from interface: Contact
Sets the category at the given index, returning the replaced one.

Specified by:
setCategory in interface Contact
Parameters:
index - the index as int.
cat - the category as String.
Returns:
the category as String.

addCategory

public void addCategory(java.lang.String category)
Description copied from interface: Contact
Adds a category to this Contact.

Specified by:
addCategory in interface Contact
Parameters:
category - the category as String.

removeCategory

public java.lang.String removeCategory(int index)
                                throws java.lang.IndexOutOfBoundsException
Description copied from interface: Contact
Removes and returns the category at the given index.

Specified by:
removeCategory in interface Contact
Parameters:
index - the index as int.
Returns:
the removed category as String.
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of bounds.

removeAllCategories

public void removeAllCategories()
Description copied from interface: Contact
Removes all categories.

Specified by:
removeAllCategories in interface Contact

getCategoryCount

public int getCategoryCount()
Description copied from interface: Contact
Returns the number of categories associated with this Contact.

Specified by:
getCategoryCount in interface Contact
Returns:
the number as int.

getURL

public java.lang.String getURL()
Description copied from interface: Contact
Returns an URL associated with this Contact.

Specified by:
getURL in interface Contact
Returns:
the URL as String.

setURL

public void setURL(java.lang.String url)
Description copied from interface: Contact
Sets the URL associated with this Contact.

Specified by:
setURL in interface Contact
Parameters:
url - the URL as String.

isFrequent

public boolean isFrequent()
Description copied from interface: Contact
Tests if this Contact is frequently used.

Specified by:
isFrequent in interface Contact
Returns:
true if frequent, false otherwise.

setFrequent

public void setFrequent(boolean b)
Description copied from interface: Contact
Sets the frequent flag of this Contact.

Specified by:
setFrequent in interface Contact
Parameters:
b - true if frequent, false otherwise.

getNote

public java.lang.String getNote()
Description copied from interface: Contact
Returns the note associated with this Contact.

Specified by:
getNote in interface Contact
Returns:
the note as String.

setNote

public void setNote(java.lang.String note)
Description copied from interface: Contact
Sets the note associated with this Contact.

Specified by:
setNote in interface Contact
Parameters:
note - the note as String.

getCurrentRevisionDate

public java.util.Date getCurrentRevisionDate()
Description copied from interface: Contact
Returns the current revision date of this Contact.

Specified by:
getCurrentRevisionDate in interface Contact
Returns:
the revision date as Date.

setCurrentRevisionDate

public void setCurrentRevisionDate(java.util.Date revision)
Description copied from interface: Contact
Sets the current revision date of this Contact.

Specified by:
setCurrentRevisionDate in interface Contact
Parameters:
revision - the revision date as Date.

getAccessClassification

public java.lang.String getAccessClassification()
Description copied from interface: Contact
Returns the access classification of this Contact.

Specified by:
getAccessClassification in interface Contact
Returns:
the access classification as String.

setAccessClassification

public void setAccessClassification(java.lang.String classification)
Description copied from interface: Contact
Sets the access classification of this Contact.

Specified by:
setAccessClassification in interface Contact
Parameters:
classification - the access classification as String.

getPublicKey

public Key getPublicKey()
Description copied from interface: Contact
Returns the public key associated with this Contact.

Specified by:
getPublicKey in interface Contact
Returns:
the public key as Key.

setPublicKey

public void setPublicKey(Key key)
Description copied from interface: Contact
Sets the public key associated with this Contact.

Specified by:
setPublicKey in interface Contact
Parameters:
key - the public key as Key.

hasPublicKey

public boolean hasPublicKey()
Description copied from interface: Contact
Tests if this Contact has a public key.

Specified by:
hasPublicKey in interface Contact
Returns:
true if there is a key associated with this Contact, false otherwise.

getSound

public Sound getSound()
Description copied from interface: Contact
Returns the sound associated with this Contact.

Specified by:
getSound in interface Contact
Returns:
the sound as Sound.

setSound

public void setSound(Sound sound)
Description copied from interface: Contact
Sets the sound associated with this Contact.

Specified by:
setSound in interface Contact
Parameters:
sound - the sound as Sound.

hasSound

public boolean hasSound()
Description copied from interface: Contact
Tests if this Contact has a sound associated with it.

Specified by:
hasSound in interface Contact
Returns:
true if there is a sound associated with this Contact, false otherwise.

getExtensions

public Extensions getExtensions()
Description copied from interface: Contact
Returns the extensions associated with this Contact.

Specified by:
getExtensions in interface Contact
Returns:
the extensions as Extensions instance.

setExtensions

public void setExtensions(Extensions extensions)
Description copied from interface: Contact
Sets the extensions associated with this Contact.

Specified by:
setExtensions in interface Contact
Parameters:
extensions - the extensions as Extensions instance.

hasExtensions

public boolean hasExtensions()
Description copied from interface: Contact
Tests if this Contact has extensions.

Specified by:
hasExtensions in interface Contact
Returns:
true if it has extensions, false otherwise.


Copyright © 2001-2003 jpim team.