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
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final intprotected static final intprotected static final intprotected static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongNumber of nodes generated.protected MTGNodeAllows MTGTranslator to obtain the root node of the graph generated from translating MTG data file.longgetStage()Current stage being processed by the graph builder.booleanprocessTokens(String[] tokens) Processes tokens and generates nodes and edges as necessary to the current graph.voidRemoves inter-scale topological relations (i.e. successor and branching edges).voidCreates Node classes or Modules Types and stores them in the root node.voidPut 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.
-