Package diva.graph.modular
Class ModularGraphModel
- java.lang.Object
- 
- diva.graph.AbstractGraphModel
- 
- diva.graph.modular.ModularGraphModel
 
 
- 
- All Implemented Interfaces:
- GraphModel
 - Direct Known Subclasses:
- AbstractBasicGraphModel,- MutableModularGraphModel
 
 public abstract class ModularGraphModel extends AbstractGraphModel 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
 
- 
- 
Field Summary- 
Fields inherited from class diva.graph.AbstractGraphModel_graphListeners
 
- 
 - 
Constructor SummaryConstructors Constructor Description ModularGraphModel(java.lang.Object root)Construct an empty graph model whose root is the given semantic object.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancontainsNode(java.lang.Object composite, java.lang.Object node)Return true if this composite node contains the given node.abstract CompositeModelgetCompositeModel(java.lang.Object composite)Return the model for the given composite object.abstract EdgeModelgetEdgeModel(java.lang.Object edge)Return the model for the given edge object.java.lang.ObjectgetHead(java.lang.Object edge)Return the head node of the given edge.intgetNodeCount(java.lang.Object composite)Return the number of nodes contained in this graph or composite node.abstract NodeModelgetNodeModel(java.lang.Object node)Return the node model for the given object.java.lang.ObjectgetParent(java.lang.Object node)Return the parent graph of this node, return null if there is no parent.abstract java.lang.ObjectgetProperty(java.lang.Object o, java.lang.String propertyName)Return the property of the object associated with the given property name.java.lang.ObjectgetRoot()Return the root graph of this graph model.abstract java.lang.ObjectgetSemanticObject(java.lang.Object o)Return the semantic object corresponding to the given node, edge, or composite.java.lang.ObjectgetTail(java.lang.Object edge)Return the tail node of this edge.java.util.IteratorinEdges(java.lang.Object node)Return an iterator over the in edges of this node.booleanisComposite(java.lang.Object o)Return true if the given object is a composite node in this model, i.e.booleanisDirected(java.lang.Object edge)Return whether or not this edge is directed.booleanisEdge(java.lang.Object o)Return true if the given object is a node in this model.booleanisNode(java.lang.Object o)Return true if the given object is a node in this model.java.util.Iteratornodes(java.lang.Object composite)Provide an iterator over the nodes in the given graph or composite node.java.util.IteratornodesAfterEdges(java.lang.Object composite)Provide an iterator over the nodes that should be rendered after to the edges.java.util.IteratornodesBeforeEdges(java.lang.Object composite)Provide an iterator over the nodes that should be rendered prior to the edges.java.util.IteratoroutEdges(java.lang.Object node)Return an iterator over the out edges of this node.abstract voidsetProperty(java.lang.Object o, java.lang.String propertyName, java.lang.Object value)Set the property of the object associated with the given property name.abstract voidsetSemanticObject(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.AbstractGraphModeladdGraphListener, dispatchGraphEvent, removeGraphListener, setDispatchEnabled
 
- 
 
- 
- 
- 
Method Detail- 
containsNodepublic boolean containsNode(java.lang.Object composite, java.lang.Object node)Return true if this composite node contains the given node.
 - 
getCompositeModelpublic abstract 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.
 - 
getEdgeModelpublic abstract EdgeModel getEdgeModel(java.lang.Object edge) Return the model for the given edge object. If the object is not an edge, then return null.
 - 
getHeadpublic java.lang.Object getHead(java.lang.Object edge) Return the head node of the given edge.
 - 
getNodeCountpublic int getNodeCount(java.lang.Object composite) Return the number of nodes contained in this graph or composite node.
 - 
getNodeModelpublic abstract NodeModel getNodeModel(java.lang.Object node) Return the node model for the given object. If the object is not a node, then return null.
 - 
getParentpublic java.lang.Object getParent(java.lang.Object node) Return the parent graph of this node, return null if there is no parent.
 - 
getPropertypublic abstract java.lang.Object getProperty(java.lang.Object o, java.lang.String propertyName)Return the property of the object associated with the given property name.
 - 
getRootpublic java.lang.Object getRoot() Return the root graph of this graph model.
 - 
getSemanticObjectpublic abstract java.lang.Object getSemanticObject(java.lang.Object o) Return the semantic object corresponding to the given node, edge, or composite.
 - 
getTailpublic java.lang.Object getTail(java.lang.Object edge) Return the tail node of this edge.
 - 
isDirectedpublic boolean isDirected(java.lang.Object edge) Return whether or not this edge is directed.
 - 
isCompositepublic boolean isComposite(java.lang.Object o) Return true if the given object is a composite node in this model, i.e. it contains children.
 - 
isEdgepublic boolean isEdge(java.lang.Object o) Return true if the given object is a node in this model.
 - 
isNodepublic boolean isNode(java.lang.Object o) Return true if the given object is a node in this model.
 - 
nodespublic java.util.Iterator nodes(java.lang.Object composite) Provide an iterator over the nodes in the given graph or composite node. This iterator does not necessarily support removal operations.
 - 
nodesBeforeEdgespublic java.util.Iterator nodesBeforeEdges(java.lang.Object composite) Provide an iterator over the nodes that should be rendered prior to the edges. This iterator does not necessarily support removal operations. In this base class, this returns the same iterator as the nodes(Object) method.
 - 
nodesAfterEdgespublic java.util.Iterator nodesAfterEdges(java.lang.Object composite) Provide an iterator over the nodes that should be rendered after to the edges. This iterator does not necessarily support removal operations. In this base class, this returns an iterator over nothing.
 - 
inEdgespublic java.util.Iterator inEdges(java.lang.Object node) Return an iterator over the in edges of this node. This iterator does not support removal operations. If there are no in-edges, an iterator with no elements is returned.
 - 
outEdgespublic java.util.Iterator outEdges(java.lang.Object node) Return an iterator over the out edges of this node. This iterator does not support removal operations. If there are no out-edges, an iterator with no elements is returned.
 - 
setPropertypublic abstract 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.
 - 
setSemanticObjectpublic abstract void setSemanticObject(java.lang.Object o, java.lang.Object sem)Set the semantic object corresponding to the given node, edge, or composite.
 
- 
 
-