net.wimpi.pim.contact.model
Interface Communications

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
CommunicationsImpl

public interface Communications
extends java.io.Serializable

An interface modeling a container for telecommunications information based on the types and information of the vCard Mime directory profile standard specification.

For reference see RFC 2426:
3.3 Telecommunications Addressing Types
3.3.1 TEL Type Definition
3.3.2 EMAIL Type Definition
3.3.3 MAILER Type Definition

Note that an implementation has to be able to maintain order of the collections, as well as manage the preferred number and email address.

Version:
0.1 (22/07/2003)
Author:
Dieter Wimberger
See Also:
EmailAddress, PhoneNumber

Method Summary
 void addEmailAddress(EmailAddress email)
          Adds the given EmailAddress instance to this Communications.
 void addPhoneNumber(PhoneNumber phone)
          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 phone)
          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 phone)
          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 phone)
          Sets the preferred phone number of this Communications instance.
 

Method Detail

getPhoneNumbers

public java.util.Iterator getPhoneNumbers()
Returns all phone numbers associated with this Communications.

Returns:
an Iterator over all PhoneNumber instances.

listPhoneNumbers

public PhoneNumber[] listPhoneNumbers()
Returns all phone numbers associated with this Communications.

Returns:
an array of PhoneNumber instances.

getPhoneNumber

public PhoneNumber getPhoneNumber(java.lang.String uid)
Returns the PhoneNumber instance with the given identifier.

Parameters:
uid - a unique identifier as String.
Returns:
the PhoneNumber.

addPhoneNumber

public void addPhoneNumber(PhoneNumber phone)
Adds the given PhoneNumber instance to this Communications.

Parameters:
phone - the PhoneNumber to be added.

removePhoneNumber

public void removePhoneNumber(PhoneNumber phone)
Removes the given PhoneNumber instance from this Communications.

Parameters:
phone - the PhoneNumber to be removed.

getPreferredPhoneNumber

public PhoneNumber getPreferredPhoneNumber()
Returns the preferred the phone number of this Communications instance.

Returns:
the preferred phone number as PhoneNumber.

setPreferredPhoneNumber

public void setPreferredPhoneNumber(PhoneNumber phone)
Sets the preferred phone number of this Communications instance.

Parameters:
phone - the preferred phone number as PhoneNumber.

isPreferredPhoneNumber

public boolean isPreferredPhoneNumber(PhoneNumber phone)
Tests if the given phone number is the preferred one.

Parameters:
phone - the phone number to be tested as PhoneNumber.
Returns:
true if preferred, false otherwise.

listPhoneNumbersByType

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

Returns:
int the type as int.
See Also:
PhoneNumber

getPhoneNumberCount

public int getPhoneNumberCount()
Returns the number of PhoneNumber instances associated with this Communications.

Returns:
the number of phone numbers as int.

getEmailAddresses

public java.util.Iterator getEmailAddresses()
Returns all email addresses associated with this Communications.

Returns:
an Iterator over all EmailAddress instances.

listEmailAddresses

public EmailAddress[] listEmailAddresses()
Returns all email addresses associated with this Communications.

Returns:
an array of EmailAddress instances.

getEmailAddress

public EmailAddress getEmailAddress(java.lang.String uid)
Returns the EmailAddress instance with the given identifier.

Parameters:
uid - a unique identifier as String.
Returns:
the EmailAddress instance.

addEmailAddress

public void addEmailAddress(EmailAddress email)
Adds the given EmailAddress instance to this Communications.

Parameters:
email - the EmailAddress to be added.

removeEmailAddress

public void removeEmailAddress(EmailAddress email)
Removes the given EmailAddress instance from this Communications.

Parameters:
email - the EmailAddress to be removed.

getPreferredEmailAddress

public EmailAddress getPreferredEmailAddress()
Returns the preferred email address of this Communications instance.

Returns:
the preferred email address as EmailAddress.

setPreferredEmailAddress

public void setPreferredEmailAddress(EmailAddress email)
Sets the preferred email address of this Communications instance.

Parameters:
email - the preferred email address as EmailAddress.

isPreferredEmailAddress

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

Parameters:
email - the address to be tested as EmailAddress.
Returns:
true if preferred, false otherwise.

getEmailAddressCount

public int getEmailAddressCount()
Returns the number of EmailAddress instances associated with this Communications.

Returns:
the number of email addresses as int.

getMailer

public java.lang.String getMailer()
Returns the mailer identification. Mailer refers to an electronic mail software package.

Returns:
the mailer identification as String.

setMailer

public void setMailer(java.lang.String mailer)
Sets the mailer identification. Mailer refers to an electronic mail software package.

Parameters:
mailer - the mailer identification as String.


Copyright © 2001-2003 jpim team.