Package moss
Class GraphReader
java.lang.Object
java.io.Reader
java.io.FilterReader
java.io.PushbackReader
moss.TableReader
moss.GraphReader
- All Implemented Interfaces:
Closeable
,Serializable
,AutoCloseable
,Readable
- Direct Known Subclasses:
LineReader
,NEListReader
,SDfileReader
Class for a reader for graph data sets.
- Since:
- 2007.02.24
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
the absolute support in the complementprotected float
the relative support in the complementprotected String
the description of the current graphstatic final int
read mode: whether graphs/substructures are directedprotected int
the number of edges of the current graphstatic final int
read mode mask: table input formatsprotected Graph
the current graphstatic final int
read mode: graphsprotected int
the read modeprotected String
the name/identifier of the current graphprotected int
the number of nodes of the current graphprotected Notation
the notation for parsing graph descriptionsprotected int
the absolute support in the focusprotected float
the relative support in the focusstatic final int
read mode: substructuresprotected float
the value associated with the current graphFields inherited from class moss.TableReader
BLANK, buf, cflags, COMMENT, delim, field, FLDSEP, recno, RECSEP
Fields inherited from class java.io.FilterReader
in
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic GraphReader
createReader
(Reader reader, int mode, String format) Create a graph reader for a given format and mode.static GraphReader
createReader
(Reader reader, int mode, String format, Notation ntn) Create a graph reader for a given format and mode.int
Get the absolute complement support of the current substructure.int
Get the absolute focus support of the current substructure.getDesc()
Get a line description of the current graph.int
Get the number of edges of the current graph.getGraph()
Get the current graph or substructure.int
getMode()
Get the mode of the graph reader.getName()
Get the name of the current graph.int
Get the number of nodes of the current graph.Get the notation of the graph reader.float
Get the relative support of the current substructure.float
Get the relative focus support of the current substructure.float
getValue()
Get the value associated with the current graph.abstract boolean
Read a graph.abstract boolean
Read an (optional) header.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
-
Field Details
-
GRAPHS
public static final int GRAPHSread mode: graphs- See Also:
-
SUBS
public static final int SUBSread mode: substructures- See Also:
-
DIRECTED
public static final int DIRECTEDread mode: whether graphs/substructures are directed- See Also:
-
FMTMASK
public static final int FMTMASKread mode mask: table input formats- See Also:
-
mode
protected int modethe read mode -
ntn
the notation for parsing graph descriptions -
name
the name/identifier of the current graph -
desc
the description of the current graph -
graph
the current graph -
value
protected float valuethe value associated with the current graph -
nodes
protected int nodesthe number of nodes of the current graph -
edges
protected int edgesthe number of edges of the current graph -
sabs
protected int sabsthe absolute support in the focus -
srel
protected float srelthe relative support in the focus -
cabs
protected int cabsthe absolute support in the complement -
crel
protected float crelthe relative support in the complement
-
-
Constructor Details
-
GraphReader
Create a reader for a graph data set.- Parameters:
reader
- the reader to read frommode
- the read mode- Since:
- 2007.06.29 (Christian Borgelt)
-
-
Method Details
-
getMode
public int getMode()Get the mode of the graph reader.- Returns:
- the mode of the graph reader
- Since:
- 2007.03.04 (Christian Borgelt)
-
getNotation
Get the notation of the graph reader.- Returns:
- the notation of the graph reader
- Since:
- 2007.03.04 (Christian Borgelt)
-
readHeader
Read an (optional) header.- 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 a graph.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.- Returns:
- whether another 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.02.24 (Christian Borgelt)
-
getName
Get the name of the current graph.- Returns:
- the name of the current graph
- Since:
- 2007.02.24 (Christian Borgelt)
-
getDesc
Get a line description of the current graph.- Returns:
- a line description of the current graph
- Since:
- 2007.03.04 (Christian Borgelt)
-
getGraph
Get the current graph or substructure.- Returns:
- the current graph
- Throws:
IOException
- if a parse error occurs- Since:
- 2007.03.04 (Christian Borgelt)
-
getNodeCount
public int getNodeCount()Get the number of nodes of the current graph.- Returns:
- the number of nodes of the current graph or -1 if this number is not known
- Since:
- 2007.03.04 (Christian Borgelt)
-
getEdgeCount
public int getEdgeCount()Get the number of edges of the current graph.- Returns:
- the number of edges of the current graph or -1 if this number is not known
- Since:
- 2007.03.04 (Christian Borgelt)
-
getValue
public float getValue()Get the value associated with the current graph.- Returns:
- the value associated with the current graph
- Since:
- 2007.02.24 (Christian Borgelt)
-
getAbsSupp
public int getAbsSupp()Get the absolute focus support of the current substructure.- Returns:
- the absolute focus support
- Since:
- 2007.03.04 (Christian Borgelt)
-
getRelSupp
public float getRelSupp()Get the relative focus support of the current substructure.- Returns:
- the relative focus support
- Since:
- 2007.03.04 (Christian Borgelt)
-
getAbsCompl
public int getAbsCompl()Get the absolute complement support of the current substructure.- Returns:
- the absolute complement support
- Since:
- 2007.03.04 (Christian Borgelt)
-
getRelCompl
public float getRelCompl()Get the relative support of the current substructure.- Returns:
- the relative complement support
- Since:
- 2007.03.04 (Christian Borgelt)
-
createReader
Create a graph reader for a given format and mode.- Parameters:
reader
- the reader to read frommode
- the read modeformat
- the name of the format/notationntn
- the notation (if shared with another reader)- Returns:
- the created graph reader
- Since:
- 2021.10.17 (Christian Borgelt)
-
createReader
Create a graph reader for a given format and mode.- Parameters:
reader
- the reader to read frommode
- the read modeformat
- the name of the format/notation- Returns:
- the created graph reader
- Since:
- 2007.03.04 (Christian Borgelt)
-