public class SDfileReader extends GraphReader
Constructor and Description |
---|
SDfileReader(java.io.Reader reader,
int mode)
Create a reader for SDfiles.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDesc()
Get a (line) description of the current graph.
|
static void |
main(java.lang.String[] args)
Main function for testing basic functionality.
|
boolean |
readGraph()
Get the next graph description.
|
boolean |
readHeader()
Read an (optional) header.
|
protected java.lang.String |
readLine()
Read the next input line.
|
createReader, getAbsCompl, getAbsSupp, getEdgeCount, getGraph, getMode, getName, getNodeCount, getNotation, getRelCompl, getRelSupp, getValue
public SDfileReader(java.io.Reader reader, int mode)
reader
- the reader to read frommode
- the read modeprotected java.lang.String readLine() throws java.io.IOException
null
if the end of the input stream has been reachedjava.io.IOException
- if an i/o error occurspublic boolean readHeader() throws java.io.IOException
This function always returns false
and reads
nothing, since headers are not supported with SDfiles.
readHeader
in class GraphReader
false
, since SDfile do not have a headerjava.io.IOException
- if an i/o error occurspublic boolean readGraph() throws java.io.IOException
The next graph description is read and split into the graph name, the associated value and the actual graph description.
These individual parts may then be retrieved with the functionsgetName(), getValue()
and
getDesc()
.
readGraph
in class GraphReader
java.io.IOException
- if an i/o error or a parse error occurspublic java.lang.String getDesc()
Since a connection table is not a line description, it is reformatted into the SMILES format.
getDesc
in class GraphReader
public static void main(java.lang.String[] args)
args
- the command line arguments