Package edu.pdx.cs410J.family
Class TextParser
java.lang.Object
edu.pdx.cs410J.family.TextParser
- All Implemented Interfaces:
Parser
This class parses the text output generated by a
TextDumper
and creates a family tree.- See Also:
-
Constructor Summary
ConstructorDescriptionTextParser
(File file) Creates a new text parser that reads its input from the given file.TextParser
(Reader reader) Creates a new text parser that reads its input from the given writer.TextParser
(String fileName) Creates a new text parser that reads its input from a file of a given name. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Test program.parse()
Parses the specified input source and from it creates a family tree.
-
Constructor Details
-
TextParser
Creates a new text parser that reads its input from a file of a given name.- Throws:
FileNotFoundException
-
TextParser
Creates a new text parser that reads its input from the given file.- Throws:
FileNotFoundException
-
TextParser
Creates a new text parser that reads its input from the given writer. This lets us read from a sources other than files.
-
-
Method Details
-
parse
Parses the specified input source and from it creates a family tree.- Specified by:
parse
in interfaceParser
- Throws:
FamilyTreeException
- The data source is malformatted
-
main
Test program. Parse the file that is given on the command line. Pretty print the resulting family tree.
-