edu.cmu.hcii.calo.model.Person Class Reference

List of all members.

Detailed Description

Represents a person known to CALO.

This class is not used in the current implementation.

Author:
Brian Ellis


Public Member Functions

 Person ()
 Create a new unknown person.
 Person (String name)
 Create a new person.
boolean addProject (Project p)
 Associates this person with the given project.
void clearAttributes ()
 Removes all attributes associated with this person.
boolean containsAttribute (String key)
 Returns true if the attributes for this person includes a certain attribute, false otherwise.
int countAttributes ()
 Returns the number of attributes associated with this person.
int countProjects ()
 Returns the number of projects with which this person is associated.
String getAttribute (String key)
 Returns the value of this person's given attribute, or null if it is not defined.
String getEmailAddress ()
 Accessor method for emailAddress.
String getName ()
 Accessor method for name.
boolean isAssociatedWithProject (Project p)
 Returns true if this person is associated with the given project, false otherwise.
Iterator< ProjectprojectIterator ()
 Returns an iterator over the projects with which this person is associated.
String putAttribute (String key, String value)
 Sets the value of the given attribute, adding it if it did not already exist.
void removeAllProjects ()
 Disassociates this person from all projects with which he or she is currently associated.
String removeAttribute (String key)
 Removes the given attribute from this person's attributes if it existed.
boolean removeProject (Project p)
 Disassociates this person from the given project.
void setEmailAddress (String emailAddress)
 Setter method for emailAddress.
void setName (String name)
 Setter method for name.

Private Attributes

String name
 The name of this person (as much of it as is known).
String emailAddress
 The email address associated with this person.
Set< Projectprojects
 The set of projects associated with this person.
Map< String, String > attributes
 A map containing any other information about the person the user wishes to add.

Static Private Attributes

static final long serialVersionUID = 2297518203901454182L
 Prevents serialziation collisions.


Constructor & Destructor Documentation

edu.cmu.hcii.calo.model.Person.Person (  ) 

Create a new unknown person.

edu.cmu.hcii.calo.model.Person.Person ( String  name  ) 

Create a new person.


Member Function Documentation

boolean edu.cmu.hcii.calo.model.Person.addProject ( Project  p  ) 

Associates this person with the given project.

Parameters:
p the project to add
Returns:
true if this person was not already associated with the project (but is now), false otherwise
See also:
java.util.Set.add(java.lang.Object)

void edu.cmu.hcii.calo.model.Person.clearAttributes (  ) 

Removes all attributes associated with this person.

See also:
java.util.Map.clear()

boolean edu.cmu.hcii.calo.model.Person.containsAttribute ( String  key  ) 

Returns true if the attributes for this person includes a certain attribute, false otherwise.

Parameters:
key the attribute to find
Returns:
true if the attributes for this person contain this attribute
See also:
java.util.Map.containsKey(java.lang.Object)

int edu.cmu.hcii.calo.model.Person.countAttributes (  ) 

Returns the number of attributes associated with this person.

Returns:
the number of attributes associated with this person
See also:
java.util.Map.size()

int edu.cmu.hcii.calo.model.Person.countProjects (  ) 

Returns the number of projects with which this person is associated.

Returns:
See also:
java.util.Set.size()

String edu.cmu.hcii.calo.model.Person.getAttribute ( String  key  ) 

Returns the value of this person's given attribute, or null if it is not defined.

Parameters:
key The attribute to get the value of
Returns:
the value of that attribute
See also:
java.util.Map.get(java.lang.Object)

String edu.cmu.hcii.calo.model.Person.getEmailAddress (  ) 

Accessor method for emailAddress.

Returns:
the value of emailAddress

String edu.cmu.hcii.calo.model.Person.getName (  ) 

Accessor method for name.

Returns:
the value of name

boolean edu.cmu.hcii.calo.model.Person.isAssociatedWithProject ( Project  p  ) 

Returns true if this person is associated with the given project, false otherwise.

Parameters:
p the project to ask about
Returns:
true if this person is associated with the given project, false otherwise
See also:
java.util.Set.contains(java.lang.Object)

Iterator<Project> edu.cmu.hcii.calo.model.Person.projectIterator (  ) 

Returns an iterator over the projects with which this person is associated.

Returns:
an iterator over the projects with which this person is associated
See also:
java.util.Set.iterator()

String edu.cmu.hcii.calo.model.Person.putAttribute ( String  key,
String  value 
)

Sets the value of the given attribute, adding it if it did not already exist.

Parameters:
key the attribute to add or set
value the new value of this attribute
Returns:
the previous value associated with specified attribute, or null if the attribute did not previously exist
See also:
java.util.Map.put(java.lang.Object, java.lang.Object)

void edu.cmu.hcii.calo.model.Person.removeAllProjects (  ) 

Disassociates this person from all projects with which he or she is currently associated.

See also:
java.util.Set.clear()

String edu.cmu.hcii.calo.model.Person.removeAttribute ( String  key  ) 

Removes the given attribute from this person's attributes if it existed.

Parameters:
key the attribute to remove
Returns:
the value of the attribute before it was removed, or null if the attribute did not previously exist
See also:
java.util.Map.remove(java.lang.Object)

boolean edu.cmu.hcii.calo.model.Person.removeProject ( Project  p  ) 

Disassociates this person from the given project.

Parameters:
p the project to remove
Returns:
true if the project was previously associated with this person (and is no longer), false otherwise
See also:
java.util.Set.remove(java.lang.Object)

void edu.cmu.hcii.calo.model.Person.setEmailAddress ( String  emailAddress  ) 

Setter method for emailAddress.

Parameters:
emailAddress the emailAddress to set

void edu.cmu.hcii.calo.model.Person.setName ( String  name  ) 

Setter method for name.

Parameters:
name the name to set


Member Data Documentation

final long edu.cmu.hcii.calo.model.Person.serialVersionUID = 2297518203901454182L [static, private]

Prevents serialziation collisions.

String edu.cmu.hcii.calo.model.Person.name [private]

The name of this person (as much of it as is known).

String edu.cmu.hcii.calo.model.Person.emailAddress [private]

The email address associated with this person.

Set<Project> edu.cmu.hcii.calo.model.Person.projects [private]

The set of projects associated with this person.

Map<String, String> edu.cmu.hcii.calo.model.Person.attributes [private]

A map containing any other information about the person the user wishes to add.


The documentation for this class was generated from the following file:
Generated on Mon Aug 13 15:06:17 2007 for CALO by  doxygen 1.5.2