|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Candidate
public class Candidate
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 |
---|
public Candidate(java.lang.String name, java.lang.String party)
name
- Name of the candidateparty
- Name of the candidate's partypublic Candidate(java.lang.String name, java.lang.String party, java.lang.String office, boolean incumbent)
name
- Name of the candidateparty
- Name of the candidate's partyoffice
- Office the candidate is seekingincumbent
- True if the candidate is an incumbentMethod Detail |
---|
public java.lang.String getName()
public void setName(java.lang.String name)
name
- New name for the candidatepublic java.lang.String getParty()
public void setParty(java.lang.String party)
party
- New name for the candidate's partypublic java.lang.String getOffice()
public void setOffice(java.lang.String office)
office
- New name for the candidate's officepublic boolean isIncumbent()
public void setIncumbent(boolean incumbent)
incumbent
- true if the candidate is an incumbent,
false otherwise
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |