- java.lang.Object
-
- org.jgrapht.nio.graph6.Graph6Sparse6EventDrivenImporter.Parser
-
- Enclosing class:
- Graph6Sparse6EventDrivenImporter
private class Graph6Sparse6EventDrivenImporter.Parser extends java.lang.Object
The actual parser. The parser assumes the input is a single line.
-
-
Constructor Summary
Constructors Constructor Description Parser(java.lang.String inputLine)
Create a new parser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private int
getBits(int k)
Converts the next k bits of data to an integervoid
parse()
private void
readGraph6()
private void
readNumberOfVertices()
Read the number of vertices in the graphprivate void
readSparse6()
private void
validateInput()
Check whether the g6 or s6 encoding contains any obvious errors
-
-
-
Field Detail
-
format
private Graph6Sparse6EventDrivenImporter.Format format
-
bytes
private byte[] bytes
-
byteIndex
private int byteIndex
-
bitIndex
private int bitIndex
-
n
private int n
-
-
Method Detail
-
parse
public void parse()
-
readGraph6
private void readGraph6() throws ImportException
- Throws:
ImportException
-
readSparse6
private void readSparse6() throws ImportException
- Throws:
ImportException
-
validateInput
private void validateInput() throws ImportException
Check whether the g6 or s6 encoding contains any obvious errors- Throws:
ImportException
- in case any error occurs, such as I/O or parse error
-
readNumberOfVertices
private void readNumberOfVertices() throws ImportException
Read the number of vertices in the graph- Throws:
ImportException
- in case any error occurs, such as I/O or parse error
-
getBits
private int getBits(int k) throws ImportException
Converts the next k bits of data to an integer- Parameters:
k
- number of bits- Returns:
- the next k bits of data represented by an integer
- Throws:
ImportException
-
-