import java.util.*;


/**
 * A class that can be used to read String representations of
 * Person objects from a file
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.0
 */
public class PersonReader
{
    private Scanner   scanner;
    
    /**
     * Explicit Value Constructor
     *
     * @param fileName   The name of the file to read from
     */
    public PersonReader(String fileName)
    {
       scanner = new Scanner(fileName);
    }
    



    /**
     * Read a String representation of a Person from the file
     *
     * @return   The resulting Person
     */
    public Person readPerson()
    {
       Person      result;       
       String      line;
       
       
       line      = scanner.nextLine();
       result    = Person.createPerson(line);
       
       return result;       
    }
    

}
