org.vizzini.util.tree
Class TreeNodePersister

java.lang.Object
  extended by org.vizzini.util.tree.TreeNodePersister

public class TreeNodePersister
extends Object

Provides persistence methods for a tree node.

Since:
v0.3
Version:
v0.3
Author:
Jeffrey M. Thompson

Method Summary
static TreeNodePersister getInstance()
          Return the singleton instance of this class.
 ITreeNode read(File file)
          Read a tree node from the given file.
 ITreeNode read(InputStream inputStream)
          Read a tree node from the given input stream.
 ITreeNode read(String filename)
          Read a tree node from the given file.
 void save(ITreeNode treeNode, File file)
          Save the given tree node to the given file.
 void save(ITreeNode treeNode, OutputStream outputStream)
          Save the given tree node to the given output stream.
 void save(ITreeNode treeNode, String filename)
          Save the given tree node to the given file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static TreeNodePersister getInstance()
Return the singleton instance of this class.

Returns:
The single instance.
Since:
v0.3

read

public ITreeNode read(String filename)
               throws FileNotFoundException
Read a tree node from the given file.

Parameters:
filename - Filename.
Throws:
FileNotFoundException
Since:
v0.3

read

public ITreeNode read(File file)
               throws FileNotFoundException
Read a tree node from the given file.

Parameters:
file - File.
Throws:
FileNotFoundException
Since:
v0.3

read

public ITreeNode read(InputStream inputStream)
               throws FileNotFoundException
Read a tree node from the given input stream.

Parameters:
inputStream - Input stream.
Throws:
FileNotFoundException
Since:
v0.3

save

public void save(ITreeNode treeNode,
                 String filename)
          throws FileNotFoundException
Save the given tree node to the given file.

Parameters:
treeNode - Tree node to save.
filename - Filename.
Throws:
FileNotFoundException
Since:
v0.3

save

public void save(ITreeNode treeNode,
                 File file)
          throws FileNotFoundException
Save the given tree node to the given file.

Parameters:
treeNode - Tree node to save.
file - File.
Throws:
FileNotFoundException
Since:
v0.3

save

public void save(ITreeNode treeNode,
                 OutputStream outputStream)
          throws FileNotFoundException
Save the given tree node to the given output stream.

Parameters:
treeNode - Tree node to save.
outputStream - Output stream.
Throws:
FileNotFoundException
Since:
v0.3


Copyright © 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02