de.hagenah.diplomacy.game
Class Judge

java.lang.Object
  extended by de.hagenah.diplomacy.game.Judge
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

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

This class represents a judge.

See Also:
Serialized Form

Constructor Summary
Judge(java.lang.String name, java.lang.String email, java.lang.String secondaryemail, java.lang.String footer)
          Creates a new judge.
 
Method Summary
 int compareTo(java.lang.Object obj)
          Compares two judges by name.
 boolean equals(java.lang.Object obj)
          Indicates whether obj is "equal to" this one.
 java.lang.String getEmail()
          Returns the e-mail of the judge
 java.lang.String getFooter()
          Returns the begin of the footer
static Judge getJudge(java.util.Collection judges, java.lang.String name, java.lang.String email)
          Returns the judge with the specified name and email address.
 java.lang.String getName()
          Returns the name of the judge
 java.lang.String getSecondaryEmail()
          Returns the e-mail of the judge
 int hashCode()
          Returns a hashcode for this judge.
 java.lang.String toString()
          Returns the name of the judge.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Judge

public Judge(java.lang.String name,
             java.lang.String email,
             java.lang.String secondaryemail,
             java.lang.String footer)
Creates a new judge.

Parameters:
name - The name of the judge
email - The email address of the judge
secondaryemail - The secondary email address of the judge
footer - The begin of the footer, empty string for no footer
Method Detail

getJudge

public static Judge getJudge(java.util.Collection judges,
                             java.lang.String name,
                             java.lang.String email)
Returns the judge with the specified name and email address.

Parameters:
judges - A collection of judges
name - The name of the judge (can be null)
email - The email address of the judge (can be null)
Returns:
The judge (null if no matching judge was found)

getName

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

Returns:
The name of the judge

getEmail

public java.lang.String getEmail()
Returns the e-mail of the judge

Returns:
The e-mail of the judge

getSecondaryEmail

public java.lang.String getSecondaryEmail()
Returns the e-mail of the judge

Returns:
The e-mail of the judge

getFooter

public java.lang.String getFooter()
Returns the begin of the footer

Returns:
The begin of the footer, empty string for no footer

equals

public boolean equals(java.lang.Object obj)
Indicates whether obj is "equal to" this one.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The other obj
Returns:
true if obj is a Judge object and has the same name

compareTo

public int compareTo(java.lang.Object obj)
Compares two judges by name.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - The other obj
Returns:
A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

hashCode

public int hashCode()
Returns a hashcode for this judge.

Overrides:
hashCode in class java.lang.Object
Returns:
The hashcode

toString

public java.lang.String toString()
Returns the name of the judge.

Overrides:
toString in class java.lang.Object
Returns:
The name of the judge, e.g. FROG.