Package edu.pdx.cs410J.family
Class PrettyPrinter
java.lang.Object
edu.pdx.cs410J.family.PrettyPrinter
- All Implemented Interfaces:
Dumper
This class dumps a family tree to a text file in a format that can
be read by a person.
- Author:
- David Whitlock
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classInner class used only by the dump method. -
Constructor Summary
ConstructorsConstructorDescriptionPrettyPrinter(File file) Creates a new pretty printer that prints to a given file.Creates a new pretty printer that prints to aPrintWriter.PrettyPrinter(String fileName) Creates a new pretty printer that prints to a file of a given name. -
Method Summary
Modifier and TypeMethodDescriptionvoiddump(FamilyTree tree) Prints the contents of the given family tree in a human-readable format.static voidTest program.
-
Constructor Details
-
PrettyPrinter
Creates a new pretty printer that prints to a file of a given name. If the file does not exist, it is created.- Throws:
IOException
-
PrettyPrinter
Creates a new pretty printer that prints to a given file.- Throws:
IOException
-
PrettyPrinter
Creates a new pretty printer that prints to aPrintWriter. This way, we can print to destinations other than files (such as the console).
-
-
Method Details