Class Candidate

Class diagram for Candidate class
java.lang.Object
  extended by Candidate

public class Candidate
extends java.lang.Object

This class is used to store information about a candidate running for office.



Constructor Summary
Candidate(java.lang.String name, java.lang.String party)
          This minimal constructor requires a name and party.
Candidate(java.lang.String name, java.lang.String party, java.lang.String office, boolean incumbent)
          This constructor behaves the same as the two parameter constructor, but requires an office and incumbent status to be specified.
 
Method Summary
 java.lang.String getName()
          Accessor for candidate's name
 java.lang.String getOffice()
          Accessor for the office the candidate is seeking
 java.lang.String getParty()
          Accessor for the name of the candidate's party
 boolean isIncumbent()
          Accessor for candidate's incumbent status
 void setIncumbent(boolean incumbent)
          Mutator for the candidate's incumbent status
 void setName(java.lang.String name)
          Mutator for the candidate's name
 void setOffice(java.lang.String office)
          Mutator for the candidate's office
 void setParty(java.lang.String party)
          Mutator for the candidate's party
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Candidate

public Candidate(java.lang.String name,
                 java.lang.String party)
This minimal constructor requires a name and party. The Candidate is assumed to not be currently seeking an office and not be an incumbent.

Parameters:
name - Name of the candidate
party - Name of the candidate's party

Candidate

public Candidate(java.lang.String name,
                 java.lang.String party,
                 java.lang.String office,
                 boolean incumbent)
This constructor behaves the same as the two parameter constructor, but requires an office and incumbent status to be specified.

Parameters:
name - Name of the candidate
party - Name of the candidate's party
office - Office the candidate is seeking
incumbent - True if the candidate is an incumbent
Method Detail

getName

public java.lang.String getName()
Accessor for candidate's name

Returns:
Name of the candidate

setName

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

Parameters:
name - New name for the candidate

getParty

public java.lang.String getParty()
Accessor for the name of the candidate's party

Returns:
Name of the candidate's party

setParty

public void setParty(java.lang.String party)
Mutator for the candidate's party

Parameters:
party - New name for the candidate's party

getOffice

public java.lang.String getOffice()
Accessor for the office the candidate is seeking

Returns:
Office the candidate is seeking

setOffice

public void setOffice(java.lang.String office)
Mutator for the candidate's office

Parameters:
office - New name for the candidate's office

isIncumbent

public boolean isIncumbent()
Accessor for candidate's incumbent status

Returns:
true if the candidate is an incumbent, false otherwise

setIncumbent

public void setIncumbent(boolean incumbent)
Mutator for the candidate's incumbent status

Parameters:
incumbent - true if the candidate is an incumbent, false otherwise