|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.io.gml.ItemParser y.io.gml.GraphParser
public class GraphParser
This class works together with NodeParser and EdgeParser instances. It can parse the .graph scope It will store the mapping between element ids (Integer) to element instances in the graph.
Field Summary | |
---|---|
protected Graph2D |
graph
The graph that this parser is currently building. |
protected java.util.Map |
id2Edge
The map that is currently used by the parser to map GML String IDs to actual edges. |
protected java.util.Map |
id2Node
The map that is currently used by the parser to map GML String IDs to actual nodes. |
Fields inherited from class y.io.gml.ItemParser |
---|
attributes, childMap, delegate, level |
Constructor Summary | |
---|---|
GraphParser(Graph2D graph)
Creates a new instance that will build the given graph. |
Method Summary | |
---|---|
void |
addAttribute(java.lang.String key,
java.lang.Object value)
Puts the key value pair into the local attribute map |
void |
end()
this method will be called as soon as the parser leaves the scope. |
java.util.Map |
getId2Edge()
Getter for property id2Edge. |
java.util.Map |
getId2Node()
Getter for property id2Node. |
java.lang.Object |
getItem()
Returns the "product" of this scope. |
Methods inherited from class y.io.gml.ItemParser |
---|
addChild, attribute, attribute, begin, beginScope, childFinished, endScope, getAttributes, getBoolean, getDouble, getDouble, getInt, getInt, getLevel, getString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Graph2D graph
protected java.util.Map id2Node
protected java.util.Map id2Edge
Constructor Detail |
---|
public GraphParser(Graph2D graph)
graph
- Method Detail |
---|
public java.lang.Object getItem()
ItemParser
ItemParser.end()
has been called. The latter should construct
the resulting item from the collected data and this item
should be returned by this method. By default, this method
return the map of the attributes.
getItem
in class ItemParser
Map
public java.util.Map getId2Edge()
public java.util.Map getId2Node()
public void addAttribute(java.lang.String key, java.lang.Object value)
ItemParser
addAttribute
in class ItemParser
key
- the keyvalue
- the valuepublic void end()
ItemParser
end
in class ItemParser
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |