net.wimpi.pim.contact.model
Interface PersonalIdentity

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

public interface PersonalIdentity
extends java.io.Serializable

An interface modeling the personal identity of a contact based on the types and information defined by the vCard Mime directory profile standard.

For reference see RFC 2426:
3.1 Identification Types
3.1.1 FN Type Definition
3.1.2 N Type Definition
3.1.3 NICKNAME Type Definition
3.1.4 PHOTO Type Definition
3.1.5 BDAY Type Definition
3.6.5 SORT-STRING Type Definition

Note that the formatted name is based on the semantics of the X.520 Common Name attribute and represents a required field for vCards.
The N type has been split up into Last (Family) Name, First (Given) Name, Additional Names, (Honorific) Prefixes, and (Honorific) Suffixes (with their respective accessor and mutator methods).

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

Method Summary
 void addAdditionalName(java.lang.String name)
          Adds an additional name.
 void addNickname(java.lang.String name)
          Adds a nickname.
 void addPrefix(java.lang.String prefix)
          Adds a prefix.
 void addSuffix(java.lang.String suffix)
          Adds a suffix.
 java.lang.String getAdditionalName(int index)
          Returns the additional name at the given index.
 int getAdditionalNameCount()
          Returns the number of additional names set for this PersonalIdentity.
 java.util.Date getBirthDate()
          Returns the birth date.
 java.lang.String getFirstname()
          Returns the firstname of this PersonalIdentity.
 java.lang.String getFormattedName()
          Returns the formatted name.
 java.lang.String getLastname()
          Returns the lastname of this PersonalIdentity.
 java.lang.String getNickname(int index)
          Returns the nickname at the given index.
 int getNicknameCount()
          Returns the number of nicknames set for this PersonalIdentity.
 Image getPhoto()
          Returns the photo associated with this PersonalIdentity.
 java.lang.String getPrefix(int index)
          Returns the prefix at the given index.
 java.lang.String getSortString()
          Returns the sort string.
 java.lang.String getSuffix(int index)
          Returns the suffix at the given index.
 boolean hasPhoto()
          Tests if this PersonalIdentity has a photo associated.
 java.lang.String[] listAdditionalNames()
          Returns all additional names associated with this PersonalIdentity.
 java.lang.String[] listNicknames()
          Returns all nicknames associated with this PersonalIdentity.
 java.lang.String[] listPrefixes()
          Returns all prefixes associated with this PersonalIdentity.
 java.lang.String[] listSuffixes()
          Returns all suffixes associated with this PersonalIdentity.
 java.lang.String removeAdditionalName(int index)
          Removes and returns an additional name at a given index.
 void removeAllAdditionalNames()
          Removes all additional names.
 void removeAllNicknames()
          Removes all nicknames.
 void removeAllPrefixes()
          Removes all prefixes.
 void removeAllSuffixes()
          Removes all suffixes.
 java.lang.String removeNickname(int index)
          Removes and returns a nickname at a given index.
 java.lang.String removePrefix(int index)
          Removes and returns a prefix at a given index.
 java.lang.String removeSuffix(int index)
          Removes and returns a suffix at a given index.
 java.lang.String setAdditionalName(int index, java.lang.String name)
          Sets the additional name at the given index, returning the replaced one.
 void setBirthDate(java.util.Date birthdate)
          Sets the birth date.
 void setFirstname(java.lang.String name)
          Sets the firstname of this PersonalIdentity.
 void setFormattedName(java.lang.String fn)
          Sets the formatted name.
 void setLastname(java.lang.String name)
          Sets the lastname of this PersonalIdentity.
 java.lang.String setNickname(int index, java.lang.String name)
          Sets the nickname at the given index, returning the replaced one.
 void setPhoto(Image photo)
          Sets the photo associated with this PersonalIdentity.
 java.lang.String setPrefix(int index, java.lang.String prefix)
          Sets the prefix at the given index, returning the replaced one.
 void setSortString(java.lang.String sortstr)
          Sets the sort string.
 java.lang.String setSuffix(int index, java.lang.String suffix)
          Sets the suffix at the given index, returning the replaced one.
 

Method Detail

getFirstname

public java.lang.String getFirstname()
Returns the firstname of this PersonalIdentity. The firstname is also referred to as given name.

Returns:
the firstname as String.

setFirstname

public void setFirstname(java.lang.String name)
Sets the firstname of this PersonalIdentity. The firstname is also referred to as given name.

Parameters:
name - the firstname as String.

getLastname

public java.lang.String getLastname()
Returns the lastname of this PersonalIdentity. The lastname is also referred to as family name.

Returns:
the lastname as String.

setLastname

public void setLastname(java.lang.String name)
Sets the lastname of this PersonalIdentity. The lastname is also referred to as family name.

Parameters:
name - the firstname as String.

listAdditionalNames

public java.lang.String[] listAdditionalNames()
Returns all additional names associated with this PersonalIdentity.

Returns:
the names as String[].

getAdditionalName

public java.lang.String getAdditionalName(int index)
                                   throws java.lang.IndexOutOfBoundsException
Returns the additional name at the given index.

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

setAdditionalName

public java.lang.String setAdditionalName(int index,
                                          java.lang.String name)
                                   throws java.lang.IndexOutOfBoundsException
Sets the additional name at the given index, returning the replaced one.

Parameters:
index - the index as int.
name - the name to be set as String.
Returns:
the replaced name as String.
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of bounds.

addAdditionalName

public void addAdditionalName(java.lang.String name)
Adds an additional name.

Parameters:
name - the name as String.

removeAdditionalName

public java.lang.String removeAdditionalName(int index)
                                      throws java.lang.IndexOutOfBoundsException
Removes and returns an additional name at a given index.

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

removeAllAdditionalNames

public void removeAllAdditionalNames()
Removes all additional names.


getAdditionalNameCount

public int getAdditionalNameCount()
Returns the number of additional names set for this PersonalIdentity.

Returns:
the number as int.

listNicknames

public java.lang.String[] listNicknames()
Returns all nicknames associated with this PersonalIdentity.

Returns:
the names as String[].

getNickname

public java.lang.String getNickname(int index)
                             throws java.lang.IndexOutOfBoundsException
Returns the nickname at the given index.

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

setNickname

public java.lang.String setNickname(int index,
                                    java.lang.String name)
                             throws java.lang.IndexOutOfBoundsException
Sets the nickname at the given index, returning the replaced one.

Parameters:
index - the index as int.
name - the name to be set as String.
Returns:
the replaced name as String.
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of bounds.

addNickname

public void addNickname(java.lang.String name)
Adds a nickname.

Parameters:
name - the name as String.

removeNickname

public java.lang.String removeNickname(int index)
                                throws java.lang.IndexOutOfBoundsException
Removes and returns a nickname at a given index.

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

removeAllNicknames

public void removeAllNicknames()
Removes all nicknames.


getNicknameCount

public int getNicknameCount()
Returns the number of nicknames set for this PersonalIdentity.

Returns:
the number as int.

listPrefixes

public java.lang.String[] listPrefixes()
Returns all prefixes associated with this PersonalIdentity.

Returns:
the prefixes as String[].

getPrefix

public java.lang.String getPrefix(int index)
                           throws java.lang.IndexOutOfBoundsException
Returns the prefix at the given index.

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

setPrefix

public java.lang.String setPrefix(int index,
                                  java.lang.String prefix)
                           throws java.lang.IndexOutOfBoundsException
Sets the prefix at the given index, returning the replaced one.

Parameters:
index - the index as int.
prefix - the prefix to be set as String.
Returns:
the replaced prefix as String.
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of bounds.

addPrefix

public void addPrefix(java.lang.String prefix)
Adds a prefix.

Parameters:
prefix - the prefix as String.

removePrefix

public java.lang.String removePrefix(int index)
                              throws java.lang.IndexOutOfBoundsException
Removes and returns a prefix at a given index.

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

removeAllPrefixes

public void removeAllPrefixes()
Removes all prefixes.


listSuffixes

public java.lang.String[] listSuffixes()
Returns all suffixes associated with this PersonalIdentity.

Returns:
the suffixes as String[].

getSuffix

public java.lang.String getSuffix(int index)
                           throws java.lang.IndexOutOfBoundsException
Returns the suffix at the given index.

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

setSuffix

public java.lang.String setSuffix(int index,
                                  java.lang.String suffix)
                           throws java.lang.IndexOutOfBoundsException
Sets the suffix at the given index, returning the replaced one.

Parameters:
index - the index as int.
suffix - the suffix to be set as String.
Returns:
the replaced suffix as String.
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of bounds.

addSuffix

public void addSuffix(java.lang.String suffix)
Adds a suffix.

Parameters:
suffix - the suffix as String.

removeSuffix

public java.lang.String removeSuffix(int index)
                              throws java.lang.IndexOutOfBoundsException
Removes and returns a suffix at a given index.

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

removeAllSuffixes

public void removeAllSuffixes()
Removes all suffixes.


getBirthDate

public java.util.Date getBirthDate()
Returns the birth date.

Returns:
the birth date as Date.

setBirthDate

public void setBirthDate(java.util.Date birthdate)
Sets the birth date.

Parameters:
birthdate - the birth date as Date.

getFormattedName

public java.lang.String getFormattedName()
Returns the formatted name.

Returns:
the formatted name as String.

setFormattedName

public void setFormattedName(java.lang.String fn)
Sets the formatted name.

Parameters:
fn - the formatted name as String.

getSortString

public java.lang.String getSortString()
Returns the sort string.

Returns:
the sort string as String.

setSortString

public void setSortString(java.lang.String sortstr)
Sets the sort string.

Parameters:
sortstr - the sort string as String.

getPhoto

public Image getPhoto()
Returns the photo associated with this PersonalIdentity.

Returns:
the photo as Image.

setPhoto

public void setPhoto(Image photo)
Sets the photo associated with this PersonalIdentity.

Parameters:
photo - the photo as Image.

hasPhoto

public boolean hasPhoto()
Tests if this PersonalIdentity has a photo associated.

Returns:
true if it has a photo, false otherwise.


Copyright © 2001-2003 jpim team.