net.wimpi.pim.contact.basicimpl
Class PersonalIdentityImpl

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

public class PersonalIdentityImpl
extends java.lang.Object
implements PersonalIdentity

A basic and simple implementation of a PersonalIdentity.

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

Field Summary
protected  java.util.List m_AdditionalNames
           
protected  java.util.Date m_BirthDate
           
protected  java.lang.String m_Firstname
           
protected  java.lang.String m_FormattedName
           
protected  java.lang.String m_Lastname
           
protected  java.util.List m_Nicknames
           
protected  Image m_Photo
           
protected  java.util.List m_Prefixes
           
protected  java.lang.String m_SortString
           
protected  java.util.List m_Suffixes
           
 
Constructor Summary
PersonalIdentityImpl()
           
 
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 prefix)
          Adds a suffix.
 java.lang.String getAdditionalName(int num)
          Returns the additional name at the given index.
 int getAdditionalNameCount()
          Returns the number of additional names set for this PersonalIdentity.
 java.lang.String getAdditionalNamesList()
           
 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 num)
          Returns the nickname at the given index.
 int getNicknameCount()
          Returns the number of nicknames set for this PersonalIdentity.
 java.lang.String getNicknamesList()
           
 Image getPhoto()
          Returns the photo associated with this PersonalIdentity.
 java.lang.String getPrefix(int num)
          Returns the prefix at the given index.
 java.lang.String getPrefixesList()
           
 java.lang.String getSortString()
          Returns the sort string.
 java.lang.String getSuffix(int num)
          Returns the suffix at the given index.
 java.lang.String getSuffixesList()
           
 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 num)
          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 num)
          Removes and returns a nickname at a given index.
 java.lang.String removePrefix(int num)
          Removes and returns a prefix at a given index.
 java.lang.String removeSuffix(int num)
          Removes and returns a suffix at a given index.
 java.lang.String setAdditionalName(int num, java.lang.String name)
          Sets the additional name at the given index, returning the replaced one.
 void setAdditionalNamesList(java.lang.String list)
           
 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 num, java.lang.String name)
          Sets the nickname at the given index, returning the replaced one.
 void setNicknamesList(java.lang.String list)
           
 void setPhoto(Image photo)
          Sets the photo associated with this PersonalIdentity.
 java.lang.String setPrefix(int num, java.lang.String prefix)
          Sets the prefix at the given index, returning the replaced one.
 void setPrefixesList(java.lang.String list)
           
 void setSortString(java.lang.String sortstr)
          Sets the sort string.
 java.lang.String setSuffix(int num, java.lang.String suffix)
          Sets the suffix at the given index, returning the replaced one.
 void setSuffixesList(java.lang.String list)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_FormattedName

protected java.lang.String m_FormattedName

m_Firstname

protected java.lang.String m_Firstname

m_Lastname

protected java.lang.String m_Lastname

m_SortString

protected java.lang.String m_SortString

m_AdditionalNames

protected java.util.List m_AdditionalNames

m_Nicknames

protected java.util.List m_Nicknames

m_Prefixes

protected java.util.List m_Prefixes

m_Suffixes

protected java.util.List m_Suffixes

m_BirthDate

protected java.util.Date m_BirthDate

m_Photo

protected Image m_Photo
Constructor Detail

PersonalIdentityImpl

public PersonalIdentityImpl()
Method Detail

getFirstname

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

Specified by:
getFirstname in interface PersonalIdentity
Returns:
the firstname as String.

setFirstname

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

Specified by:
setFirstname in interface PersonalIdentity
Parameters:
name - the firstname as String.

getLastname

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

Specified by:
getLastname in interface PersonalIdentity
Returns:
the lastname as String.

setLastname

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

Specified by:
setLastname in interface PersonalIdentity
Parameters:
name - the firstname as String.

getAdditionalNamesList

public java.lang.String getAdditionalNamesList()

setAdditionalNamesList

public void setAdditionalNamesList(java.lang.String list)

listAdditionalNames

public java.lang.String[] listAdditionalNames()
Description copied from interface: PersonalIdentity
Returns all additional names associated with this PersonalIdentity.

Specified by:
listAdditionalNames in interface PersonalIdentity
Returns:
the names as String[].

getAdditionalName

public java.lang.String getAdditionalName(int num)
                                   throws java.lang.IndexOutOfBoundsException
Description copied from interface: PersonalIdentity
Returns the additional name at the given index.

Specified by:
getAdditionalName in interface PersonalIdentity
Parameters:
num - 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 num,
                                          java.lang.String name)
Description copied from interface: PersonalIdentity
Sets the additional name at the given index, returning the replaced one.

Specified by:
setAdditionalName in interface PersonalIdentity
Parameters:
num - the index as int.
name - the name to be set as String.
Returns:
the replaced name as String.

addAdditionalName

public void addAdditionalName(java.lang.String name)
Description copied from interface: PersonalIdentity
Adds an additional name.

Specified by:
addAdditionalName in interface PersonalIdentity
Parameters:
name - the name as String.

removeAdditionalName

public java.lang.String removeAdditionalName(int num)
                                      throws java.lang.IndexOutOfBoundsException
Description copied from interface: PersonalIdentity
Removes and returns an additional name at a given index.

Specified by:
removeAdditionalName in interface PersonalIdentity
Parameters:
num - 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()
Description copied from interface: PersonalIdentity
Removes all additional names.

Specified by:
removeAllAdditionalNames in interface PersonalIdentity

getAdditionalNameCount

public int getAdditionalNameCount()
Description copied from interface: PersonalIdentity
Returns the number of additional names set for this PersonalIdentity.

Specified by:
getAdditionalNameCount in interface PersonalIdentity
Returns:
the number as int.

getNicknamesList

public java.lang.String getNicknamesList()

setNickname

public java.lang.String setNickname(int num,
                                    java.lang.String name)
Description copied from interface: PersonalIdentity
Sets the nickname at the given index, returning the replaced one.

Specified by:
setNickname in interface PersonalIdentity
Parameters:
num - the index as int.
name - the name to be set as String.
Returns:
the replaced name as String.

setNicknamesList

public void setNicknamesList(java.lang.String list)

listNicknames

public java.lang.String[] listNicknames()
Description copied from interface: PersonalIdentity
Returns all nicknames associated with this PersonalIdentity.

Specified by:
listNicknames in interface PersonalIdentity
Returns:
the names as String[].

getNickname

public java.lang.String getNickname(int num)
                             throws java.lang.IndexOutOfBoundsException
Description copied from interface: PersonalIdentity
Returns the nickname at the given index.

Specified by:
getNickname in interface PersonalIdentity
Parameters:
num - the index as int.
Returns:
the name as String.
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of bounds.

addNickname

public void addNickname(java.lang.String name)
Description copied from interface: PersonalIdentity
Adds a nickname.

Specified by:
addNickname in interface PersonalIdentity
Parameters:
name - the name as String.

removeNickname

public java.lang.String removeNickname(int num)
                                throws java.lang.IndexOutOfBoundsException
Description copied from interface: PersonalIdentity
Removes and returns a nickname at a given index.

Specified by:
removeNickname in interface PersonalIdentity
Parameters:
num - 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()
Description copied from interface: PersonalIdentity
Removes all nicknames.

Specified by:
removeAllNicknames in interface PersonalIdentity

getNicknameCount

public int getNicknameCount()
Description copied from interface: PersonalIdentity
Returns the number of nicknames set for this PersonalIdentity.

Specified by:
getNicknameCount in interface PersonalIdentity
Returns:
the number as int.

getPrefixesList

public java.lang.String getPrefixesList()

setPrefixesList

public void setPrefixesList(java.lang.String list)

listPrefixes

public java.lang.String[] listPrefixes()
Description copied from interface: PersonalIdentity
Returns all prefixes associated with this PersonalIdentity.

Specified by:
listPrefixes in interface PersonalIdentity
Returns:
the prefixes as String[].

getPrefix

public java.lang.String getPrefix(int num)
                           throws java.lang.IndexOutOfBoundsException
Description copied from interface: PersonalIdentity
Returns the prefix at the given index.

Specified by:
getPrefix in interface PersonalIdentity
Parameters:
num - 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 num,
                                  java.lang.String prefix)
Description copied from interface: PersonalIdentity
Sets the prefix at the given index, returning the replaced one.

Specified by:
setPrefix in interface PersonalIdentity
Parameters:
num - the index as int.
prefix - the prefix to be set as String.
Returns:
the replaced prefix as String.

addPrefix

public void addPrefix(java.lang.String prefix)
Description copied from interface: PersonalIdentity
Adds a prefix.

Specified by:
addPrefix in interface PersonalIdentity
Parameters:
prefix - the prefix as String.

removePrefix

public java.lang.String removePrefix(int num)
                              throws java.lang.IndexOutOfBoundsException
Description copied from interface: PersonalIdentity
Removes and returns a prefix at a given index.

Specified by:
removePrefix in interface PersonalIdentity
Parameters:
num - 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()
Description copied from interface: PersonalIdentity
Removes all prefixes.

Specified by:
removeAllPrefixes in interface PersonalIdentity

getSuffixesList

public java.lang.String getSuffixesList()

setSuffixesList

public void setSuffixesList(java.lang.String list)

listSuffixes

public java.lang.String[] listSuffixes()
Description copied from interface: PersonalIdentity
Returns all suffixes associated with this PersonalIdentity.

Specified by:
listSuffixes in interface PersonalIdentity
Returns:
the suffixes as String[].

getSuffix

public java.lang.String getSuffix(int num)
                           throws java.lang.IndexOutOfBoundsException
Description copied from interface: PersonalIdentity
Returns the suffix at the given index.

Specified by:
getSuffix in interface PersonalIdentity
Parameters:
num - 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 num,
                                  java.lang.String suffix)
Description copied from interface: PersonalIdentity
Sets the suffix at the given index, returning the replaced one.

Specified by:
setSuffix in interface PersonalIdentity
Parameters:
num - the index as int.
suffix - the suffix to be set as String.
Returns:
the replaced suffix as String.

addSuffix

public void addSuffix(java.lang.String prefix)
Description copied from interface: PersonalIdentity
Adds a suffix.

Specified by:
addSuffix in interface PersonalIdentity
Parameters:
prefix - the suffix as String.

removeSuffix

public java.lang.String removeSuffix(int num)
                              throws java.lang.IndexOutOfBoundsException
Description copied from interface: PersonalIdentity
Removes and returns a suffix at a given index.

Specified by:
removeSuffix in interface PersonalIdentity
Parameters:
num - 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()
Description copied from interface: PersonalIdentity
Removes all suffixes.

Specified by:
removeAllSuffixes in interface PersonalIdentity

getBirthDate

public java.util.Date getBirthDate()
Description copied from interface: PersonalIdentity
Returns the birth date.

Specified by:
getBirthDate in interface PersonalIdentity
Returns:
the birth date as Date.

setBirthDate

public void setBirthDate(java.util.Date birthdate)
Description copied from interface: PersonalIdentity
Sets the birth date.

Specified by:
setBirthDate in interface PersonalIdentity
Parameters:
birthdate - the birth date as Date.

getFormattedName

public java.lang.String getFormattedName()
Description copied from interface: PersonalIdentity
Returns the formatted name.

Specified by:
getFormattedName in interface PersonalIdentity
Returns:
the formatted name as String.

setFormattedName

public void setFormattedName(java.lang.String fn)
Description copied from interface: PersonalIdentity
Sets the formatted name.

Specified by:
setFormattedName in interface PersonalIdentity
Parameters:
fn - the formatted name as String.

setSortString

public void setSortString(java.lang.String sortstr)
Description copied from interface: PersonalIdentity
Sets the sort string.

Specified by:
setSortString in interface PersonalIdentity
Parameters:
sortstr - the sort string as String.

getSortString

public java.lang.String getSortString()
Description copied from interface: PersonalIdentity
Returns the sort string.

Specified by:
getSortString in interface PersonalIdentity
Returns:
the sort string as String.

getPhoto

public Image getPhoto()
Description copied from interface: PersonalIdentity
Returns the photo associated with this PersonalIdentity.

Specified by:
getPhoto in interface PersonalIdentity
Returns:
the photo as Image.

setPhoto

public void setPhoto(Image photo)
Description copied from interface: PersonalIdentity
Sets the photo associated with this PersonalIdentity.

Specified by:
setPhoto in interface PersonalIdentity
Parameters:
photo - the photo as Image.

hasPhoto

public boolean hasPhoto()
Description copied from interface: PersonalIdentity
Tests if this PersonalIdentity has a photo associated.

Specified by:
hasPhoto in interface PersonalIdentity
Returns:
true if it has a photo, false otherwise.


Copyright © 2001-2003 jpim team.