public abstract class TextfileReaderWriter extends AbstractReaderWriter implements FileReaderWriter
Modifier and Type | Field and Description |
---|---|
static String |
DELIMITER
line delimiter key *
|
BUILDER, EDGES, GENERATOR, NODES
FILENAME
Constructor and Description |
---|
TextfileReaderWriter() |
Modifier and Type | Method and Description |
---|---|
Graph |
read()
Performs a read of the text file line by line.
|
protected abstract Object |
readInternal(StringTokenizer st)
Template method for returning the object represented by a line in the text file being read.
|
void |
write(Graph g)
Performs a write on the graph out to a text file.
|
protected void |
writeEdge(Writer out,
Edge e)
Template method for writing the text representation of an edge to an text file.
|
protected void |
writeNode(Writer out,
Node n)
Template method for writing the text representation of a node to an text file.
|
getProperty, setProperty, setProperty
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getProperty, setProperty
public static final String DELIMITER
public Graph read() throws Exception
read
in interface GraphReaderWriter
Exception
GraphGenerator#read()
public void write(Graph g) throws Exception
* @see GraphGenerator#write()
write
in interface GraphReaderWriter
g
- The graph to beException
protected void writeNode(Writer out, Node n)
out
- The text file writer.n
- The node to write.protected void writeEdge(Writer out, Edge e)
out
- The text file writer.e
- The edge to write.protected abstract Object readInternal(StringTokenizer st)
st
- The tokenized line read from text file.Copyright © 1996–2022 Geotools. All rights reserved.