Package org.graphstream.stream.file.gml
Class GMLParser
java.lang.Object
org.graphstream.stream.file.gml.GMLParser
- All Implemented Interfaces:
GMLParserConstants,Parser
public class GMLParser extends Object implements Parser, GMLParserConstants
-
Field Summary
Fields Modifier and Type Field Description Tokenjj_ntNext token.TokentokenCurrent token.GMLParserTokenManagertoken_sourceGenerated Token Manager. -
Constructor Summary
Constructors Constructor Description GMLParser(InputStream stream)Constructor with InputStream.GMLParser(InputStream stream, String encoding)Constructor with InputStream and supplied encodingGMLParser(Reader stream)Constructor.GMLParser(FileSourceGML gml, InputStream stream)GMLParser(FileSourceGML gml, Reader stream)GMLParser(GMLParserTokenManager tm)Constructor with generated Token Manager. -
Method Summary
Modifier and Type Method Description voidall()Parse the whole stream.voidclose()Closes the parser, closing the opened stream.voiddiGraphStart()voiddisable_tracing()Disable tracing.voidenable_tracing()Enable tracing.ParseExceptiongenerateParseException()Generate ParseException.TokengetNextToken()Get the next Token.TokengetToken(int index)Get the specific Token.voidgraphEnd()voidgraphStart()booleanisInGraph()StringkeyValue(org.graphstream.stream.file.gml.KeyValues values)A set of key and value, the value can recursively be a list of key-values.org.graphstream.stream.file.gml.KeyValueslist()A list of key values, all values are stored in a KeyValues object.booleannext()org.graphstream.stream.file.gml.KeyValuesnextEvents()The top-level method to be called by the file source.voidopen()Start parsing the stream.voidReInit(InputStream stream)Reinitialise.voidReInit(InputStream stream, String encoding)Reinitialise.voidReInit(Reader stream)Reinitialise.voidReInit(GMLParserTokenManager tm)Reinitialise.voidstart()Unused rule, call it to slurp in the whole file.booleanstep()Objectvalue(String key)A value for a key, either a number, a string or a recursive list of key-values.
-
Field Details
-
token_source
Generated Token Manager. -
token
Current token. -
jj_nt
Next token.
-
-
Constructor Details
-
Method Details
-
isInGraph
public boolean isInGraph() -
open
Description copied from interface:ParserStart parsing the stream.- Specified by:
openin interfaceParser- Throws:
ParseExceptionIOException
-
next
- Specified by:
nextin interfaceParser- Returns:
- Throws:
ParseExceptionIOException
-
step
- Throws:
IOExceptionParseException
-
close
Closes the parser, closing the opened stream.- Specified by:
closein interfaceParser- Throws:
IOException
-
start
Unused rule, call it to slurp in the whole file.- Throws:
ParseException
-
all
Description copied from interface:ParserParse the whole stream.- Specified by:
allin interfaceParser- Throws:
ParseExceptionIOException
-
graphStart
- Throws:
ParseException
-
diGraphStart
- Throws:
ParseException
-
graphEnd
- Throws:
ParseException
-
nextEvents
The top-level method to be called by the file source. Returns a set of top-level key values or null if the end of the file was reached. Top-level key values are nodes and edges as well as all key-values defined before and after the graph.- Throws:
ParseException
-
list
A list of key values, all values are stored in a KeyValues object.- Throws:
ParseException
-
keyValue
public final String keyValue(org.graphstream.stream.file.gml.KeyValues values) throws ParseExceptionA set of key and value, the value can recursively be a list of key-values. Only the key-value list "graph [ ... ]" is not parsed by this rule, and parsed by another rules, so that the nextEvent() rule can be called repeatedly.- Throws:
ParseException
-
value
A value for a key, either a number, a string or a recursive list of key-values.- Throws:
ParseException
-
ReInit
Reinitialise. -
ReInit
Reinitialise. -
ReInit
Reinitialise. -
ReInit
Reinitialise. -
getNextToken
Get the next Token. -
getToken
Get the specific Token. -
generateParseException
Generate ParseException. -
enable_tracing
public final void enable_tracing()Enable tracing. -
disable_tracing
public final void disable_tracing()Disable tracing.
-