Package diva.graph.modular
Class BasicModularGraphModel
- java.lang.Object
-
- diva.graph.AbstractGraphModel
-
- diva.graph.modular.ModularGraphModel
-
- diva.graph.modular.MutableModularGraphModel
-
- diva.graph.modular.BasicModularGraphModel
-
- All Implemented Interfaces:
GraphModel
,MutableGraphModel
- Direct Known Subclasses:
BasicGraphModel
public class BasicModularGraphModel extends MutableModularGraphModel
A modular implementation of the graph model, whereby users with heterogeneous graphs can implement the graph model interface by implementing the simple interfaces of Graph, Node, CompositeNode, and Edge.- Version:
- $Id$
- Author:
- Michael Shilman
- Pt.AcceptedRating:
- Red
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BasicModularGraphModel.BasicEdgeModel
static class
BasicModularGraphModel.BasicNodeModel
-
Field Summary
-
Fields inherited from class diva.graph.AbstractGraphModel
_graphListeners
-
-
Constructor Summary
Constructors Constructor Description BasicModularGraphModel(Graph root)
Construct an empty graph model whose root is the given semantic object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompositeModel
getCompositeModel(java.lang.Object composite)
Return the model for the given composite object.EdgeModel
getEdgeModel(java.lang.Object edge)
Return the model for the given edge object.NodeModel
getNodeModel(java.lang.Object node)
Return the node model for the given object.java.lang.Object
getProperty(java.lang.Object o, java.lang.String propertyName)
Return the property of the object associated with the given property name.java.lang.Object
getSemanticObject(java.lang.Object o)
Return the semantic object corresponding to the given node, edge, or composite.void
setProperty(java.lang.Object o, java.lang.String propertyName, java.lang.Object value)
Set the property of the object associated with the given property name.void
setSemanticObject(java.lang.Object o, java.lang.Object sem)
Set the semantic object corresponding to the given node, edge, or composite.-
Methods inherited from class diva.graph.modular.MutableModularGraphModel
acceptHead, acceptTail, addNode, connectEdge, disconnectEdge, getMutableEdgeModel, getMutableNodeModel, removeNode, setEdgeHead, setEdgeTail
-
Methods inherited from class diva.graph.modular.ModularGraphModel
containsNode, getHead, getNodeCount, getParent, getRoot, getTail, inEdges, isComposite, isDirected, isEdge, isNode, nodes, nodesAfterEdges, nodesBeforeEdges, outEdges
-
Methods inherited from class diva.graph.AbstractGraphModel
addGraphListener, dispatchGraphEvent, removeGraphListener, setDispatchEnabled
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface diva.graph.GraphModel
addGraphListener, containsNode, dispatchGraphEvent, getHead, getNodeCount, getParent, getRoot, getTail, inEdges, isComposite, isDirected, isEdge, isNode, nodes, nodesAfterEdges, nodesBeforeEdges, outEdges, removeGraphListener, setDispatchEnabled
-
-
-
-
Constructor Detail
-
BasicModularGraphModel
public BasicModularGraphModel(Graph root)
Construct an empty graph model whose root is the given semantic object.
-
-
Method Detail
-
getCompositeModel
public CompositeModel getCompositeModel(java.lang.Object composite)
Return the model for the given composite object. If the object is not a composite, meaning that it does not contain other nodes, then return null.- Specified by:
getCompositeModel
in classModularGraphModel
-
getEdgeModel
public EdgeModel getEdgeModel(java.lang.Object edge)
Return the model for the given edge object. If the object is not an edge, then return null.- Specified by:
getEdgeModel
in classModularGraphModel
-
getNodeModel
public NodeModel getNodeModel(java.lang.Object node)
Return the node model for the given object. If the object is not a node, then return null.- Specified by:
getNodeModel
in classModularGraphModel
-
getProperty
public java.lang.Object getProperty(java.lang.Object o, java.lang.String propertyName)
Return the property of the object associated with the given property name.- Specified by:
getProperty
in interfaceGraphModel
- Specified by:
getProperty
in classModularGraphModel
-
getSemanticObject
public java.lang.Object getSemanticObject(java.lang.Object o)
Return the semantic object corresponding to the given node, edge, or composite.- Specified by:
getSemanticObject
in interfaceGraphModel
- Specified by:
getSemanticObject
in classModularGraphModel
-
setProperty
public void setProperty(java.lang.Object o, java.lang.String propertyName, java.lang.Object value)
Set the property of the object associated with the given property name.- Specified by:
setProperty
in interfaceGraphModel
- Specified by:
setProperty
in classModularGraphModel
-
setSemanticObject
public void setSemanticObject(java.lang.Object o, java.lang.Object sem)
Set the semantic object corresponding to the given node, edge, or composite.- Specified by:
setSemanticObject
in interfaceGraphModel
- Specified by:
setSemanticObject
in classModularGraphModel
-
-