import java.io.*;
import java.util.*;

/** Candidate main program
 *
 * @author Duncan Buell
 *
 * written: 28 October 2007
*/
public class Main extends Object
{

  public static void main(String[] args)
  {

    String inputFileName = null;
    Scanner inDataFile = null;
    CandidateList theList = new CandidateList();

    inputFileName = "theDataFile.dat";
    inDataFile = DAB.ScannerOpen(inputFileName);
    System.out.println("Input file '" + inputFileName + "' opened, continue");

/******************************************************************************/
/** Read in the list of candidates
**/
    System.out.println("Read in the data");
    theList.getTheList(inDataFile);
    System.out.println("The data has been read");

/******************************************************************************/
/** Use the data in the array list
**/
    System.out.printf("%nThe entire list of candidates is%n");
    theList.printTheList();

    System.out.printf("%nThe list of Democratic candidates is%n");
    theList.printByParty("DEM");

    System.out.printf("%nThe list of Republican candidates is%n");
    theList.printByParty("REP");

    System.out.printf("%nThe list of New Yorkers who are candidates is%n");
    theList.printByState("NY");

    System.out.printf("%nThe list of Democratic candidates is%n");
    theList.printWithMatch(Fields.PARTY, "DEM");

  } // public static void main(String[] args)

} // public class Main extends Object

