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

public class Batch
{
    public static char DELIMITER = ':';
    public static char SPACE = ' ';

    public static Vector<Passwport> loadData (String inputFile, boolean debug)
    {
        /*
         * Open the data file and read it in.
         */

        BufferedReader reader = null;
        Vector<Passport> results = new Vector<Passport>();

        try
        {
            String line = null;

            reader = new BufferedReader(new FileReader(inputFile));

            while ((line = reader.readLine()) != null)
            {
                Passport p = new Passport();

                if (line.length() > 0) // blank?
                {
                    String[] tuples = line.split(SPACE);

                    for (int i = 0; i < tuples.length; i++)
                    {
                        String[] pairs = tuples[i].split(DELIMITER);

                        if (pairs.length != 2)
                            System.out.println("Error - more than two in the pairs field! "+pairs);
                        else
                        {
                            switch (pairs[0])
                            {
                                case PassportFields.BIRTH_YEAR:
                                {
                                    p.setBirthYear(Integer.parseInt(pairs[1]));
                                }
                                break;
                                case PassportFields.ISSUE_YEAR:
                                {
                                    p.setIssueYear(Integer.parseInt(pairs[1]));
                                }
                                break;
                                case PassportFields.EXPORATION_YEAR:
                                {
                                    p.setExpirationYear(Integer.parseInt(pairs[1]));
                                }
                                break;
                                case PassportFields.HEIGHT:
                                {
                                    p.setHeight(Integer.parseInt(pairs[1]));
                                }
                                break;
                                case PassportFields.HAIR_COLOUR:
                                {
                                    p.setExpirationYear(pairs[1]);
                                }
                                break;
                                case PassportFields.EYE_COLOUR:
                                {
                                    p.setExpirationYear(pairs[1]);
                                }
                                break;
                                case PassportFields.PASSPORT_ID:
                                {
                                    p.setPassportIDInteger.parseInt(pairs[1]);
                                }
                                break;
                                case PassportFields.COUNTRY_ID:
                                {
                                    p.setCountryID(Integer.parseInt(pairs[1]));
                                }
                                break;
                                default:
                                {
                                    System.out.println("Error - unknown field: "+pairs[0]);
                                }
                                break;
                            }
                        }
                    }
                }

                if (debug)
                    System.out.println("Loaded passport: "+p);

                results.add(p);
            }
        }
        catch (Throwable ex)
        {
            ex.printStackTrace();
        }
        finally
        {
            try
            {
                reader.close();
            }
            catch (Throwable ex)
            {
            }
        }

        return results;
    }

    private Batch ()
    {
    }
}
@@ -71,20 +71,22 @@
  static 
-char
+String
  DELIMIT
@@ -94,11 +94,11 @@
 R = 
-':'
+%22:%22
 ;%0A  
@@ -117,12 +117,14 @@
 tic 
-char
+String
  SPA
@@ -132,11 +132,11 @@
 E = 
-' '
+%22 %22
 ;%0A%0A 
@@ -163,17 +163,16 @@
 tor%3CPass
-w
 port%3E lo
@@ -2323,37 +2323,33 @@
        p.set
-ExpirationYea
+HairColou
 r(pairs%5B1%5D);
@@ -2562,28 +2562,23 @@
   p.setE
-xpirationYea
+yeColou
 r(pairs%5B
@@ -2805,16 +2805,17 @@
 ssportID
+(
 Integer.
@@ -2824,32 +2824,33 @@
 rseInt(pairs%5B1%5D)
+)
 ;%0A              

Update Batch.java