|
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.
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. |
private java.lang.String |
my_city_of_residence
The city of residence (woonplaats) of a candidate. |
private java.lang.String |
my_firstname
The firstname (roepnaam) of a candidate. |
private char |
my_gender
The gender (geslacht) of a candidate. |
private java.lang.String |
my_initials
The initials (voorletters) of a candidate. |
private KiesKring |
my_kiesKring
The kieskring of a candidate. |
private KiesLijst |
my_kiesLijst
The kieslijst of a candidate. |
private java.lang.String |
my_lastname
The lastname (achternaam) of a candidate. |
private byte |
my_position_number
The position number (positienummer) of a candidate. |
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(java.lang.String a_lastname,
java.lang.String a_firstname,
java.lang.String some_initials,
char a_gender,
byte a_position_number,
java.lang.String a_city_of_residence,
KiesKring a_kieskring,
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)
|
(package private) java.lang.String |
firstname()
|
(package private) char |
gender()
|
int |
hashCode()
|
(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()
|
(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(java.lang.String a_lastname, java.lang.String a_firstname, java.lang.String some_initials, char a_gender, byte a_position_number, java.lang.String a_city_of_residence, KiesKring a_kieskring, 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.
normal_behavior requires (* all parameters must be of the proper length *); requires a_lastname.length() <= LASTNAME_MAX_LENGTH; requires a_firstname.length() <= FIRSTNAME_MAX_LENGTH; requires some_initials.length() <= INITIALS_MAX_LENGTH; requires a_gender == MALE || a_gender == FEMALE || a_gender == UNKNOWN; requires 0 <= a_position_number; requires a_position_number <= KiesLijst.MAX_CANDIDATES_PER_KIESLIJST; requires a_city_of_residence.length() <= CITY_OF_RESIDENCE_MAX_LENGTH; requires a_kieslijst.candidateCount() < KiesLijst.MAX_CANDIDATES_PER_KIESLIJST; modifies \everything; ensures (* all fields are properly initialized *); ensures lastname().equals(a_lastname); ensures firstname().equals(a_firstname); ensures initials().equals(some_initials); ensures gender() == a_gender; ensures position_number() == a_position_number; ensures cityOfResidence().equals(a_city_of_residence); ensures kiesKring().equals(a_kieskring); ensures kiesLijst().equals(a_kieslijst); ensures kiesLijst().candidateCount() == \old(a_kieslijst.candidateCount() + 1);
Method Detail |
final java.lang.String lastname()
normal_behavior ensures \result.length() <= LASTNAME_MAX_LENGTH;
final java.lang.String firstname()
normal_behavior ensures \result.length() <= FIRSTNAME_MAX_LENGTH;
final java.lang.String initials()
normal_behavior ensures \result.length() <= INITIALS_MAX_LENGTH;
final char gender()
normal_behavior ensures \result == MALE || \result == FEMALE || \result == UNKNOWN;
final byte position_number()
normal_behavior ensures 0 <= \result && \result <= KiesLijst.MAX_CANDIDATES_PER_KIESLIJST;
final java.lang.String cityOfResidence()
final KiesKring kiesKring()
normal_behavior ensures \result == my_kiesKring;
final KiesLijst kiesLijst()
normal_behavior ensures \result == my_kiesLijst;
final int incrementVoteCount()
normal_behavior modifies my_vote_count; ensures my_vote_count == \old(my_vote_count + 1);
final int voteCount()
normal_behavior ensures \result == my_vote_count;
public final boolean equals(java.lang.Object an_object)
public final int hashCode()
public final java.lang.String toString()
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 |