Package moss
Class LineReader
- All Implemented Interfaces:
Closeable
,Serializable
,AutoCloseable
,Readable
Class for readers for simple table formats for graph data sets.
- Since:
- 2007.03.04
- 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, buf, cflags, COMMENT, delim, field, FLDSEP, recno, RECSEP
Fields inherited from class java.io.FilterReader
in
-
Constructor Summary
ConstructorsConstructorDescriptionLineReader
(Reader reader, int mode, Notation ntn) Create a table reader with default character flags. -
Method Summary
Methods inherited from class moss.GraphReader
createReader, createReader, getAbsCompl, getAbsSupp, getDesc, getEdgeCount, 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
-
LineReader
Create a table reader with default character flags.By default the following character settings are used:
record separators: "\n", field separators: " \t", blanks: " \r\t", comment characters: "#".- Parameters:
reader
- the reader to work onmode
- the read modentn
- the notation of the graphs- Since:
- 2006.10.05 (Christian Borgelt)
-
-
Method Details
-
readHeader
Read an (optional) table header.- Specified by:
readHeader
in classGraphReader
- Returns:
- whether a header was present (otherwise the end of the input has been reached)
- Throws:
IOException
- if an i/o error occurs- Since:
- 2007.03.04 (Christian Borgelt)
-
readGraph
Read the next graph description.The next graph description is read and split into the graph name/identifier, the graph description, the associated value (only in mode
These properties may then be retrieved with the functionsGRAPHS
), and the support information (only in modeSUBS
).getName()
,getDesc()
,getValue()
etc.- 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 occurs- Since:
- 2007.03.04 (Christian Borgelt)
-
getGraph
Get the current graph or substructure.- Overrides:
getGraph
in classGraphReader
- Returns:
- the current graph
- Throws:
IOException
- if a parse error occurs- 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)
-