Package moss
Class SDfileReader
java.lang.Object
java.io.Reader
java.io.FilterReader
java.io.PushbackReader
moss.TableReader
moss.GraphReader
moss.SDfileReader
- All Implemented Interfaces:
Closeable
,Serializable
,AutoCloseable
,Readable
Class for readers for structure-data files (SDfile, Elsevier MDL).
- Since:
- 2007.02.24
- See Also:
-
Field Summary
Fields inherited from class moss.GraphReader
cabs, crel, desc, DIRECTED, edges, FMTMASK, graph, GRAPHS, mode, name, nodes, ntn, sabs, srel, SUBS, value
Fields inherited from class moss.TableReader
BLANK, cflags, COMMENT, delim, field, FLDSEP, recno, RECSEP
Fields inherited from class java.io.FilterReader
in
-
Constructor Summary
ConstructorsConstructorDescriptionSDfileReader
(Reader reader, int mode) Create a reader for SDfiles.SDfileReader
(Reader reader, int mode, Ctab ntn) Create a reader for SDfiles. -
Method Summary
Methods inherited from class moss.GraphReader
createReader, createReader, getAbsCompl, getAbsSupp, getEdgeCount, getGraph, getMode, getName, getNodeCount, getNotation, getRelCompl, getRelSupp, getValue
Methods inherited from class moss.TableReader
eof, getTypes, isType, readField, rno, rno, setChars, setChars
Methods inherited from class java.io.PushbackReader
close, mark, markSupported, read, read, ready, reset, skip, unread, unread, unread
Methods inherited from class java.io.Reader
nullReader, read, read, transferTo
-
Constructor Details
-
SDfileReader
Create a reader for SDfiles.- Parameters:
reader
- the reader to read frommode
- the read modentn
- the notation to use- Since:
- 2007.03.04 (Christian Borgelt)
-
SDfileReader
Create a reader for SDfiles.- Parameters:
reader
- the reader to read frommode
- the read mode- Since:
- 2007.03.04 (Christian Borgelt)
-
-
Method Details
-
readLine
Read the next input line.- Returns:
- the next input line or
null
if the end of the input stream has been reached - Throws:
IOException
- if an i/o error occurs- Since:
- 2007.02.24 (Christian Borgelt)
-
readHeader
Read an (optional) header.This function always returns
false
and reads nothing, since headers are not supported with SDfiles.- Specified by:
readHeader
in classGraphReader
- Returns:
false
, since SDfile do not have a header- Throws:
IOException
- if an i/o error occurs- Since:
- 2007.03.04 (Christian Borgelt)
-
readGraph
Get the next graph description.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()
andgetDesc()
.- Specified by:
readGraph
in classGraphReader
- Returns:
- whether a graph description could be read (otherwise the end of the input has been reached)
- Throws:
IOException
- if an i/o error or a parse error occurs- Since:
- 2007.03.02 (Christian Borgelt)
-
getDesc
Get a (line) description of the current graph.Since a connection table is not a line description, it is reformatted into the SMILES format.
- Overrides:
getDesc
in classGraphReader
- Returns:
- a line description (SMILES) of the current graph
- Since:
- 2007.03.04 (Christian Borgelt)
-
main
Main function for testing basic functionality.- Parameters:
args
- the command line arguments- Since:
- 2007.06.26 (Christian Borgelt)
-