|
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.KiesLijst
A kieslijst in an election.
Class Specifications |
invariant (* MAX_CANDIDATES_PER_KIESLIJST == 80 by law *); invariant 0 <= candidateCount()&&candidateCount() <= MAX_CANDIDATES_PER_KIESLIJST; invariant ( \forall int i; 0 <= i&&i < MY_CACHED_KIESLIJSTEN.length; MY_CACHED_KIESLIJSTEN[i].owner == MY_CACHED_KIESLIJSTEN); invariant my_candidates.length == MAX_CANDIDATES_PER_KIESLIJST+1; invariant ( \forall int i; 0 <= i&&i < my_candidates.length; my_candidates[i].owner == this); invariant 0 <= my_number&&my_number <= KiesKring.MAX_KIESLIJSTEN_PER_KIESKRING; invariant my_name.length() <= GROEPERING_NAME_MAX_LENGTH; invariant my_name.owner == this; invariant 0 <= my_kieskring_number; invariant my_kieskring_number <= CandidateList.MAX_KIESKRINGEN_PER_CANDIDATE_LIST; invariant 0 <= my_candidate_count; invariant my_candidate_count <= MAX_CANDIDATES_PER_KIESLIJST; invariant my_vote_count >= 0; |
Field Summary | |
(package private) static byte |
BLANCO
The "Blanco" kieslijst is hard-coded, according to the Ministry, as 99. |
(package private) static byte |
GROEPERING_NAME_MAX_LENGTH
The maximum length in characters of a groepering's name. |
(package private) static byte |
KIESLIJST_NUMBER_MAX_LENGTH
The maximum length, in digits represented by characters, of a kieslijst's number (kieslijstnummer). |
(package private) static byte |
MAX_CANDIDATES_PER_KIESLIJST
|
[spec_public] private static KiesLijst[] |
MY_CACHED_KIESLIJSTEN
A cache of all kieslijsts ever constructed. |
[spec_public] private byte |
my_candidate_count
The number of candidates in this kieslijst. |
[spec_public] (package private) Candidate[] |
my_candidates
The candidates in this kieslijst. |
[spec_public] private byte |
my_kieskring_number
The number of the kieskring in which this kieslijst resides. |
[spec_public] private java.lang.String |
my_name
The name (kieslijstnaam) of this kieslijst. |
[spec_public] private byte |
my_number
This number (kieslijstnummer) of this kieslijst. |
[spec_public] private int |
my_vote_count
The total number of votes counted in this kieslijst. |
Constructor Summary | |
private |
KiesLijst(byte a_kieskring_number,
byte a_number,
non_null java.lang.String a_name)
Construct a new kieslijst object given the specified initialization values. |
Method Summary | |
(package private) void |
addCandidate(non_null Candidate a_candidate)
Add a candidate to this kieslijst. |
(package private) byte |
candidateCount()
|
(package private) Candidate[] |
candidates()
|
(package private) void |
clear()
Clears all data in this KiesLijst instance. |
int |
compareTo(java.lang.Object an_object)
|
boolean |
equals(java.lang.Object an_object)
{@inheritDoc} |
int |
hashCode()
{@inheritDoc} |
(package private) int |
incrementVoteCount()
Increment the number of votes counted in this kieslijst by one. |
(package private) static KiesLijst |
make(byte a_kieskring_number,
byte a_number,
non_null java.lang.String a_name)
This is the factory method for obtaining new kieslijst objects, given the specified initialization values. |
(package private) java.lang.String |
name()
|
(package private) byte |
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 BLANCO
static final byte KIESLIJST_NUMBER_MAX_LENGTH
static final byte GROEPERING_NAME_MAX_LENGTH
static final byte MAX_CANDIDATES_PER_KIESLIJST
private static final KiesLijst[] MY_CACHED_KIESLIJSTEN
make()
.
make(byte, byte, java.lang.String)
final Candidate[] my_candidates
private byte my_number
private java.lang.String my_name
private byte my_kieskring_number
private byte my_candidate_count
private int my_vote_count
Constructor Detail |
private KiesLijst(byte a_kieskring_number, byte a_number, non_null java.lang.String a_name)
Method Detail |
static KiesLijst make(byte a_kieskring_number, byte a_number, non_null java.lang.String a_name)
a_kieskring_number
- the number of the kieskring in which this
kieslijst resides.a_number
- the number of the new kieslijst.a_name
- the name of the new kieslijst.
byte number()
java.lang.String name()
void addCandidate(non_null Candidate a_candidate)
a_candidate
- the candidate to add.
Candidate[] candidates()
byte candidateCount()
int incrementVoteCount()
int voteCount()
void clear()
KiesLijst
instance. In
particular, all candidate references are cleared.
public boolean equals(java.lang.Object an_object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public 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 |