BEA Systems, Inc.

theory.smart.axiom.contact
Interface Stakeholder

All Known Subinterfaces:
Customer, Person

public interface Stakeholder
extends Entity

A Stakeholder represents a personal or business contact. It is a holder for any type of information that might be used to communicate with that entity. Specifically, it provides a a collection of Postal Addresses, Phone Numbers, Emails, and Urls. It includes special functions for handling addresses as described in the getPrimaryAddress and getNamedAddress methods..

 Primary Key = theory.smart.axiom.contact.StakeholderPk
 
                  identifier
 [Stakeholder] <*>------> [String] (Primary Key)

 
                  description
 [Stakeholder] <*>------> [String] 

 
                  email (Map)
 [Stakeholder] <*>------> [theory.smart.axiom.contact.Email] 
                     0..*
 
                  phone (Map)
 [Stakeholder] <*>------> [theory.smart.axiom.contact.PhoneNumber] 
                     0..*
 
                  fax (List)
 [Stakeholder] <*>------> [theory.smart.axiom.contact.PhoneNumber] 
                     0..*
 
                  url (Map)
 [Stakeholder] <*>------> [theory.smart.axiom.contact.Url] 
                     0..*
 
                  address (Map)
 [Stakeholder] <*>------> [theory.smart.axiom.contact.Address] 
                     0..*
 

See Also:
StakeholderPk, StakeholderHome, StakeholderImpl, StakeholderValue

Method Summary
 void addFax(int index, PhoneNumber fax)
          Inserts the specified fax at the specified position in the fax list.
 boolean addFax(PhoneNumber fax)
          Appends the specified fax to the end of the fax list.
 boolean addFaxes(int index, com.sun.java.util.collections.LinkedList faxes)
          Inserts all of the faxes in the specified collection into this list, starting at the specified position.
 boolean addFaxes(com.sun.java.util.collections.LinkedList faxes)
          Appends all of the faxes in the specified collection to the end of the fax list, in the order that they are returned by the specified collection's iterator.
 void addFirstFax(PhoneNumber fax)
          Inserts the given fax at the beginning of the fax list.
 void addLastFax(PhoneNumber fax)
          Appends the given fax to the end of the fax list.
 boolean containsAddressKey(java.lang.String key)
          Returns true if the address map contains a address for the specified key.
 boolean containsAddressValue(Address address)
          Returns true if the address map maps one or more keys to the specified address.
 boolean containsEmailKey(java.lang.String key)
          Returns true if the email map contains a email for the specified key.
 boolean containsEmailValue(Email email)
          Returns true if the email map maps one or more keys to the specified email.
 boolean containsFax(PhoneNumber fax)
          Returns true if the fax list contains the specified element.
 boolean containsPhoneKey(java.lang.String key)
          Returns true if the phone map contains a phone for the specified key.
 boolean containsPhoneValue(PhoneNumber phone)
          Returns true if the phone map maps one or more keys to the specified phone.
 boolean containsUrlKey(java.lang.String key)
          Returns true if the url map contains a url for the specified key.
 boolean containsUrlValue(Url url)
          Returns true if the url map maps one or more keys to the specified url.
 Address getAddressByKey(java.lang.String key)
          Returns the address to which the address map maps the specified key.
 com.sun.java.util.collections.TreeMap getAddresses()
          Returns a copy all of the addresses from the specified map to the address map.
 java.lang.String getDescription()
          Get the value of description
 Email getEmailByKey(java.lang.String key)
          Returns the email to which the email map maps the specified key.
 com.sun.java.util.collections.TreeMap getEmails()
          Returns a copy all of the emails from the specified map to the email map.
 PhoneNumber getFax(int index)
          Returns the fax at the specified position in the fax list.
 com.sun.java.util.collections.LinkedList getFaxes()
          Returns all of the faxes in the fax list.
 com.sun.java.util.collections.LinkedList getFaxes(int fromIndex, int toIndex)
          Returns a view of the portion of the fax list between fromIndex, inclusive, and toIndex, exclusive.
 PhoneNumber getFirstFax()
          Returns the first fax in the fax list.
 java.lang.String getIdentifier()
           
 PhoneNumber getLastFax()
          Returns the last fax in the fax list.
 Address getNamedAddress(java.lang.String name)
          Returns the address specified by the name.
 int getNumberOfAddresses()
          Returns the number of key-value mappings in the address map.
 int getNumberOfEmails()
          Returns the number of key-value mappings in the email map.
 int getNumberOfFaxes()
          Returns the number of faxes in the fax list.
 int getNumberOfPhones()
          Returns the number of key-value mappings in the phone map.
 int getNumberOfUrls()
          Returns the number of key-value mappings in the url map.
 PhoneNumber getPhoneByKey(java.lang.String key)
          Returns the phone to which the phone map maps the specified key.
 com.sun.java.util.collections.TreeMap getPhones()
          Returns a copy all of the phones from the specified map to the phone map.
 Address getPrimaryAddress()
          Get address that is tagged as the primary address.
 StakeholderValue getStakeholderByValue()
          Get all of Stakeholder's attributes.
 Url getUrlByKey(java.lang.String key)
          Returns the url to which the url map maps the specified key.
 com.sun.java.util.collections.TreeMap getUrls()
          Returns a copy all of the urls from the specified map to the url map.
 int indexOfFax(PhoneNumber fax)
          Returns the index in the fax list of the first occurrence of the specified element, or -1 if the fax list does not contain this element.
 boolean isAddressesEmpty()
          Returns true if the address map contains no key-value mappings.
 boolean isEmailsEmpty()
          Returns true if the email map contains no key-value mappings.
 boolean isFaxesEmtpy()
          Returns true if the fax list contains no faxes.
 boolean isPhonesEmpty()
          Returns true if the phone map contains no key-value mappings.
 boolean isUrlsEmpty()
          Returns true if the url map contains no key-value mappings.
 int lastIndexOfFax(PhoneNumber fax)
          Returns the index in the fax list of the last occurrence of the specified element, or -1 if the fax list does not contain this element.
 void putAddress(java.lang.String key, Address address)
          Associates the specified address with the specified key in the address map.
 void putAddresses(com.sun.java.util.collections.TreeMap addresses)
          Copies all of the addresses from the specified address map to this address map.
 void putEmail(java.lang.String key, Email email)
          Associates the specified email with the specified key in the email map.
 void putEmails(com.sun.java.util.collections.TreeMap emails)
          Copies all of the emails from the specified email map to this email map.
 void putPhone(java.lang.String key, PhoneNumber phone)
          Associates the specified phone with the specified key in the phone map.
 void putPhones(com.sun.java.util.collections.TreeMap phones)
          Copies all of the phones from the specified phone map to this phone map.
 void putUrl(java.lang.String key, Url url)
          Associates the specified url with the specified key in the url map.
 void putUrls(com.sun.java.util.collections.TreeMap urls)
          Copies all of the urls from the specified url map to this url map.
 Address removeAddressByKey(java.lang.String key)
          Removes the address for this key from this address map if present.
 void removeAllAddresses()
          Removes all addresses from this address map.
 void removeAllEmails()
          Removes all emails from this email map.
 void removeAllFaxes()
          Removes all of the faxes from the fax list.
 void removeAllPhones()
          Removes all phones from this phone map.
 void removeAllUrls()
          Removes all urls from this url map.
 Email removeEmailByKey(java.lang.String key)
          Removes the email for this key from this email map if present.
 PhoneNumber removeFax(int index)
          Removes the fax at the specified position in the fax list.
 boolean removeFax(PhoneNumber fax)
          Removes the first occurrence of the specified fax in the fax list.
 PhoneNumber removeFirstFax()
          Removes and returns the first fax from the fax list.
 PhoneNumber removeLastFax()
          Removes and returns the last fax from the fax list.
 PhoneNumber removePhoneByKey(java.lang.String key)
          Removes the phone for this key from this phone map if present.
 Url removeUrlByKey(java.lang.String key)
          Removes the url for this key from this url map if present.
 void setDescription(java.lang.String description)
          Set the value of description
 PhoneNumber setFax(int index, PhoneNumber fax)
          Replaces the fax at the specified position in the fax list with the specified element.
 void setPrimaryAddress(Address addr, java.lang.String name)
          This method is used to set a special address that will be the value returned by getPrimaryAddress.
 void setStakeholderByValue(StakeholderValue value)
          Set all of Stakeholder's attributes to the passed in value.
 
Methods inherited from interface javax.ejb.EJBObject
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove
 

Method Detail

getStakeholderByValue

public StakeholderValue getStakeholderByValue()
                                       throws java.rmi.RemoteException
Get all of Stakeholder's attributes.
Returns:
StakeholderValue the Stakeholder value object

setStakeholderByValue

public void setStakeholderByValue(StakeholderValue value)
                           throws java.rmi.RemoteException
Set all of Stakeholder's attributes to the passed in value. Note: Primary key attributes are not set.
Parameters:
StakeholderValue - the Stakeholder value object

getIdentifier

public java.lang.String getIdentifier()
                               throws java.rmi.RemoteException

getDescription

public java.lang.String getDescription()
                                throws java.rmi.RemoteException
Get the value of description
Returns:
description.

setDescription

public void setDescription(java.lang.String description)
                    throws java.rmi.RemoteException
Set the value of description
Parameters:
descriptions - description to be added

containsEmailKey

public boolean containsEmailKey(java.lang.String key)
                         throws java.rmi.RemoteException
Returns true if the email map contains a email for the specified key.
Parameters:
key - key whose presence in the email map is to be tested.
Returns:
true if the email map contains a email for the specified key.
Throws:
ClassCastException - if the key cannot be compared with the keys currently in the map.
NullPointerException - key is null and the email map uses natural ordering, or its comparator does not tolerate null keys.

containsEmailValue

public boolean containsEmailValue(Email email)
                           throws java.rmi.RemoteException
Returns true if the email map maps one or more keys to the specified email. This operation will probably require linear time.
Parameters:
email - value of email whose presence in the email map is to be tested.

getEmailByKey

public Email getEmailByKey(java.lang.String key)
                    throws java.rmi.RemoteException
Returns the email to which the email map maps the specified key. Returns null if the map contains no email for this key. A return value of null does not necessarily indicate that the map contains no email for the key; it's also possible that the map explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases.
Parameters:
key - key whose associated email is to be returned.
Returns:
the email to which the email map maps the specified key, or null if the map contains no email for the key.
Throws:
ClassCastException - key cannot be compared with the keys currently in the map.
NullPointerException - key is null and the email map uses natural ordering, or its comparator does not tolerate null keys.
See Also:
#containsKey(Object)

getEmails

public com.sun.java.util.collections.TreeMap getEmails()
                                                throws java.rmi.RemoteException
Returns a copy all of the emails from the specified map to the email map. These emails replace any emails that the email map had for any of the keys currently in the specified map.
Parameters:
emails - a copy of the emails.
Throws:
ClassCastException - class of a key or email in the specified map prevents it from being stored in the email map.
NullPointerException - the email map does not permit null keys and a specified key is null.

getNumberOfEmails

public int getNumberOfEmails()
                      throws java.rmi.RemoteException
Returns the number of key-value mappings in the email map.
Returns:
the number of key-value mappings in the email map.

isEmailsEmpty

public boolean isEmailsEmpty()
                      throws java.rmi.RemoteException
Returns true if the email map contains no key-value mappings.

Returns:
true if the email map contains no key-value mappings.

putEmail

public void putEmail(java.lang.String key,
                     Email email)
              throws java.rmi.RemoteException
Associates the specified email with the specified key in the email map. If the map previously contained a email for this key, the old email is replaced.
Parameters:
key - key with which the specified email is to be associated.
email - email to be associated with the specified key.
Throws:
ClassCastException - key cannot be compared with the keys currently in the map.
NullPointerException - key is null and the email map uses natural order, or its comparator does not tolerate null keys.

putEmails

public void putEmails(com.sun.java.util.collections.TreeMap emails)
               throws java.rmi.RemoteException
Copies all of the emails from the specified email map to this email map. These emails replace any emails that this email map had for any of the keys currently in the specified map.
Parameters:
email - Emails to be stored in the email map.
Throws:
ClassCastException - class of a key or email in the specified map prevents it from being stored in the email map.
NullPointerException - the email map does not permit null keys and a specified key is null.

removeAllEmails

public void removeAllEmails()
                     throws java.rmi.RemoteException
Removes all emails from this email map.

removeEmailByKey

public Email removeEmailByKey(java.lang.String key)
                       throws java.rmi.RemoteException
Removes the email for this key from this email map if present.
Parameters:
key - key with which the specified email is associated.
Returns:
previous email associated with specified key, or null if there was no email for key. A null return can also indicate that the map previously associated null with the specified key.
Throws:
ClassCastException - key cannot be compared with the keys currently in the map.
NullPointerException - key is null and the email map uses natural order, or its comparator does not tolerate null keys.

containsPhoneKey

public boolean containsPhoneKey(java.lang.String key)
                         throws java.rmi.RemoteException
Returns true if the phone map contains a phone for the specified key.
Parameters:
key - key whose presence in the phone map is to be tested.
Returns:
true if the phone map contains a phone for the specified key.
Throws:
ClassCastException - if the key cannot be compared with the keys currently in the map.
NullPointerException - key is null and the phone map uses natural ordering, or its comparator does not tolerate null keys.

containsPhoneValue

public boolean containsPhoneValue(PhoneNumber phone)
                           throws java.rmi.RemoteException
Returns true if the phone map maps one or more keys to the specified phone. This operation will probably require linear time.
Parameters:
phone - value of phone whose presence in the phone map is to be tested.

getPhoneByKey

public PhoneNumber getPhoneByKey(java.lang.String key)
                          throws java.rmi.RemoteException
Returns the phone to which the phone map maps the specified key. Returns null if the map contains no phone for this key. A return value of null does not necessarily indicate that the map contains no phone for the key; it's also possible that the map explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases.
Parameters:
key - key whose associated phone is to be returned.
Returns:
the phone to which the phone map maps the specified key, or null if the map contains no phone for the key.
Throws:
ClassCastException - key cannot be compared with the keys currently in the map.
NullPointerException - key is null and the phone map uses natural ordering, or its comparator does not tolerate null keys.
See Also:
#containsKey(Object)

getPhones

public com.sun.java.util.collections.TreeMap getPhones()
                                                throws java.rmi.RemoteException
Returns a copy all of the phones from the specified map to the phone map. These phones replace any phones that the phone map had for any of the keys currently in the specified map.
Parameters:
phones - a copy of the phones.
Throws:
ClassCastException - class of a key or phone in the specified map prevents it from being stored in the phone map.
NullPointerException - the phone map does not permit null keys and a specified key is null.

getNumberOfPhones

public int getNumberOfPhones()
                      throws java.rmi.RemoteException
Returns the number of key-value mappings in the phone map.
Returns:
the number of key-value mappings in the phone map.

isPhonesEmpty

public boolean isPhonesEmpty()
                      throws java.rmi.RemoteException
Returns true if the phone map contains no key-value mappings.

Returns:
true if the phone map contains no key-value mappings.

putPhone

public void putPhone(java.lang.String key,
                     PhoneNumber phone)
              throws java.rmi.RemoteException
Associates the specified phone with the specified key in the phone map. If the map previously contained a phone for this key, the old phone is replaced.
Parameters:
key - key with which the specified phone is to be associated.
phone - phone to be associated with the specified key.
Throws:
ClassCastException - key cannot be compared with the keys currently in the map.
NullPointerException - key is null and the phone map uses natural order, or its comparator does not tolerate null keys.

putPhones

public void putPhones(com.sun.java.util.collections.TreeMap phones)
               throws java.rmi.RemoteException
Copies all of the phones from the specified phone map to this phone map. These phones replace any phones that this phone map had for any of the keys currently in the specified map.
Parameters:
phone - Phones to be stored in the phone map.
Throws:
ClassCastException - class of a key or phone in the specified map prevents it from being stored in the phone map.
NullPointerException - the phone map does not permit null keys and a specified key is null.

removeAllPhones

public void removeAllPhones()
                     throws java.rmi.RemoteException
Removes all phones from this phone map.

removePhoneByKey

public PhoneNumber removePhoneByKey(java.lang.String key)
                             throws java.rmi.RemoteException
Removes the phone for this key from this phone map if present.
Parameters:
key - key with which the specified phone is associated.
Returns:
previous phone associated with specified key, or null if there was no phone for key. A null return can also indicate that the map previously associated null with the specified key.
Throws:
ClassCastException - key cannot be compared with the keys currently in the map.
NullPointerException - key is null and the phone map uses natural order, or its comparator does not tolerate null keys.

addFax

public void addFax(int index,
                   PhoneNumber fax)
            throws java.rmi.RemoteException
Inserts the specified fax at the specified position in the fax list. Shifts the fax currently at that position (if any) and any subsequent faxes to the right (adds one to their indices).
Parameters:
index - index at which the specified fax is to be inserted.
fax - fax to be inserted.
Throws:
IndexOutOfBoundsException - if the specified index is out of range (index < 0 || index > size()).

addFax

public boolean addFax(PhoneNumber fax)
               throws java.rmi.RemoteException
Appends the specified fax to the end of the fax list.
Parameters:
fax - fax to be appended to the fax list.
Returns:
true (as per the general contract of Collection.add).

addFaxes

public boolean addFaxes(int index,
                        com.sun.java.util.collections.LinkedList faxes)
                 throws java.rmi.RemoteException
Inserts all of the faxes in the specified collection into this list, starting at the specified position. Shifts the element currently at that position (if any) and any subsequent faxes to the right (increases their indices). The new faxes will appear in the fax list in the order that they are returned by the specified collection's iterator.
Parameters:
index - index at which to insert first element from the specified collection.
faxes - faxes to be inserted into the fax list.
Throws:
IndexOutOfBoundsException - if the specified index is out of range (index < 0 || index > size()).

addFaxes

public boolean addFaxes(com.sun.java.util.collections.LinkedList faxes)
                 throws java.rmi.RemoteException
Appends all of the faxes in the specified collection to the end of the fax list, in the order that they are returned by the specified collection's iterator. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified Collection is the fax list, and the fax list is nonempty.)
Parameters:
faxes - faxes to be inserted into the fax list.
Throws:
IndexOutOfBoundsException - if the specified index is out of range (index < 0 || index > size()).

addFirstFax

public void addFirstFax(PhoneNumber fax)
                 throws java.rmi.RemoteException
Inserts the given fax at the beginning of the fax list.

addLastFax

public void addLastFax(PhoneNumber fax)
                throws java.rmi.RemoteException
Appends the given fax to the end of the fax list. (Identical in function to the add method; included only for consistency.)

containsFax

public boolean containsFax(PhoneNumber fax)
                    throws java.rmi.RemoteException
Returns true if the fax list contains the specified element. More formally, returns true if and only if the fax list contains at least one fax e such that (o==null ? e==null : o.equals(e)).
Parameters:
fax - fax whose presence in the fax list is to be tested.
Returns:
true if the fax list contains the specified element.

getFax

public PhoneNumber getFax(int index)
                   throws java.rmi.RemoteException
Returns the fax at the specified position in the fax list.
Parameters:
index - index of fax to return.
Returns:
the fax at the specified position in the fax list.
Throws:
IndexOutOfBoundsException - if the specified index is is out of range (index < 0 || index >= size()).

getFaxes

public com.sun.java.util.collections.LinkedList getFaxes(int fromIndex,
                                                         int toIndex)
                                                  throws java.rmi.RemoteException
Returns a view of the portion of the fax list between fromIndex, inclusive, and toIndex, exclusive.
Parameters:
fromIndex - low endpoint (inclusive) of the subList.
toKey - high endpoint (exclusive) of the subList.
Returns:
a view of the specified range within the fax list.
Throws:
IndexOutOfBoundsException - endpoint index value out of range (fromIndex < 0 || toIndex > size)
java.lang.IllegalArgumentException - endpoint indices out of order (fromIndex > toIndex)

getFaxes

public com.sun.java.util.collections.LinkedList getFaxes()
                                                  throws java.rmi.RemoteException
Returns all of the faxes in the fax list.
Returns:
all of the faxes in the fax list.

getFirstFax

public PhoneNumber getFirstFax()
                        throws java.rmi.RemoteException
Returns the first fax in the fax list.
Returns:
the first fax in the fax list.

getLastFax

public PhoneNumber getLastFax()
                       throws java.rmi.RemoteException
Returns the last fax in the fax list.
Returns:
the last fax in the fax list.
Throws:
java.util.NoSuchElementException - if the fax list is empty.

getNumberOfFaxes

public int getNumberOfFaxes()
                     throws java.rmi.RemoteException
Returns the number of faxes in the fax list.
Returns:
the number of faxes in the fax list.

indexOfFax

public int indexOfFax(PhoneNumber fax)
               throws java.rmi.RemoteException
Returns the index in the fax list of the first occurrence of the specified element, or -1 if the fax list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.
Parameters:
fax - fax to search for.
Returns:
the index in the fax list of the first occurrence of the specified element, or -1 if the fax list does not contain this element.

isFaxesEmtpy

public boolean isFaxesEmtpy()
                     throws java.rmi.RemoteException
Returns true if the fax list contains no faxes.

Returns:
true if the fax list contains no faxes.

lastIndexOfFax

public int lastIndexOfFax(PhoneNumber fax)
                   throws java.rmi.RemoteException
Returns the index in the fax list of the last occurrence of the specified element, or -1 if the fax list does not contain this element. More formally, returns the highest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.
Parameters:
fax - fax to search for.
Returns:
the index in the fax list of the last occurrence of the specified element, or -1 if the fax list does not contain this element.

removeAllFaxes

public void removeAllFaxes()
                    throws java.rmi.RemoteException
Removes all of the faxes from the fax list.

removeFax

public PhoneNumber removeFax(int index)
                      throws java.rmi.RemoteException
Removes the fax at the specified position in the fax list. Shifts any subsequent faxes to the left (subtracts one from their indices). Returns the fax that was removed from the fax list.
Parameters:
index - the index of the fax to removed.
Returns:
the fax previously at the specified position.
Throws:
IndexOutOfBoundsException - if the specified index is out of range (index < 0 || index >= size()).

removeFax

public boolean removeFax(PhoneNumber fax)
                  throws java.rmi.RemoteException
Removes the first occurrence of the specified fax in the fax list. If the fax list does not contain the element, it is unchanged. More formally, removes the fax with the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))) (if such an fax exists).
Parameters:
fax - fax to be removed from the fax list, if present.
Returns:
true if the fax list contained the specified element.

removeFirstFax

public PhoneNumber removeFirstFax()
                           throws java.rmi.RemoteException
Removes and returns the first fax from the fax list.
Returns:
the first fax from the fax list.
Throws:
java.util.NoSuchElementException - if the fax list is empty.

removeLastFax

public PhoneNumber removeLastFax()
                          throws java.rmi.RemoteException
Removes and returns the last fax from the fax list.
Returns:
the last fax from the fax list.
Throws:
java.util.NoSuchElementException - if the fax list is empty.

setFax

public PhoneNumber setFax(int index,
                          PhoneNumber fax)
                   throws java.rmi.RemoteException
Replaces the fax at the specified position in the fax list with the specified element.
Parameters:
index - index of fax to replace.
fax - fax to be stored at the specified position.
Returns:
the fax previously at the specified position.
Throws:
IndexOutOfBoundsException - if the specified index is out of range (index < 0 || index >= size()).

containsUrlKey

public boolean containsUrlKey(java.lang.String key)
                       throws java.rmi.RemoteException
Returns true if the url map contains a url for the specified key.
Parameters:
key - key whose presence in the url map is to be tested.
Returns:
true if the url map contains a url for the specified key.
Throws:
ClassCastException - if the key cannot be compared with the keys currently in the map.
NullPointerException - key is null and the url map uses natural ordering, or its comparator does not tolerate null keys.

containsUrlValue

public boolean containsUrlValue(Url url)
                         throws java.rmi.RemoteException
Returns true if the url map maps one or more keys to the specified url. This operation will probably require linear time.
Parameters:
url - value of url whose presence in the url map is to be tested.

getUrlByKey

public Url getUrlByKey(java.lang.String key)
                throws java.rmi.RemoteException
Returns the url to which the url map maps the specified key. Returns null if the map contains no url for this key. A return value of null does not necessarily indicate that the map contains no url for the key; it's also possible that the map explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases.
Parameters:
key - key whose associated url is to be returned.
Returns:
the url to which the url map maps the specified key, or null if the map contains no url for the key.
Throws:
ClassCastException - key cannot be compared with the keys currently in the map.
NullPointerException - key is null and the url map uses natural ordering, or its comparator does not tolerate null keys.
See Also:
#containsKey(Object)

getUrls

public com.sun.java.util.collections.TreeMap getUrls()
                                              throws java.rmi.RemoteException
Returns a copy all of the urls from the specified map to the url map. These urls replace any urls that the url map had for any of the keys currently in the specified map.
Parameters:
urls - a copy of the urls.
Throws:
ClassCastException - class of a key or url in the specified map prevents it from being stored in the url map.
NullPointerException - the url map does not permit null keys and a specified key is null.

getNumberOfUrls

public int getNumberOfUrls()
                    throws java.rmi.RemoteException
Returns the number of key-value mappings in the url map.
Returns:
the number of key-value mappings in the url map.

isUrlsEmpty

public boolean isUrlsEmpty()
                    throws java.rmi.RemoteException
Returns true if the url map contains no key-value mappings.

Returns:
true if the url map contains no key-value mappings.

putUrl

public void putUrl(java.lang.String key,
                   Url url)
            throws java.rmi.RemoteException
Associates the specified url with the specified key in the url map. If the map previously contained a url for this key, the old url is replaced.
Parameters:
key - key with which the specified url is to be associated.
url - url to be associated with the specified key.
Throws:
ClassCastException - key cannot be compared with the keys currently in the map.
NullPointerException - key is null and the url map uses natural order, or its comparator does not tolerate null keys.

putUrls

public void putUrls(com.sun.java.util.collections.TreeMap urls)
             throws java.rmi.RemoteException
Copies all of the urls from the specified url map to this url map. These urls replace any urls that this url map had for any of the keys currently in the specified map.
Parameters:
url - Urls to be stored in the url map.
Throws:
ClassCastException - class of a key or url in the specified map prevents it from being stored in the url map.
NullPointerException - the url map does not permit null keys and a specified key is null.

removeAllUrls

public void removeAllUrls()
                   throws java.rmi.RemoteException
Removes all urls from this url map.

removeUrlByKey

public Url removeUrlByKey(java.lang.String key)
                   throws java.rmi.RemoteException
Removes the url for this key from this url map if present.
Parameters:
key - key with which the specified url is associated.
Returns:
previous url associated with specified key, or null if there was no url for key. A null return can also indicate that the map previously associated null with the specified key.
Throws:
ClassCastException - key cannot be compared with the keys currently in the map.
NullPointerException - key is null and the url map uses natural order, or its comparator does not tolerate null keys.

containsAddressKey

public boolean containsAddressKey(java.lang.String key)
                           throws java.rmi.RemoteException
Returns true if the address map contains a address for the specified key.
Parameters:
key - key whose presence in the address map is to be tested.
Returns:
true if the address map contains a address for the specified key.
Throws:
ClassCastException - if the key cannot be compared with the keys currently in the map.
NullPointerException - key is null and the address map uses natural ordering, or its comparator does not tolerate null keys.

containsAddressValue

public boolean containsAddressValue(Address address)
                             throws java.rmi.RemoteException
Returns true if the address map maps one or more keys to the specified address. This operation will probably require linear time.
Parameters:
address - value of address whose presence in the address map is to be tested.

getAddressByKey

public Address getAddressByKey(java.lang.String key)
                        throws java.rmi.RemoteException
Returns the address to which the address map maps the specified key. Returns null if the map contains no address for this key. A return value of null does not necessarily indicate that the map contains no address for the key; it's also possible that the map explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases.
Parameters:
key - key whose associated address is to be returned.
Returns:
the address to which the address map maps the specified key, or null if the map contains no address for the key.
Throws:
ClassCastException - key cannot be compared with the keys currently in the map.
NullPointerException - key is null and the address map uses natural ordering, or its comparator does not tolerate null keys.
See Also:
#containsKey(Object)

getAddresses

public com.sun.java.util.collections.TreeMap getAddresses()
                                                   throws java.rmi.RemoteException
Returns a copy all of the addresses from the specified map to the address map. These addresses replace any addresses that the address map had for any of the keys currently in the specified map.
Parameters:
addresses - a copy of the addresses.
Throws:
ClassCastException - class of a key or address in the specified map prevents it from being stored in the address map.
NullPointerException - the address map does not permit null keys and a specified key is null.

getNumberOfAddresses

public int getNumberOfAddresses()
                         throws java.rmi.RemoteException
Returns the number of key-value mappings in the address map.
Returns:
the number of key-value mappings in the address map.

isAddressesEmpty

public boolean isAddressesEmpty()
                         throws java.rmi.RemoteException
Returns true if the address map contains no key-value mappings.

Returns:
true if the address map contains no key-value mappings.

putAddress

public void putAddress(java.lang.String key,
                       Address address)
                throws java.rmi.RemoteException
Associates the specified address with the specified key in the address map. If the map previously contained a address for this key, the old address is replaced.
Parameters:
key - key with which the specified address is to be associated.
address - address to be associated with the specified key.
Throws:
ClassCastException - key cannot be compared with the keys currently in the map.
NullPointerException - key is null and the address map uses natural order, or its comparator does not tolerate null keys.

putAddresses

public void putAddresses(com.sun.java.util.collections.TreeMap addresses)
                  throws java.rmi.RemoteException
Copies all of the addresses from the specified address map to this address map. These addresses replace any addresses that this address map had for any of the keys currently in the specified map.
Parameters:
address - Addresses to be stored in the address map.
Throws:
ClassCastException - class of a key or address in the specified map prevents it from being stored in the address map.
NullPointerException - the address map does not permit null keys and a specified key is null.

removeAllAddresses

public void removeAllAddresses()
                        throws java.rmi.RemoteException
Removes all addresses from this address map.

removeAddressByKey

public Address removeAddressByKey(java.lang.String key)
                           throws java.rmi.RemoteException
Removes the address for this key from this address map if present.
Parameters:
key - key with which the specified address is associated.
Returns:
previous address associated with specified key, or null if there was no address for key. A null return can also indicate that the map previously associated null with the specified key.
Throws:
ClassCastException - key cannot be compared with the keys currently in the map.
NullPointerException - key is null and the address map uses natural order, or its comparator does not tolerate null keys.

setPrimaryAddress

public void setPrimaryAddress(Address addr,
                              java.lang.String name)
                       throws java.rmi.RemoteException
This method is used to set a special address that will be the value returned by getPrimaryAddress. It will also be returned by getNamedAddress when the named adress is not available. This is provided as a convenience so that named addresses such as "billing" or "shipping" can be defaulted to the same "Primary" address.

getPrimaryAddress

public Address getPrimaryAddress()
                          throws java.rmi.RemoteException
Get address that is tagged as the primary address.

getNamedAddress

public Address getNamedAddress(java.lang.String name)
                        throws java.rmi.RemoteException
Returns the address specified by the name. If it does not exist return the primary address.

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved