|
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.KiesKring
A kieskring in an election.
Class Specifications |
invariant ( \forall int i; 0 <= i&&i < MY_CACHED_KIESKRINGEN.length; MY_CACHED_KIESKRINGEN[i].owner == MY_CACHED_KIESKRINGEN); invariant my_kiesLijsten.length == MAX_KIESLIJSTEN_PER_KIESKRING+1; invariant my_kiesLijsten.owner == this; invariant ( \forall int i; 0 <= i&&i < my_kiesLijsten.length; my_kiesLijsten[i].owner == this); invariant 0 <= my_number; invariant my_number <= CandidateList.MAX_KIESKRINGEN_PER_CANDIDATE_LIST; invariant my_name.length() <= KIESKRING_NAME_MAX_LENGTH; invariant my_name.owner == this; invariant my_districts.length == MAX_DISTRICTS_PER_KIESKRING+1; invariant my_districts.owner == this; invariant ( \forall int i; 0 <= i&&i < my_districts.length; my_districts[i].owner == this); invariant 0 <= my_district_count&&my_district_count <= MAX_DISTRICTS_PER_KIESKRING; invariant my_district_count == ( \sum int i; 0 <= i&&i < my_districts.length; (my_districts[i] != null) ? 1 : 0); invariant 0 <= my_kieslijst_count&&my_kieslijst_count <= MAX_KIESLIJSTEN_PER_KIESKRING; invariant my_kieslijst_count == ( \sum int i; 0 <= i&&i < my_kiesLijsten.length; (my_kiesLijsten[i] != null) ? 1 : 0); |
Field Summary | |
(package private) static byte |
KIESKRING_NAME_MAX_LENGTH
The maximum length, in characters, of the name of a kieskring. |
(package private) static byte |
KIESKRING_NUMBER_MAX_LENGTH
The maximum length, in digits represented by characters, of the number of a kieskring. |
(package private) static int |
MAX_DISTRICTS_PER_KIESKRING
The maximum number of districts that can exist in a single kieskring. |
(package private) static byte |
MAX_KIESLIJSTEN_PER_KIESKRING
The maximum number of kieslijsten that can exist in a single kieskring. |
[spec_public] private static KiesKring[] |
MY_CACHED_KIESKRINGEN
A cache of all kieskringen that have been constructed thus far. |
[spec_public] private byte |
my_district_count
The number of districts in this kieskring. |
[spec_public] private District[] |
my_districts
The districts of this kieskring. |
[spec_public] private byte |
my_kieslijst_count
The number of kieslijsten in this kieskring. |
[spec_public] (package private) KiesLijst[] |
my_kiesLijsten
A list of all kieslijst in this kieskring, indexed on kieslijst number. |
[spec_public] private java.lang.String |
my_name
The name (kieskringnaam) of this kieskring. |
[spec_public] private byte |
my_number
The number (kieskringnummer) of this kieskring. |
Constructor Summary | |
private |
KiesKring(byte a_kieskring_number,
non_null java.lang.String a_kieskring_name)
Construct a new kieskring object given the specified initialization values. |
Method Summary | |
(package private) boolean |
addDistrict(non_null District a_district)
Add a district to this kieskring. |
(package private) boolean |
addKiesLijst(non_null KiesLijst a_kieslijst)
Adds the specified kieslijst to this kieskring. |
(package private) void |
clear()
Clears all data in this KiesKring instance. |
int |
compareTo(java.lang.Object an_object)
|
(package private) byte |
districtCount()
|
boolean |
equals(java.lang.Object an_object)
{@inheritDoc} |
(package private) District |
getDistrict(byte a_district_number)
|
(package private) District[] |
getDistricten()
|
(package private) KiesLijst |
getKiesLijst(byte a_kieslijst_number)
|
(package private) KiesLijst[] |
getKiesLijsten()
|
(package private) boolean |
hasDistrict(non_null District a_district)
|
int |
hashCode()
{@inheritDoc} |
(package private) boolean |
hasKiesLijst(non_null KiesLijst a_kieslijst)
|
(package private) byte |
kieslijstCount()
|
(package private) static KiesKring |
make(byte a_kieskring_number,
non_null java.lang.String a_kieskring_name)
A factory method used to construct new kieskring objects. |
(package private) java.lang.String |
name()
|
(package private) byte |
number()
|
java.lang.String |
toString()
{@inheritDoc} |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
static final byte KIESKRING_NUMBER_MAX_LENGTH
static final byte KIESKRING_NAME_MAX_LENGTH
static final int MAX_DISTRICTS_PER_KIESKRING
static final byte MAX_KIESLIJSTEN_PER_KIESKRING
private static final KiesKring[] MY_CACHED_KIESKRINGEN
make(byte,
java.lang.String)
.
final KiesLijst[] my_kiesLijsten
private byte my_number
private java.lang.String my_name
private final District[] my_districts
private byte my_district_count
private byte my_kieslijst_count
Constructor Detail |
private KiesKring(byte a_kieskring_number, non_null java.lang.String a_kieskring_name)
This method is private and not to be used by clients.
Instead, the factory method make(byte, java.lang.String)
should be used.
a_kieskring_number
- the number of the new kieskring.a_kieskring_name
- the name of the new kieskring.
Method Detail |
static KiesKring make(byte a_kieskring_number, non_null java.lang.String a_kieskring_name)
a_kieskring_number
- the number of the new kieskring.a_kieskring_name
- the name of the new kieskring.
byte number()
java.lang.String name()
boolean addDistrict(non_null District a_district)
a_district
- the district to add.
false
if this kieskring already contained
the given district; true
if otherwise.
District[] getDistricten()
District getDistrict(byte a_district_number)
a_district_number
- the number of the district to get.
null
is returned if no such district exists.
boolean hasDistrict(non_null District a_district)
a_district
- the district to check for.
byte districtCount()
boolean addKiesLijst(non_null KiesLijst a_kieslijst)
a_kieslijst
- the kieslijst to add.
KiesLijst[] getKiesLijsten()
KiesLijst getKiesLijst(byte a_kieslijst_number)
a_kieslijst_number
- the number of the kieslijst that we are
interested in.
boolean hasKiesLijst(non_null KiesLijst a_kieslijst)
a_kieslijst
- the kieslijst that we wish to check for.
byte kieslijstCount()
void clear()
KiesKring
instance. In
particular, all district and kieslijsten 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 |