net.sourceforge.mflow.impl
Class ContactImpl

java.lang.Object
  extended bynet.sourceforge.mflow.impl.ContactImpl
All Implemented Interfaces:
Contact

public class ContactImpl
extends java.lang.Object
implements Contact

A class for representing an entity with which communication can occur Serves primarily as a repository for ContactMethods, associated with a name

Version:
$Revision: 1.4 $
Author:
David Carr

Method Summary
 void addContactMethod(ContactMethod cm)
          Adds a ContactMethod
 boolean equals(java.lang.Object o)
          Returns whether the specified object equals the current object
 ContactMethod[] getContactMethods()
          Accessor for all of the ContactMethods associated with this Contact
 ContactMethod getContactMethods(int index)
          Accessor for a single ContactMethod associated with this Contact
 java.lang.String getName()
          Accessor for the name
 int hashCode()
           
 void removeContactMethod(ContactMethod cm)
          Removes a ContactMethod if it is a member of this Contact
 void setContactMethods(ContactMethod[] cms)
          Mutator for all of the ContactMethods associated with this Contact
 void setContactMethods(int index, ContactMethod cm)
          Mutator for a single ContactMethod associated with this Contact
 void setName(java.lang.String name)
          Mutator for the name
 java.lang.String toString()
          Returns a string representation of this object
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

setName

public void setName(java.lang.String name)
Mutator for the name

Specified by:
setName in interface Contact
Parameters:
name - the new name

getName

public java.lang.String getName()
Accessor for the name

Specified by:
getName in interface Contact
Returns:
the name

equals

public boolean equals(java.lang.Object o)
Returns whether the specified object equals the current object

Overrides:
equals in class java.lang.Object
Parameters:
o - an object to compare with
Returns:
true if the object is a Contact and has the same name and ContactMethods

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
the hashcode for the class

addContactMethod

public void addContactMethod(ContactMethod cm)
Adds a ContactMethod

Specified by:
addContactMethod in interface Contact
Parameters:
cm - the ContactMethod to add

removeContactMethod

public void removeContactMethod(ContactMethod cm)
Removes a ContactMethod if it is a member of this Contact

Specified by:
removeContactMethod in interface Contact
Parameters:
cm - the ContactMethod to remove

getContactMethods

public ContactMethod[] getContactMethods()
Accessor for all of the ContactMethods associated with this Contact

Specified by:
getContactMethods in interface Contact
Returns:
an array of ContactMethods

setContactMethods

public void setContactMethods(ContactMethod[] cms)
Mutator for all of the ContactMethods associated with this Contact

Specified by:
setContactMethods in interface Contact
Parameters:
cms - an array of ContactMethods

getContactMethods

public ContactMethod getContactMethods(int index)
                                throws java.lang.ArrayIndexOutOfBoundsException
Accessor for a single ContactMethod associated with this Contact

Specified by:
getContactMethods in interface Contact
Parameters:
index - the index of the ContactMethod to return
Returns:
the ContactMethod at the specified index
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the specified index is invalid

setContactMethods

public void setContactMethods(int index,
                              ContactMethod cm)
                       throws java.lang.ArrayIndexOutOfBoundsException
Mutator for a single ContactMethod associated with this Contact

Specified by:
setContactMethods in interface Contact
Parameters:
index - the index of the ContactMethod to change
cm - te ContactMethod to set
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the specified index is invalid

toString

public java.lang.String toString()
Returns a string representation of this object

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this object


Copyright © 2002-2004 MFlow Group. All Rights Reserved.