net.wimpi.pim.contact.basicimpl
Class CommunicationsImpl

java.lang.Object
  |
  +--net.wimpi.pim.contact.basicimpl.CommunicationsImpl
All Implemented Interfaces:
Communications, java.io.Serializable

public class CommunicationsImpl
extends java.lang.Object
implements Communications

A basic and simple implementation of the Communications.

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

Field Summary
protected  java.util.List m_EmailAddresses
           
protected  java.lang.String m_Mailer
           
protected  java.util.List m_PhoneNumbers
           
protected  EmailAddress m_PreferredEmail
           
protected  PhoneNumber m_PreferredNumber
           
 
Constructor Summary
CommunicationsImpl()
           
 
Method Summary
 void addEmailAddress(EmailAddress email)
          Adds the given EmailAddress instance to this Communications.
 void addPhoneNumber(PhoneNumber number)
          Adds the given PhoneNumber instance to this Communications.
 EmailAddress getEmailAddress(java.lang.String uid)
          Returns the EmailAddress instance with the given identifier.
 int getEmailAddressCount()
          Returns the number of EmailAddress instances associated with this Communications.
 java.util.Iterator getEmailAddresses()
          Returns all email addresses associated with this Communications.
 java.lang.String getMailer()
          Returns the mailer identification.
 PhoneNumber getPhoneNumber(java.lang.String uid)
          Returns the PhoneNumber instance with the given identifier.
 int getPhoneNumberCount()
          Returns the number of PhoneNumber instances associated with this Communications.
 java.util.Iterator getPhoneNumbers()
          Returns all phone numbers associated with this Communications.
 EmailAddress getPreferredEmailAddress()
          Returns the preferred email address of this Communications instance.
 PhoneNumber getPreferredPhoneNumber()
          Returns the preferred the phone number of this Communications instance.
 boolean isPreferredEmailAddress(EmailAddress email)
          Tests if the given email address is the preferred one of this Communications instance.
 boolean isPreferredPhoneNumber(PhoneNumber number)
          Tests if the given phone number is the preferred one.
 EmailAddress[] listEmailAddresses()
          Returns all email addresses associated with this Communications.
 PhoneNumber[] listPhoneNumbers()
          Returns all phone numbers associated with this Communications.
 PhoneNumber[] listPhoneNumbersByType(int TYPE)
          Returns the phone numbers of a given type of this Communications instance.
 void removeEmailAddress(EmailAddress email)
          Removes the given EmailAddress instance from this Communications.
 void removePhoneNumber(PhoneNumber number)
          Removes the given PhoneNumber instance from this Communications.
 void setMailer(java.lang.String mailer)
          Sets the mailer identification.
 void setPreferredEmailAddress(EmailAddress email)
          Sets the preferred email address of this Communications instance.
 void setPreferredPhoneNumber(PhoneNumber number)
          Sets the preferred phone number of this Communications instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_PhoneNumbers

protected java.util.List m_PhoneNumbers

m_EmailAddresses

protected java.util.List m_EmailAddresses

m_Mailer

protected java.lang.String m_Mailer

m_PreferredEmail

protected EmailAddress m_PreferredEmail

m_PreferredNumber

protected PhoneNumber m_PreferredNumber
Constructor Detail

CommunicationsImpl

public CommunicationsImpl()
Method Detail

getPhoneNumbers

public java.util.Iterator getPhoneNumbers()
Description copied from interface: Communications
Returns all phone numbers associated with this Communications.

Specified by:
getPhoneNumbers in interface Communications
Returns:
an Iterator over all PhoneNumber instances.

listPhoneNumbers

public PhoneNumber[] listPhoneNumbers()
Description copied from interface: Communications
Returns all phone numbers associated with this Communications.

Specified by:
listPhoneNumbers in interface Communications
Returns:
an array of PhoneNumber instances.

getPhoneNumber

public PhoneNumber getPhoneNumber(java.lang.String uid)
Description copied from interface: Communications
Returns the PhoneNumber instance with the given identifier.

Specified by:
getPhoneNumber in interface Communications
Parameters:
uid - a unique identifier as String.
Returns:
the PhoneNumber.

addPhoneNumber

public void addPhoneNumber(PhoneNumber number)
Description copied from interface: Communications
Adds the given PhoneNumber instance to this Communications.

Specified by:
addPhoneNumber in interface Communications
Parameters:
number - the PhoneNumber to be added.

removePhoneNumber

public void removePhoneNumber(PhoneNumber number)
Description copied from interface: Communications
Removes the given PhoneNumber instance from this Communications.

Specified by:
removePhoneNumber in interface Communications
Parameters:
number - the PhoneNumber to be removed.

getPreferredPhoneNumber

public PhoneNumber getPreferredPhoneNumber()
Description copied from interface: Communications
Returns the preferred the phone number of this Communications instance.

Specified by:
getPreferredPhoneNumber in interface Communications
Returns:
the preferred phone number as PhoneNumber.

setPreferredPhoneNumber

public void setPreferredPhoneNumber(PhoneNumber number)
Description copied from interface: Communications
Sets the preferred phone number of this Communications instance.

Specified by:
setPreferredPhoneNumber in interface Communications
Parameters:
number - the preferred phone number as PhoneNumber.

isPreferredPhoneNumber

public boolean isPreferredPhoneNumber(PhoneNumber number)
Description copied from interface: Communications
Tests if the given phone number is the preferred one.

Specified by:
isPreferredPhoneNumber in interface Communications
Parameters:
number - the phone number to be tested as PhoneNumber.
Returns:
true if preferred, false otherwise.

listPhoneNumbersByType

public PhoneNumber[] listPhoneNumbersByType(int TYPE)
Description copied from interface: Communications
Returns the phone numbers of a given type of this Communications instance.

Specified by:
listPhoneNumbersByType in interface Communications
Returns:
int the type as int.
See Also:
PhoneNumber

getPhoneNumberCount

public int getPhoneNumberCount()
Description copied from interface: Communications
Returns the number of PhoneNumber instances associated with this Communications.

Specified by:
getPhoneNumberCount in interface Communications
Returns:
the number of phone numbers as int.

getEmailAddresses

public java.util.Iterator getEmailAddresses()
Description copied from interface: Communications
Returns all email addresses associated with this Communications.

Specified by:
getEmailAddresses in interface Communications
Returns:
an Iterator over all EmailAddress instances.

listEmailAddresses

public EmailAddress[] listEmailAddresses()
Description copied from interface: Communications
Returns all email addresses associated with this Communications.

Specified by:
listEmailAddresses in interface Communications
Returns:
an array of EmailAddress instances.

getEmailAddress

public EmailAddress getEmailAddress(java.lang.String uid)
Description copied from interface: Communications
Returns the EmailAddress instance with the given identifier.

Specified by:
getEmailAddress in interface Communications
Parameters:
uid - a unique identifier as String.
Returns:
the EmailAddress instance.

addEmailAddress

public void addEmailAddress(EmailAddress email)
Description copied from interface: Communications
Adds the given EmailAddress instance to this Communications.

Specified by:
addEmailAddress in interface Communications
Parameters:
email - the EmailAddress to be added.

removeEmailAddress

public void removeEmailAddress(EmailAddress email)
Description copied from interface: Communications
Removes the given EmailAddress instance from this Communications.

Specified by:
removeEmailAddress in interface Communications
Parameters:
email - the EmailAddress to be removed.

getPreferredEmailAddress

public EmailAddress getPreferredEmailAddress()
Description copied from interface: Communications
Returns the preferred email address of this Communications instance.

Specified by:
getPreferredEmailAddress in interface Communications
Returns:
the preferred email address as EmailAddress.

setPreferredEmailAddress

public void setPreferredEmailAddress(EmailAddress email)
Description copied from interface: Communications
Sets the preferred email address of this Communications instance.

Specified by:
setPreferredEmailAddress in interface Communications
Parameters:
email - the preferred email address as EmailAddress.

isPreferredEmailAddress

public boolean isPreferredEmailAddress(EmailAddress email)
Description copied from interface: Communications
Tests if the given email address is the preferred one of this Communications instance.

Specified by:
isPreferredEmailAddress in interface Communications
Parameters:
email - the address to be tested as EmailAddress.
Returns:
true if preferred, false otherwise.

getEmailAddressCount

public int getEmailAddressCount()
Description copied from interface: Communications
Returns the number of EmailAddress instances associated with this Communications.

Specified by:
getEmailAddressCount in interface Communications
Returns:
the number of email addresses as int.

getMailer

public java.lang.String getMailer()
Description copied from interface: Communications
Returns the mailer identification. Mailer refers to an electronic mail software package.

Specified by:
getMailer in interface Communications
Returns:
the mailer identification as String.

setMailer

public void setMailer(java.lang.String mailer)
Description copied from interface: Communications
Sets the mailer identification. Mailer refers to an electronic mail software package.

Specified by:
setMailer in interface Communications
Parameters:
mailer - the mailer identification as String.


Copyright © 2001-2003 jpim team.