|
SOA © 2004 SoS Group All Rights Reserved |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsos.koa.Candidate
A candidate in an election.
Class Specifications |
invariant my_lastname.length() <= LASTNAME_MAX_LENGTH; invariant my_lastname.owner == this; invariant my_firstname.length() <= FIRSTNAME_MAX_LENGTH; invariant my_firstname.owner == this; invariant my_initials.length() <= INITIALS_MAX_LENGTH; invariant my_initials.owner == this; invariant my_gender == MALE||my_gender == FEMALE||my_gender == UNKNOWN; invariant 0 <= my_position_number; invariant my_position_number <= KiesLijst.MAX_CANDIDATES_PER_KIESLIJST; invariant my_city_of_residence.length() <= CITY_OF_RESIDENCE_MAX_LENGTH; invariant my_city_of_residence.owner == this; invariant my_vote_count >= 0; |
Field Summary | |
(package private) static byte |
CITY_OF_RESIDENCE_MAX_LENGTH
The maximum length, in digits represented by characters, of the city of residence of a candidate. |
(package private) static char |
FEMALE
The possible values of the gender of a candidate. |
(package private) static byte |
FIRSTNAME_MAX_LENGTH
The maximum length, in characters, of the firstname of a candidate. |
(package private) static byte |
INITIALS_MAX_LENGTH
The maximum length, in characters, of the initials of a candidate. |
(package private) static byte |
LASTNAME_MAX_LENGTH
The maximum length, in character, of the lastname (surname) of a candidate. |
(package private) static char |
MALE
The possible values of the gender of a candidate. |
[spec_public] private java.lang.String |
my_city_of_residence
The city of residence (woonplaats) of a candidate. |
[spec_public] private java.lang.String |
my_firstname
The firstname (roepnaam) of a candidate. |
[spec_public] private char |
my_gender
The gender (geslacht) of a candidate. |
[spec_public] private java.lang.String |
my_initials
The initials (voorletters) of a candidate. |
[spec_public] private KiesKring |
my_kiesKring
The kieskring of a candidate. |
[spec_public] private KiesLijst |
my_kiesLijst
The kieslijst of a candidate. |
[spec_public] private java.lang.String |
my_lastname
The lastname (achternaam) of a candidate. |
[spec_public] private byte |
my_position_number
The position number (positienummer) of a candidate. |
[spec_public] private int |
my_vote_count
The number of votes cast for this candidate. |
(package private) static byte |
POSITION_NUMBER_MAX_LENGTH
The maximum length, in digits represented by characters, of the position number of a candidate. |
(package private) static char |
UNKNOWN
The possible values of the gender of a candidate. |
Constructor Summary | |
(package private) |
Candidate(non_null java.lang.String a_lastname,
non_null java.lang.String a_firstname,
non_null java.lang.String some_initials,
char a_gender,
byte a_position_number,
non_null java.lang.String a_city_of_residence,
non_null KiesKring a_kieskring,
non_null KiesLijst a_kieslijst)
Construct a new candidate object given the specified initialization values. |
Method Summary | |
(package private) java.lang.String |
cityOfResidence()
|
int |
compareTo(java.lang.Object an_object)
|
boolean |
equals(java.lang.Object an_object)
{@inheritDoc} |
(package private) java.lang.String |
firstname()
|
(package private) char |
gender()
|
int |
hashCode()
{@inheritDoc} |
(package private) int |
incrementVoteCount()
|
(package private) java.lang.String |
initials()
|
(package private) KiesKring |
kiesKring()
|
(package private) KiesLijst |
kiesLijst()
|
(package private) java.lang.String |
lastname()
|
(package private) byte |
position_number()
|
java.lang.String |
toString()
{@inheritDoc} |
(package private) int |
voteCount()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
static final byte LASTNAME_MAX_LENGTH
static final byte FIRSTNAME_MAX_LENGTH
static final byte INITIALS_MAX_LENGTH
static final char MALE
static final char FEMALE
static final char UNKNOWN
static final byte POSITION_NUMBER_MAX_LENGTH
static final byte CITY_OF_RESIDENCE_MAX_LENGTH
private java.lang.String my_lastname
private java.lang.String my_firstname
private java.lang.String my_initials
private char my_gender
private byte my_position_number
private java.lang.String my_city_of_residence
private KiesKring my_kiesKring
private KiesLijst my_kiesLijst
private int my_vote_count
Constructor Detail |
Candidate(non_null java.lang.String a_lastname, non_null java.lang.String a_firstname, non_null java.lang.String some_initials, char a_gender, byte a_position_number, non_null java.lang.String a_city_of_residence, non_null KiesKring a_kieskring, non_null KiesLijst a_kieslijst)
a_lastname
- the lastname of the new candidate.a_firstname
- the firstname of the new candidate.some_initials
- the initial of the new candidate.a_gender
- the gender of the new candidate.a_position_number
- the position number of the new candidate.a_city_of_residence
- the city of residence of the new
candidate.a_kieskring
- the kieskring of the new candidate.a_kieslijst
- the kieslijst of the new candidate.
Method Detail |
final java.lang.String lastname()
final java.lang.String firstname()
final java.lang.String initials()
final char gender()
final byte position_number()
final java.lang.String cityOfResidence()
final KiesKring kiesKring()
final KiesLijst kiesLijst()
final int incrementVoteCount()
final int voteCount()
public final boolean equals(java.lang.Object an_object)
equals
in class java.lang.Object
public final int hashCode()
hashCode
in class java.lang.Object
public final java.lang.String toString()
toString
in class java.lang.Object
public final int compareTo(java.lang.Object an_object)
compareTo
in interface java.lang.Comparable
|
SOA © 2004 SoS Group All Rights Reserved |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |