org.gswing.components.common
Class Candidate

java.lang.Object
  extended by org.gswing.components.common.Candidate
All Implemented Interfaces:
Serializable

public class Candidate
extends Object
implements Serializable

Purpose: Represents a single candidate standing in an election.

See Also:
Serialized Form

Field Summary
static int REV_WITH_COMMA
           
static int REV_WITHOUT_COMMA
           
static int WITH_COMMA
           
static int WITHOUT_COMMA
           
 
Constructor Summary
Candidate(String firstName, String surname, Party party)
          Constructor.
Candidate(String firstName, String surname, String party)
          Constructor.
 
Method Summary
 String getFirstName()
          Get the candidates first name.
 String getFullName()
          Get the candidates full name.
 String getFullName(int format)
          Get the candidates full name.
 String getParty()
          Get the party abbreviation that the candidate belongs to.
 String getPartyFullName()
          Get the party that the candidate belongs to.
 Party getPartyObject()
          Get the party that the candidate belongs to.
 String getSurname()
          Get the candidates surname.
 void setFirstName(String firstName)
          Set candidates surname.
 void setParty(String party)
          Set party that the candidate is a member of.
 void setSurname(String surname)
          Set candidates surname.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WITH_COMMA

public static final int WITH_COMMA
See Also:
Constant Field Values

WITHOUT_COMMA

public static final int WITHOUT_COMMA
See Also:
Constant Field Values

REV_WITHOUT_COMMA

public static final int REV_WITHOUT_COMMA
See Also:
Constant Field Values

REV_WITH_COMMA

public static final int REV_WITH_COMMA
See Also:
Constant Field Values
Constructor Detail

Candidate

public Candidate(String firstName,
                 String surname,
                 Party party)
Constructor.

Parameters:
firstName - The candidates first name.
surname - The candidates surname.
party - The party that the candidate belongs to.

Candidate

public Candidate(String firstName,
                 String surname,
                 String party)
Constructor.

Parameters:
firstName - The candidates first name.
surname - The candidates surname.
party - The party that the candidate belongs to.
Method Detail

getFullName

public String getFullName()
Get the candidates full name. Surname first, separated by a comma.

Returns:
The candidates full name.

getFullName

public String getFullName(int format)
Get the candidates full name. Options: WITH_COMMA - , WITHOUT_COMMA REV_WITHOUT_COMMA - , REV_WITHOUT_COMMA -

Returns:
The candidates full name.

getParty

public String getParty()
Get the party abbreviation that the candidate belongs to.

Returns:
The candidate's party.

getPartyFullName

public String getPartyFullName()
Get the party that the candidate belongs to.

Returns:
The candidate's party.

getPartyObject

public Party getPartyObject()
Get the party that the candidate belongs to.

Returns:
The candidate's party.

getFirstName

public String getFirstName()
Get the candidates first name.

Returns:
The candidates first name.

getSurname

public String getSurname()
Get the candidates surname.

Returns:
The candidate's surname.

setSurname

public void setSurname(String surname)
Set candidates surname.

Parameters:
surname - The candiate's surname.

setFirstName

public void setFirstName(String firstName)
Set candidates surname.

Parameters:
firstName - The candidate's first name.

setParty

public void setParty(String party)
Set party that the candidate is a member of.

Parameters:
party - The candidate's party abbreviation.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2008. All Rights Reserved.