java.lang.Object
de.grogra.mtg.MTGGraphBuilder
Maintains state of the MTG data loading.
Also maintains the generated graph structure.
- Since:
- 2011-11-24
- Author:
- Ong Yongzhi
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final int
protected static final int
protected static final int
protected static final int
protected static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
Number of nodes generated.protected MTGNode
Allows MTGTranslator to obtain the root node of the graph generated from translating MTG data file.long
getStage()
Current stage being processed by the graph builder.boolean
processTokens
(String[] tokens) Processes tokens and generates nodes and edges as necessary to the current graph.void
Removes inter-scale topological relations (i.e. successor and branching edges).void
Creates Node classes or Modules Types and stores them in the root node.void
Put node list into root node after building graph.
-
Field Details
-
MTG_HEADER_CODE
protected static final int MTG_HEADER_CODE- See Also:
-
MTG_HEADER_CLASSES
protected static final int MTG_HEADER_CLASSES- See Also:
-
MTG_HEADER_TOPO
protected static final int MTG_HEADER_TOPO- See Also:
-
MTG_HEADER_ATTRIBUTES
protected static final int MTG_HEADER_ATTRIBUTES- See Also:
-
MTG_BODY_DATA
protected static final int MTG_BODY_DATA- See Also:
-
-
Constructor Details
-
MTGGraphBuilder
-
-
Method Details
-
getMTGRootNode
Allows MTGTranslator to obtain the root node of the graph generated from translating MTG data file.- Returns:
- MTGNode The root node of the graph generated from MTG data file. Null if no graph generated.
-
getFirstNode
-
getMTGNodeCount
public long getMTGNodeCount()Number of nodes generated.- Returns:
- long Number of nodes generated.
-
getStage
public long getStage()Current stage being processed by the graph builder.- Returns:
- int Current stage being processed by the graph builder.
-
storeNodeListInRoot
public void storeNodeListInRoot()Put node list into root node after building graph. -
removeInterScaleTopoRelations
Removes inter-scale topological relations (i.e. successor and branching edges).- Throws:
MTGError.MTGPlantFrameException
-
processTokens
Processes tokens and generates nodes and edges as necessary to the current graph.- Parameters:
tokens
- Array of strings representing tokens.- Throws:
MTGError.MTGGraphBuildException
-
removeTypes
public void removeTypes()Creates Node classes or Modules Types and stores them in the root node.
-