org.samcrow.io
Class MapIO

java.lang.Object
  extended by org.samcrow.io.MapIO
Direct Known Subclasses:
BasicIO

public abstract class MapIO
extends java.lang.Object

Base class for writing maps to files and reading them from files.

Author:
Sam Crow

Field Summary
protected  java.lang.String filename
           
 
Constructor Summary
MapIO(java.lang.String inFilename)
           
 
Method Summary
abstract  java.lang.Object[] read()
          Read the file; get the nodes and links defined in it
abstract  void write(java.util.Collection<Node> nodes, java.util.Collection<Link> links)
          Writes to the file that this instance uses
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filename

protected java.lang.String filename
Constructor Detail

MapIO

public MapIO(java.lang.String inFilename)
Method Detail

write

public abstract void write(java.util.Collection<Node> nodes,
                           java.util.Collection<Link> links)
Writes to the file that this instance uses

Parameters:
nodes - the nodes to write
links - the links to write

read

public abstract java.lang.Object[] read()
                                 throws java.text.ParseException
Read the file; get the nodes and links defined in it

Returns:
Array(Collection<Node>, Collection<Link>)
Throws:
java.text.ParseException - if the file is invalid