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

/**
 * Methods to parse a line into three integers.
 **/

public class InputParser
{
    private final int   INT_CNT = 3;
    private int[]       number = new int[INT_CNT+1];    // Room for an extra number
    private int         valid;

    /******************************************************************
     * If the line is in valid form, set valid to true and set the object
     * to have the value of the three integers.  Otherwise set valid to false.
     *
     * @param line  The line to be parsed
     * @param delim The delimiters that separate integers
     ******************************************************************/
    public InputParser (String line, String delim)
    {
    }

    /******************************************************************
    * An accessor method that returns whether or not the line was valid.
    * @return Whether or not the line was valid.
     ******************************************************************/
    public boolean isValid()
    {
        return valid;
    }

    /******************************************************************
     * An accessor method that returns the requested integer.
     * @param which A value between 1 and INT_CNT specifying which integer.
     * @return      The requested integer's value. Zero is returned if 
     *              the requested integer is not between 1 and INT_CNT.
     ******************************************************************/
    public int getInteger(int which)
    {
        int value;
        if (which >= 1  && which <= INT_CNT)
            value = this.number[which-1];
        else
            value = 0;
        return value;
    }
}
