org.gswing.components.input
Class Misc

java.lang.Object
  extended by org.gswing.components.common.Misc
      extended by org.gswing.components.input.Misc

public class Misc
extends Misc

Purpose: Purpose: Miscellaneous utility class for the input package.


Field Summary
 
Fields inherited from class org.gswing.components.common.Misc
APPLET_BACKGROUND, CONST_LABEL, CONSTITUENCY, COUNCIL, COUNCIL_LABEL, DEV_BY_ELEC, DEVOLVED, ERROR, FPTP, FPTP_STR, GEN_BY_ELEC, GENERAL, GSWING_VERSION, INFO, INVALID, LIST, LIST_STR, LOCAL, LOCAL_FILE_NAME_ENDING, LOCAL_LABEL, NATIONAL, NEW_LINE, NEXT, NONE_DEFINED, NORMAL_FONT, PREVIOUS, REGION_LABEL, REGIONAL, REGIONAL_FILE_NAME, SERIALISED_FILE_EXT, SMALL_FONT, TABLE_ROW_SELECT, TITLE_FONT, UNCONTESTED, WARN
 
Constructor Summary
Misc()
           
 
Method Summary
static Object[] getConfiguredLabels()
          Get array of configured region labels from properties.
static Date getDateFromString(String text)
          Get the Java Date object from a text string.
static String getFirstName(String fullName)
          Get the first name from a candidates fullname.
static String getNameFromComboText(String text)
          Get the name of candidate from a test string in the format: jimmy smith: AAA.
static String getPartyFromComboText(String text)
          Get the party abbreviation from a test string in the format: "jimmy smith: AAA".
static String getSqlStringFromDate(Date date)
          Get SQL date string from date.
static String getSurname(String fullName)
          Get the surname from a candidates fullname.
 
Methods inherited from class org.gswing.components.common.Misc
getDateFromDbString, getDbProtocol, getElectionColour, getFormattedDate, getFormattedDate, getIntFromStdInput, getShortYear, getStringFromStdInput, getWholeYear, initialise, logError, logMessage, logMessage, logToFile, logWarning, printTitle, showError, showError, showMessage, showMessage, toStdErr, toStdOut, toStdOut
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Misc

public Misc()
Method Detail

getNameFromComboText

public static String getNameFromComboText(String text)
Get the name of candidate from a test string in the format: jimmy smith: AAA.

Parameters:
text - The candidate name and party text string.
Returns:
The candiates full name.

getPartyFromComboText

public static String getPartyFromComboText(String text)
Get the party abbreviation from a test string in the format: "jimmy smith: AAA".

Parameters:
text - The candidate name and party text string.
Returns:
The party abbreviation.

getFirstName

public static String getFirstName(String fullName)
Get the first name from a candidates fullname.

Parameters:
fullName - The candidates full name.
Returns:
The candidates first name.

getSurname

public static String getSurname(String fullName)
Get the surname from a candidates fullname.

Parameters:
fullName - The candidates full name.
Returns:
The candidates surname.

getDateFromString

public static Date getDateFromString(String text)
Get the Java Date object from a text string.

Parameters:
text - The date in the format "dd.MM.yyyy".
Returns:
The Java Date object.

getSqlStringFromDate

public static String getSqlStringFromDate(Date date)
Get SQL date string from date.

Parameters:
date - The date object.

getConfiguredLabels

public static Object[] getConfiguredLabels()
Get array of configured region labels from properties.

Returns:
Array of labels.


Copyright © 2008. All Rights Reserved.