de.cesr.more.util.io
Class MGraphMLReader2NodeMap<G extends Hypergraph<V,E>,V,E>

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by edu.uci.ics.jung.io.GraphMLReader<G,V,E>
          extended by de.cesr.more.util.io.MGraphMLReader2NodeMap<G,V,E>
Type Parameters:
G - Graph Type
V - Vertex Type
E - Edge Type
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class MGraphMLReader2NodeMap<G extends Hypergraph<V,E>,V,E>
extends GraphMLReader<G,V,E>

MORe Enables assigning the graph data to an existing set of vertices.

Date:
06.10.2010

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.uci.ics.jung.io.GraphMLReader
GraphMLReader.KeyType, GraphMLReader.TagState
 
Field Summary
protected  MoreEdgeFactory<V,E> edgeFactory
          An MoreEdgeFactory that is used to create edge objects
protected  org.apache.commons.collections15.BidiMap<V,String> nodeMap
          BidiMap that contains node ids (key) and node object (value)
 
Fields inherited from class edu.uci.ics.jung.io.GraphMLReader
current_edge, current_graph, current_key, current_states, current_text, current_vertex, default_edgetype, edge_desc, edge_factory, edge_ids, edge_metadata, graph_desc, graph_factory, graph_metadata, graphs, hyperedge_vertices, key_type, saxp, tag_state, vertex_desc, vertex_factory, vertex_ids, vertex_metadata
 
Constructor Summary
MGraphMLReader2NodeMap(org.apache.commons.collections15.Factory<V> vertex_factory, MoreEdgeFactory<V,E> edge_factory, org.apache.commons.collections15.BidiMap<V,String> nodeMap)
           
MGraphMLReader2NodeMap(MoreEdgeFactory<V,E> edge_factory, org.apache.commons.collections15.BidiMap<V,String> nodeMap)
          Passes a pseudo edge factory that throws an IllegalStateException every time the factory is called (indicating that the nodeMap does not contain entries for every node).
 
Method Summary
protected  void clearData()
          Passes contents of this#nodeMap to super#vertex_ids.
protected  void createEdge(Attributes atts, GraphMLReader.TagState state)
          Fetches information about source, target and direction from attributes to enable initialisation of an extended edge object.
protected  void createVertex(Attributes atts)
          Adapted to this application when vertex_ids is provided beforehand.
 
Methods inherited from class edu.uci.ics.jung.io.GraphMLReader
addDatum, addExtraData, assignEdgeSourceTarget, characters, createKey, endElement, getAttributeMap, getEdgeDescriptions, getEdgeIDs, getEdgeMetadata, getGraphDescriptions, getGraphMetadata, getVertexDescriptions, getVertexIDs, getVertexMetadata, handleData, initializeData, load, load, loadMultiple, loadMultiple, parse, startElement
 
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

nodeMap

protected org.apache.commons.collections15.BidiMap<V,String> nodeMap
BidiMap that contains node ids (key) and node object (value)


edgeFactory

protected MoreEdgeFactory<V,E> edgeFactory
An MoreEdgeFactory that is used to create edge objects

Constructor Detail

MGraphMLReader2NodeMap

public MGraphMLReader2NodeMap(org.apache.commons.collections15.Factory<V> vertex_factory,
                              MoreEdgeFactory<V,E> edge_factory,
                              org.apache.commons.collections15.BidiMap<V,String> nodeMap)
                       throws ParserConfigurationException,
                              SAXException
Parameters:
vertex_factory -
edge_factory -
nodeMap - BidiMap that contains node ids (key) and node object (value)
Throws:
ParserConfigurationException
SAXException

MGraphMLReader2NodeMap

public MGraphMLReader2NodeMap(MoreEdgeFactory<V,E> edge_factory,
                              org.apache.commons.collections15.BidiMap<V,String> nodeMap)
                       throws ParserConfigurationException,
                              SAXException
Passes a pseudo edge factory that throws an IllegalStateException every time the factory is called (indicating that the nodeMap does not contain entries for every node).

Parameters:
edge_factory -
nodeMap - BidiMap that contains node ids (key) and node object (value)
Throws:
ParserConfigurationException
SAXException
Method Detail

clearData

protected void clearData()
Passes contents of this#nodeMap to super#vertex_ids. superclearData() is called after superGraphMLReader.initializeData()...

Overrides:
clearData in class GraphMLReader<G extends Hypergraph<V,E>,V,E>
See Also:
GraphMLReader.clearData()

createEdge

protected void createEdge(Attributes atts,
                          GraphMLReader.TagState state)
                   throws SAXNotSupportedException
Fetches information about source, target and direction from attributes to enable initialisation of an extended edge object.

Overrides:
createEdge in class GraphMLReader<G extends Hypergraph<V,E>,V,E>
Throws:
SAXNotSupportedException
See Also:
GraphMLReader.createEdge(org.xml.sax.Attributes, edu.uci.ics.jung.io.GraphMLReader.TagState)

createVertex

protected void createVertex(Attributes atts)
                     throws SAXNotSupportedException
Adapted to this application when vertex_ids is provided beforehand.

Overrides:
createVertex in class GraphMLReader<G extends Hypergraph<V,E>,V,E>
Throws:
SAXNotSupportedException
See Also:
GraphMLReader.createVertex(org.xml.sax.Attributes)