edu.pdx.cs399J.family
Class PrettyPrinter

java.lang.Object
  extended by edu.pdx.cs399J.family.PrettyPrinter
All Implemented Interfaces:
Dumper

public class PrettyPrinter
extends Object
implements Dumper

This class dumps a family tree to a text file in a format that can be read by a person.

Author:
David Whitlock

Constructor Summary
PrettyPrinter(File file)
          Creates a new pretty printer that prints to a given file.
PrettyPrinter(String fileName)
          Creates a new pretty printer that prints to a file of a given name.
 
Method Summary
 void dump(FamilyTree tree)
          Prints the contents of the given family tree in a human-readable format.
static void main(String[] args)
          Test program.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrettyPrinter

public PrettyPrinter(String fileName)
              throws IOException
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

public PrettyPrinter(File file)
              throws IOException
Creates a new pretty printer that prints to a given file.

Throws:
IOException
Method Detail

dump

public void dump(FamilyTree tree)
Prints the contents of the given family tree in a human-readable format.

Specified by:
dump in interface Dumper

main

public static void main(String[] args)
Test program. Create a simple family tree and print it to the console.



Copyright © 2000-2009 Portland State University. All Rights Reserved.