org.gswing.components.common
Class Party

java.lang.Object
  extended by org.gswing.components.common.Party
All Implemented Interfaces:
Serializable

public class Party
extends Object
implements Serializable

Purpose: Represents a political party.

See Also:
Serialized Form

Field Summary
static String IND
          Independent abbreviation.
static String IND_CON
          Independent conservative abbreviation.
static String IND_GRN
          Independent green abbreviation.
static String IND_LAB
          Independent Labour abbreviation.
static String INDEPENDENT
          Independent full name string.
static String OTHERS
          Other party.
 
Constructor Summary
Party(String abbreviation, String fullName)
          Constructor.
Party(String abbreviation, String fullName, boolean useProperties)
          Constructor.
Party(String abbreviation, String fullName, URL homePage)
          Constructor.
Party(String abbreviation, String fullName, URL homePage, boolean useProperties)
          Contructor.
 
Method Summary
 String getAbbreviation()
          Get the party's abbreviation.
 Color getColour()
          Get the party's colour.
 String getFullName()
          Get the party's fullname.
 URL getHomePage()
           
static String independentCheck(String constituency, String party)
          Independent candidates are unique in that there can be more than one standing in a particular constituency.
static void resetIndependentCounter()
          Reset the hashtable containing independent counters.
 void setAbbreviation(String abbreviation)
          Set the party's abbreviation.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INDEPENDENT

public static final String INDEPENDENT
Independent full name string.

See Also:
Constant Field Values

IND

public static final String IND
Independent abbreviation.

See Also:
Constant Field Values

IND_LAB

public static final String IND_LAB
Independent Labour abbreviation.

See Also:
Constant Field Values

IND_CON

public static final String IND_CON
Independent conservative abbreviation.

See Also:
Constant Field Values

IND_GRN

public static final String IND_GRN
Independent green abbreviation.

See Also:
Constant Field Values

OTHERS

public static final String OTHERS
Other party.

See Also:
Constant Field Values
Constructor Detail

Party

public Party(String abbreviation,
             String fullName)
Constructor.

Parameters:
abbreviation - The party abbreviation.
fullName - The party full name.

Party

public Party(String abbreviation,
             String fullName,
             URL homePage)
Constructor.

Parameters:
abbreviation - The party abbreviation.
fullName - The party full name.
homePage - The party's home page.

Party

public Party(String abbreviation,
             String fullName,
             boolean useProperties)
Constructor.

Parameters:
abbreviation - The party abbreviation.
fullName - The party full name.
useProperties - Whether or not to use the Propeties to get party colours.

Party

public Party(String abbreviation,
             String fullName,
             URL homePage,
             boolean useProperties)
Contructor.

Parameters:
abbreviation - The party abbreviation.
fullName - The party full name.
homePage - The party's home page URL.
useProperties - Whether or not to use the Propeties to get party colours.
Method Detail

getAbbreviation

public String getAbbreviation()
Get the party's abbreviation.

Returns:
The party abbreviation.

getFullName

public String getFullName()
Get the party's fullname.

Returns:
The party full name.

getColour

public Color getColour()
Get the party's colour.

Returns:
The party colour.

setAbbreviation

public void setAbbreviation(String abbreviation)
Set the party's abbreviation.

Parameters:
abbreviation - The party's abbreviation.

independentCheck

public static String independentCheck(String constituency,
                                      String party)
Independent candidates are unique in that there can be more than one standing in a particular constituency. However, the votes table won't allow two candidates to have the same party - this method adds a counter to the party abbreviation if there is more than one independent candidate in the same constituency / region.

Parameters:
constituency - The name of the constituency.
party - The political party.

resetIndependentCounter

public static void resetIndependentCounter()
Reset the hashtable containing independent counters.


getHomePage

public URL getHomePage()
Returns:
The party's home page.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2008. All Rights Reserved.