net.wimpi.pim.contact.model
Interface Contact

All Superinterfaces:
Identifiable, java.io.Serializable
All Known Implementing Classes:
ContactImpl

public interface Contact
extends Identifiable, java.io.Serializable

An interface modeling contact based on the types and information of the vCard Mime directory profile standard specification.

For reference see RFC 2426:
3.6 EXPLANATORY TYPES
3.6.1 CATEGORIES Type Definition
3.6.2 NOTE Type Definition
3.6.4 REV Type Definition
3.6.7 UID Type Definition
3.6.8 URL Type Definition
3.7.1 CLASS Type Definition
3.7.2 KEY Type Definition

Note that a flag for frequently used contacts has been added, which represents an extension to the standard.

Version:
0.1 (22/07/2003)
Author:
Dieter Wimberger
See Also:
PersonalIdentity, OrganizationalIdentity, Address, Communications, GeographicalInformation, Key

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 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 ac)
          Sets the access classification of this Contact.
 java.lang.String setCategory(int index, java.lang.String category)
          Sets the category at the given index, returning the replaced one.
 void setCommunications(Communications comm)
          Sets the Communications instance associated with this Contact.
 void setCurrentRevisionDate(java.util.Date date)
          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 interface net.wimpi.pim.util.Identifiable
getUID
 

Method Detail

getPersonalIdentity

public PersonalIdentity getPersonalIdentity()
Returns the PersonalIdentity of this Contact.

Returns:
a PersonalIdentity instance.

setPersonalIdentity

public void setPersonalIdentity(PersonalIdentity identity)
Sets the PersonalIdentity of this Contact.

Parameters:
identity - a PersonalIdentity instance.

hasPersonalIdentity

public boolean hasPersonalIdentity()
Tests if this Contact has a PersonalIdentity.

Returns:
true if it has, false otherwise.

getOrganizationalIdentity

public OrganizationalIdentity getOrganizationalIdentity()
Returns the OrganizationalIdentity of this Contact.

Returns:
an OrganizationalIdentity instance.

setOrganizationalIdentity

public void setOrganizationalIdentity(OrganizationalIdentity identity)
Sets the OrganizationalIdentity of this Contact.

Parameters:
identity - an OrganizationalIdentity instance.

hasOrganizationalIdentity

public boolean hasOrganizationalIdentity()
Tests if this Contact has a OrganizationalIdentity.

Returns:
true if it has, false otherwise.

getAddresses

public java.util.Iterator getAddresses()
Returns all addresses associated with this Contact.

Returns:
an Iterator over all Address instances.

listAddresses

public Address[] listAddresses()
Returns all addresses associated with this Contact.

Returns:
the addresses as Address[].

getAddress

public Address getAddress(java.lang.String uid)
Returns the address at the given index.

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

getLastAddedAddress

public Address getLastAddedAddress()
Returns the last added address. This method will return null, if no address was added.

Returns:
an Address instance.

addAddress

public void addAddress(Address addr)
Adds an address to this Contact.

Parameters:
addr - the Address to be added.

removeAddress

public void removeAddress(Address addr)
Removes and returns the Address at the given index.

Parameters:
addr - the Address instance to be removed.

getPreferredAddress

public Address getPreferredAddress()
Returns the preferred address of this Contact instance.

Returns:
the preferred address as Address.

setPreferredAddress

public void setPreferredAddress(Address address)
Sets the preferred address of this Contact instance.

Parameters:
address - the preferred address as Address.

isPreferredAddress

public boolean isPreferredAddress(Address address)
Tests if the given address is the preferred one of this Contact.

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

listAddressesByType

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

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

getAddressCount

public int getAddressCount()
Returns the number of addresses associated with this Contact.

Returns:
the number as int.

getCommunications

public Communications getCommunications()
Returns the Communications instance associated with this Contact.

Returns:
the Communications instance.

setCommunications

public void setCommunications(Communications comm)
Sets the Communications instance associated with this Contact.

Parameters:
comm - the Communications instance.

hasCommunications

public boolean hasCommunications()
Tests if this Contact has a Communications instance.

Returns:
true if it has, false otherwise.

getGeographicalInformation

public GeographicalInformation getGeographicalInformation()
Returns the GeographicalInformation instance associated with this Contact.

Returns:
the GeographicalInformation instance.

setGeographicalInformation

public void setGeographicalInformation(GeographicalInformation geoinfo)
Sets the GeographicalInformation instance associated with this Contact.

Parameters:
geoinfo - the GeographicalInformation instance.

hasGeographicalInformation

public boolean hasGeographicalInformation()
Tests if this Contact has a GeographicalInformation instance.

Returns:
true if it has, false otherwise.

listCategories

public java.lang.String[] listCategories()
Returns all categories of this this Contact.

Returns:
the categories as String[].

getCategory

public java.lang.String getCategory(int index)
                             throws java.lang.IndexOutOfBoundsException
Returns the category at the given index.

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 category)
                             throws java.lang.IndexOutOfBoundsException
Sets the category at the given index, returning the replaced one.

Parameters:
index - the index as int.
category - the category as String.
Returns:
the category as String.
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of bounds.

addCategory

public void addCategory(java.lang.String category)
Adds a category to this Contact.

Parameters:
category - the category as String.

removeCategory

public java.lang.String removeCategory(int index)
                                throws java.lang.IndexOutOfBoundsException
Removes and returns the category at the given index.

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()
Removes all categories.


getCategoryCount

public int getCategoryCount()
Returns the number of categories associated with this Contact.

Returns:
the number as int.

getURL

public java.lang.String getURL()
Returns an URL associated with this Contact.

Returns:
the URL as String.

setURL

public void setURL(java.lang.String url)
Sets the URL associated with this Contact.

Parameters:
url - the URL as String.

isFrequent

public boolean isFrequent()
Tests if this Contact is frequently used.

Returns:
true if frequent, false otherwise.

setFrequent

public void setFrequent(boolean b)
Sets the frequent flag of this Contact.

Parameters:
b - true if frequent, false otherwise.

getNote

public java.lang.String getNote()
Returns the note associated with this Contact.

Returns:
the note as String.

setNote

public void setNote(java.lang.String note)
Sets the note associated with this Contact.

Parameters:
note - the note as String.

getCurrentRevisionDate

public java.util.Date getCurrentRevisionDate()
Returns the current revision date of this Contact.

Returns:
the revision date as Date.

setCurrentRevisionDate

public void setCurrentRevisionDate(java.util.Date date)
Sets the current revision date of this Contact.

Parameters:
date - the revision date as Date.

getAccessClassification

public java.lang.String getAccessClassification()
Returns the access classification of this Contact.

Returns:
the access classification as String.

setAccessClassification

public void setAccessClassification(java.lang.String ac)
Sets the access classification of this Contact.

Parameters:
ac - the access classification as String.

getPublicKey

public Key getPublicKey()
Returns the public key associated with this Contact.

Returns:
the public key as Key.

setPublicKey

public void setPublicKey(Key key)
Sets the public key associated with this Contact.

Parameters:
key - the public key as Key.

hasPublicKey

public boolean hasPublicKey()
Tests if this Contact has a public key.

Returns:
true if there is a key associated with this Contact, false otherwise.

getSound

public Sound getSound()
Returns the sound associated with this Contact.

Returns:
the sound as Sound.

setSound

public void setSound(Sound sound)
Sets the sound associated with this Contact.

Parameters:
sound - the sound as Sound.

hasSound

public boolean hasSound()
Tests if this Contact has a sound associated with it.

Returns:
true if there is a sound associated with this Contact, false otherwise.

getExtensions

public Extensions getExtensions()
Returns the extensions associated with this Contact.

Returns:
the extensions as Extensions instance.

setExtensions

public void setExtensions(Extensions extensions)
Sets the extensions associated with this Contact.

Parameters:
extensions - the extensions as Extensions instance.

hasExtensions

public boolean hasExtensions()
Tests if this Contact has extensions.

Returns:
true if it has extensions, false otherwise.


Copyright © 2001-2003 jpim team.