- java.lang.Object
-
- org.jgrapht.nio.graph6.Graph6Sparse6EventDrivenImporter.Parser
-
- Enclosing class:
- Graph6Sparse6EventDrivenImporter
private class Graph6Sparse6EventDrivenImporter.Parser extends java.lang.ObjectThe 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 intgetBits(int k)Converts the next k bits of data to an integervoidparse()private voidreadGraph6()private voidreadNumberOfVertices()Read the number of vertices in the graphprivate voidreadSparse6()private voidvalidateInput()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 ImportExceptionCheck 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 ImportExceptionRead 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 ImportExceptionConverts 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
-
-