|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
edu.uci.ics.jung.io.GraphMLFileHandler
de.uka.algo.GT3D.GT3DGraphMLFileHandler
public class GT3DGraphMLFileHandler
A GraphML file handler to parse simple GraphML files
Field Summary | |
---|---|
(package private) edu.uci.ics.jung.graph.Edge |
currentEdge
The edge represented by the currently open edge tag or null. |
(package private) java.lang.String |
currentKey
The node represented by the currently open data tag or null. |
(package private) edu.uci.ics.jung.graph.Vertex |
currentVertex
The node represented by the currently open edge tag or null. |
(package private) java.util.Map<java.lang.String,java.lang.String> |
keyMap
A map from keys (of data tags) to the corresponding names. |
private edu.uci.ics.jung.graph.Graph |
mGraph
The graph we are reading. |
private edu.uci.ics.jung.graph.decorators.StringLabeller |
mLabeller
Stores the node and edge labels that can be retrieved by its getUserData method. |
Constructor Summary | |
---|---|
GT3DGraphMLFileHandler()
|
Method Summary | |
---|---|
void |
characters(char[] ch,
int start,
int length)
This method is called whenever the SaX parser encounters character content inside a tag |
protected void |
createGraph(java.util.Map attributeMap)
creates a new graph |
protected void |
endData()
Called if a data tag is closed. |
protected void |
endEdge()
Called when a edge tag is closed. |
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
This method is called whenever the SaX parser encounters a closing tag |
protected void |
endVertex()
Called when a vertex tag is closed. |
private java.util.Map<java.lang.String,java.lang.String> |
getAttributeMap(org.xml.sax.Attributes attrs)
|
protected edu.uci.ics.jung.graph.Graph |
getGraph()
|
protected edu.uci.ics.jung.graph.decorators.StringLabeller |
getLabeller()
|
protected void |
insertKey(java.util.Map<java.lang.String,java.lang.String> attributeMap)
Inserts a new (key, value)-pair into keyMap. |
protected void |
startData(java.util.Map attributeMap)
Called if a data tag is found. |
protected edu.uci.ics.jung.graph.Edge |
startEdge(java.util.Map attributeMap)
Initialize a new edge and insert it into the graph. |
void |
startElement(java.lang.String lName,
java.lang.String namespaceURI,
java.lang.String qName,
org.xml.sax.Attributes attrs)
This method is called whenever the SaX parser encounters an opening tag |
protected edu.uci.ics.jung.graph.Vertex |
startVertex(java.util.Map attributeMap)
Initialize a new vertex and insert it into the graph. |
Methods inherited from class edu.uci.ics.jung.io.GraphMLFileHandler |
---|
createEdge, createVertex |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private edu.uci.ics.jung.graph.Graph mGraph
private edu.uci.ics.jung.graph.decorators.StringLabeller mLabeller
getUserData
method.
edu.uci.ics.jung.graph.Edge currentEdge
edu.uci.ics.jung.graph.Vertex currentVertex
java.lang.String currentKey
java.util.Map<java.lang.String,java.lang.String> keyMap
Constructor Detail |
---|
public GT3DGraphMLFileHandler()
Method Detail |
---|
protected edu.uci.ics.jung.graph.Graph getGraph()
getGraph
in class edu.uci.ics.jung.io.GraphMLFileHandler
protected edu.uci.ics.jung.graph.decorators.StringLabeller getLabeller()
getLabeller
in class edu.uci.ics.jung.io.GraphMLFileHandler
private java.util.Map<java.lang.String,java.lang.String> getAttributeMap(org.xml.sax.Attributes attrs)
protected void createGraph(java.util.Map attributeMap)
createGraph
in class edu.uci.ics.jung.io.GraphMLFileHandler
attributeMap
- the attributes of the graph tag.GraphMLFileHandler.createGraph(java.util.Map)
protected edu.uci.ics.jung.graph.Vertex startVertex(java.util.Map attributeMap)
attributeMap
- the attributes of the node tag.
protected edu.uci.ics.jung.graph.Edge startEdge(java.util.Map attributeMap)
attributeMap
- the attributes of the edge tag.
protected void endVertex()
protected void endEdge()
protected void insertKey(java.util.Map<java.lang.String,java.lang.String> attributeMap)
attributeMap
- The attributes of the key tagprotected void startData(java.util.Map attributeMap)
attributeMap
- The attributes of the tag.protected void endData()
public void startElement(java.lang.String lName, java.lang.String namespaceURI, java.lang.String qName, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class edu.uci.ics.jung.io.GraphMLFileHandler
org.xml.sax.SAXException
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
public void characters(char[] ch, int start, int length)
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
ContentHandler.characters(char[], int, int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |