talx x1.0.5

talx.model
Class Person

java.lang.Object
  extended bytalx.model.Person
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable
Direct Known Subclasses:
Player

public class Person
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable

This class represents people on our email mailing list. Each person is represented by a person object which contains all the messages from that person.

See Also:
Serialized Form

Field Summary
protected  java.lang.String[] username
          The person's usernames.
 
Constructor Summary
protected Person(Person person)
          Copy constructor provided for subclasses.
protected Person(java.lang.String name)
           
  Person(java.lang.String name, java.lang.String markedUpName, java.lang.String[] email, java.lang.String filename)
          This Constructor takes in a String params which should contain all the necessary information about the person this object will represent.
 
Method Summary
 int compareTo(java.lang.Object o)
          Compares the name of this person with the given person.
 boolean equals(java.lang.Object o)
          Returns true if and only if the given object is a Person with the same name.
 java.lang.String getAllAddresses()
          Returns the space-delimited list of email addresses for this person.
protected  java.lang.String getDefaultPicture()
          Supplies the default picture filename to the Person(String) constructor.
 java.lang.String getEmailAddress()
          Returns the primary email address for this person.
 java.lang.String getFileName()
          Returns the filename that contains the picture of this person.
 java.lang.String getMarkedUpName()
          Returns the html version of the name of this person.
 javax.mail.internet.MimeMessage getMessage(javax.mail.search.SearchTerm s, Outbox box)
          Returns the next message that matches the given search term.
 int getMessageCount(javax.mail.search.SearchTerm s, Outbox box)
          Returns the number of messages matching the given search term.
 java.lang.String getName()
          Returns the name of this person.
 javax.mail.internet.MimeMessage getOldestMessage(javax.mail.search.SearchTerm s, Outbox box)
          Returns the last message that matches the given search term.
 int hashCode()
           
 boolean isMatch(java.lang.String address)
          Determines whether the address is approximately the same as this person's email address.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

username

protected java.lang.String[] username
The person's usernames.

Constructor Detail

Person

protected Person(Person person)
Copy constructor provided for subclasses.


Person

protected Person(java.lang.String name)

Person

public Person(java.lang.String name,
              java.lang.String markedUpName,
              java.lang.String[] email,
              java.lang.String filename)
This Constructor takes in a String params which should contain all the necessary information about the person this object will represent.

Parameters:
name - The String containing person's name.
markedUpName - The String containing person's name with html markup.
email - The Strings containing person's email address.
filename - The String containing person's filename.
Throws:
java.lang.NullPointerException - if the email address is malformed.
java.lang.IndexOutOfBoundsException - if the email address is malformed.
Method Detail

getDefaultPicture

protected java.lang.String getDefaultPicture()
Supplies the default picture filename to the Person(String) constructor.


compareTo

public int compareTo(java.lang.Object o)
Compares the name of this person with the given person.

Specified by:
compareTo in interface java.lang.Comparable

equals

public boolean equals(java.lang.Object o)
Returns true if and only if the given object is a Person with the same name.


getMessage

public javax.mail.internet.MimeMessage getMessage(javax.mail.search.SearchTerm s,
                                                  Outbox box)
Returns the next message that matches the given search term. The message queue maintains a pointer for each possible search term. Each time this method is called, the pointer for the search term is advanced chronologically and the next qualifying message is returned.

Parameters:
s - the criteria that the returned message must match.
Returns:
the next qualifying message in chronological order, or null if no qualifying message can be found.

getOldestMessage

public javax.mail.internet.MimeMessage getOldestMessage(javax.mail.search.SearchTerm s,
                                                        Outbox box)
Returns the last message that matches the given search term. This method does not affect the messages returned by the getMessage method. Unless the pending box has been altered, subsequent calls to this method will return the same message.

Parameters:
s - the criteria that the returned message must match.
Returns:
the oldest qualifying message, or null if no qualifying message could be found.

getName

public java.lang.String getName()
Returns the name of this person.


getMarkedUpName

public java.lang.String getMarkedUpName()
Returns the html version of the name of this person.


getEmailAddress

public java.lang.String getEmailAddress()
Returns the primary email address for this person.


getAllAddresses

public java.lang.String getAllAddresses()
Returns the space-delimited list of email addresses for this person.


getFileName

public java.lang.String getFileName()
Returns the filename that contains the picture of this person.


isMatch

public boolean isMatch(java.lang.String address)
Determines whether the address is approximately the same as this person's email address. This method tries to match everything before the @ and the last two domain parts. It ignores all other domain parts. So, jallen@mailhost.cs.uoregon.edu would match jallen@cs.uoregon.edu or jallen@oregon.uoregon.edu, but not jallen.cis@uoregon.edu or jallen@cs.orst.edu.


getMessageCount

public int getMessageCount(javax.mail.search.SearchTerm s,
                           Outbox box)
Returns the number of messages matching the given search term.


toString

public java.lang.String toString()

hashCode

public int hashCode()

talx x1.0.5

© 2001-2005 University of Oregon.
Eugene OR 97403, U.S.A. All Rights Reserved.