org.gswing.components.common
Class DbXmlWriter

java.lang.Object
  extended by org.gswing.utils.xml.XmlReader
      extended by org.gswing.utils.xml.XmlWriter
          extended by org.gswing.components.common.DbXmlWriter

public class DbXmlWriter
extends XmlWriter

Purpose: Writes election data to an XML file.


Field Summary
static String AFFILIATION
          XML AFFILIATION tag.
static String CONTEST
          XML CONTEST tag.
static String CONTEST_NAME
          XML CONTEST_NAME tag.
static String DATE
          XML DATE tag.
static String ELECTION_NAME
          XML ELECTION_NAME tag.
static String EVENT
          XML EVENT tag.
static String LEADER
          XML LEADER tag.
static String LEADER_NAME
          XML LEADER_NAME tag.
static String LEADERSHIP
          XML LEADERSHIP tag.
static String MAX_VOTES
          XML MAX_VOTES tag.
static String OPTION
          XML OPTION tag.
static String OPTION_NAME
          XML OPTION_NAME tag.
static String PARENT
          XML PARENT tag.
static String SYSTEM
          XML SYSTEM tag.
static String TYPE
          XML TYPE tag.
static String UNKNOWN
          Unknown leader string.
static String VALID_VOTES
          XML VALID_VOTES tag.
 
Constructor Summary
DbXmlWriter(File file)
          Constructor.
 
Method Summary
 boolean writeToFile(Election election, Hashtable results, Vector leaders)
          Write the election data to file.
 
Methods inherited from class org.gswing.utils.xml.XmlWriter
getNewDocument, writeToFile
 
Methods inherited from class org.gswing.utils.xml.XmlReader
getDocument, getFile, readFromFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVENT

public static final String EVENT
XML EVENT tag.

See Also:
Constant Field Values

DATE

public static final String DATE
XML DATE tag.

See Also:
Constant Field Values

TYPE

public static final String TYPE
XML TYPE tag.

See Also:
Constant Field Values

SYSTEM

public static final String SYSTEM
XML SYSTEM tag.

See Also:
Constant Field Values

OPTION

public static final String OPTION
XML OPTION tag.

See Also:
Constant Field Values

ELECTION_NAME

public static final String ELECTION_NAME
XML ELECTION_NAME tag.

See Also:
Constant Field Values

PARENT

public static final String PARENT
XML PARENT tag.

See Also:
Constant Field Values

CONTEST

public static final String CONTEST
XML CONTEST tag.

See Also:
Constant Field Values

CONTEST_NAME

public static final String CONTEST_NAME
XML CONTEST_NAME tag.

See Also:
Constant Field Values

MAX_VOTES

public static final String MAX_VOTES
XML MAX_VOTES tag.

See Also:
Constant Field Values

OPTION_NAME

public static final String OPTION_NAME
XML OPTION_NAME tag.

See Also:
Constant Field Values

AFFILIATION

public static final String AFFILIATION
XML AFFILIATION tag.

See Also:
Constant Field Values

VALID_VOTES

public static final String VALID_VOTES
XML VALID_VOTES tag.

See Also:
Constant Field Values

LEADERSHIP

public static final String LEADERSHIP
XML LEADERSHIP tag.

See Also:
Constant Field Values

LEADER

public static final String LEADER
XML LEADER tag.

See Also:
Constant Field Values

LEADER_NAME

public static final String LEADER_NAME
XML LEADER_NAME tag.

See Also:
Constant Field Values

UNKNOWN

public static final String UNKNOWN
Unknown leader string.

See Also:
Constant Field Values
Constructor Detail

DbXmlWriter

public DbXmlWriter(File file)
Constructor. Set up the XML document.

Parameters:
file - The file to be used.
Method Detail

writeToFile

public boolean writeToFile(Election election,
                           Hashtable results,
                           Vector leaders)
Write the election data to file.

Parameters:
election - The election that the data is to be created for.
results - The hastable of results to write to file.
leaders - Vector of Candidates that are the party leaders for this election.
Returns:
True if the data is successully written to file.


Copyright © 2008. All Rights Reserved.