|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ed.inf.graph.compound.base.BaseCompoundGraph
public abstract class BaseCompoundGraph
Constructor Summary | |
---|---|
protected |
BaseCompoundGraph(BaseGraphCopyBuilder copyBuilder)
|
protected |
BaseCompoundGraph(BaseGraphCopyBuilder copyBuilder,
BaseCompoundGraph otherGraph)
|
Method Summary | |
---|---|
boolean |
canCopyHere(ISubCompoundGraph<? extends BaseCompoundNode,? extends BaseCompoundEdge> subGraph)
Removes the nodes and edges defined in the subgraph from this graph. |
boolean |
canRemoveSubgraph(ISubCompoundGraph<? extends BaseCompoundNode,? extends BaseCompoundEdge> subgraph)
Tests if subgraph removal will succeed. |
boolean |
containsConnection(BaseCompoundNode thisNode,
BaseCompoundNode thatNode)
Tests if the graph contains an edge connecting these nodes. |
boolean |
containsConnection(IBasicPair<? extends BaseCompoundNode,? extends BaseCompoundEdge> ends)
Tests if the ends define any edge in this graph. |
boolean |
containsDirectedEdge(BaseCompoundNode outNode,
BaseCompoundNode inNode)
Tests if there is one or more directed edges from the outNode to the inNode . |
boolean |
containsDirectedEdge(IDirectedPair<? extends BaseCompoundNode,? extends BaseCompoundEdge> ends)
Tests if the ends define one or more directed edges. |
boolean |
containsEdge(BaseCompoundEdge edge)
Tests if the graph contains the edge. |
boolean |
containsEdge(int edgeIdx)
Tests if the graph contains the edge of the given index. |
boolean |
containsNode(BaseCompoundNode node)
Tests if this node exists in the graph. |
boolean |
containsNode(int nodeIdx)
Tests if the graph contains the node with the given index number. |
void |
copyHere(ISubCompoundGraph<? extends BaseCompoundNode,? extends BaseCompoundEdge> subGraph)
Copies a subgraph into this graph. |
protected abstract void |
createCopyOfRootNode(int newIndexValue,
BaseCompoundNode otherRootNode)
|
abstract BaseCompoundEdgeFactory |
edgeFactory()
Gets an edge factory that works out the LCA of two nodes making up the edge and assigns it to the appropriate compound graph. |
java.util.Iterator<BaseCompoundEdge> |
edgeIterator()
Returns all edges in tree level-node iteration order. |
ISubCompoundGraph<BaseCompoundNode,BaseCompoundEdge> |
getCopiedComponents()
Retrieves the nodes and edges created in this graph by the last copy operation. |
IGraphState<BaseCompoundNode,BaseCompoundEdge> |
getCurrentState()
Get the current state of the graph as a momento. |
BaseCompoundEdge |
getEdge(int edgeIdx)
Get the edge with this index. |
protected abstract IndexCounter |
getEdgeCounter()
|
(package private) BaseCompoundNode |
getLcaNode(BaseCompoundNode inNode,
BaseCompoundNode outNode)
|
BaseCompoundNode |
getNode(int nodeIdx)
Get the node matching the nodeIdx. |
protected abstract IndexCounter |
getNodeCounter()
|
protected abstract ITree<BaseCompoundNode> |
getNodeTree()
|
int |
getNumEdges()
Get the number of edges in the graph. |
int |
getNumNodes()
Get the number of nodes in the graph. |
abstract BaseCompoundNode |
getRootNode()
Get the root node of this graph. |
protected abstract boolean |
hasPassedAdditionalValidation()
A hook method that should be used to provide addition validation for the class inheriting from this one. |
boolean |
isValid()
|
abstract BaseCompoundNodeFactory |
nodeFactory()
Gets the node factory to add new nodes to the root child graph of this compound graph. |
java.util.Iterator<BaseCompoundNode> |
nodeIterator()
Get an iterator that traverses all the nodes in this graph. |
protected void |
performCopy(BaseCompoundGraph otherGraph)
To be used by copy constructor. |
void |
removeSubgraph(ISubCompoundGraph<? extends BaseCompoundNode,? extends BaseCompoundEdge> subgraph)
|
void |
restoreState(IGraphState<BaseCompoundNode,BaseCompoundEdge> previousState)
Restores the graph state to the state stored by the previousState
object. |
abstract BaseSubCompoundGraphFactory |
subgraphFactory()
Gets a subgraph factory used to create a subgraph of this graph. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected BaseCompoundGraph(BaseGraphCopyBuilder copyBuilder)
protected BaseCompoundGraph(BaseGraphCopyBuilder copyBuilder, BaseCompoundGraph otherGraph)
Method Detail |
---|
protected abstract IndexCounter getNodeCounter()
protected abstract IndexCounter getEdgeCounter()
protected abstract void createCopyOfRootNode(int newIndexValue, BaseCompoundNode otherRootNode)
protected abstract ITree<BaseCompoundNode> getNodeTree()
protected void performCopy(BaseCompoundGraph otherGraph)
perfromCopy()
to actually copy the graph;
copyBuilder
- otherGraph
- public abstract BaseCompoundNode getRootNode()
ICompoundGraph
getRootNode
in interface ICompoundGraph<BaseCompoundNode,BaseCompoundEdge>
public final boolean containsDirectedEdge(BaseCompoundNode outNode, BaseCompoundNode inNode)
IDirectedGraph
outNode
to the inNode
.
containsDirectedEdge
in interface IDirectedGraph<BaseCompoundNode,BaseCompoundEdge>
outNode
- the node the edge comes out from, can be null.inNode
- the node the edge goes into, can be null.
public final boolean containsConnection(BaseCompoundNode thisNode, BaseCompoundNode thatNode)
IBasicGraph
containsConnection
in interface IBasicGraph<BaseCompoundNode,BaseCompoundEdge>
thisNode
- a node to test.thatNode
- the other node to test.
public final boolean containsEdge(BaseCompoundEdge edge)
IBasicGraph
containsEdge
in interface IBasicGraph<BaseCompoundNode,BaseCompoundEdge>
edge
- the edge to test.
public final boolean containsEdge(int edgeIdx)
IBasicGraph
containsEdge
in interface IBasicGraph<BaseCompoundNode,BaseCompoundEdge>
edgeIdx
- the index to test.
public final boolean containsNode(int nodeIdx)
IBasicGraph
containsNode
in interface IBasicGraph<BaseCompoundNode,BaseCompoundEdge>
nodeIdx
- The index number of the node.
public final boolean containsNode(BaseCompoundNode node)
IBasicGraph
containsNode
in interface IBasicGraph<BaseCompoundNode,BaseCompoundEdge>
node
- to be tested.
public BaseCompoundEdge getEdge(int edgeIdx)
IBasicGraph
getEdge
in interface IBasicGraph<BaseCompoundNode,BaseCompoundEdge>
edgeIdx
- The index of the edge.
public java.util.Iterator<BaseCompoundEdge> edgeIterator()
edgeIterator
in interface IBasicGraph<BaseCompoundNode,BaseCompoundEdge>
public BaseCompoundNode getNode(int nodeIdx)
IBasicGraph
getNode
in interface IBasicGraph<BaseCompoundNode,BaseCompoundEdge>
nodeIdx
- the node index to lookup.
public java.util.Iterator<BaseCompoundNode> nodeIterator()
IBasicGraph
nodeIterator
in interface IBasicGraph<BaseCompoundNode,BaseCompoundEdge>
public final int getNumEdges()
IBasicGraph
getNumEdges
in interface IBasicGraph<BaseCompoundNode,BaseCompoundEdge>
public final int getNumNodes()
IBasicGraph
getNumNodes
in interface IBasicGraph<BaseCompoundNode,BaseCompoundEdge>
public boolean canRemoveSubgraph(ISubCompoundGraph<? extends BaseCompoundNode,? extends BaseCompoundEdge> subgraph)
IModifiableCompoundGraph
canRemoveSubgraph
in interface IModifiableCompoundGraph<BaseCompoundNode,BaseCompoundEdge>
subgraph
- the subgraph to be removed, which can be null.
public final void removeSubgraph(ISubCompoundGraph<? extends BaseCompoundNode,? extends BaseCompoundEdge> subgraph)
final BaseCompoundNode getLcaNode(BaseCompoundNode inNode, BaseCompoundNode outNode)
public final boolean containsDirectedEdge(IDirectedPair<? extends BaseCompoundNode,? extends BaseCompoundEdge> ends)
containsDirectedEdge
in interface IDirectedGraph<BaseCompoundNode,BaseCompoundEdge>
ends
- the pair of nodes to be tested, can be null.
public final boolean containsConnection(IBasicPair<? extends BaseCompoundNode,? extends BaseCompoundEdge> ends)
ends
to be of type
IDirectedPair
and will return false if it is not.
containsConnection
in interface IBasicGraph<BaseCompoundNode,BaseCompoundEdge>
ends
- the pair of nodes that may define the edges of an edge.
public IGraphState<BaseCompoundNode,BaseCompoundEdge> getCurrentState()
IRestorableGraph
getCurrentState
in interface IRestorableGraph<BaseCompoundNode,BaseCompoundEdge>
public final void restoreState(IGraphState<BaseCompoundNode,BaseCompoundEdge> previousState)
IRestorableGraph
previousState
object.
restoreState
in interface IRestorableGraph<BaseCompoundNode,BaseCompoundEdge>
previousState
- The previous state to be restored.public final boolean canCopyHere(ISubCompoundGraph<? extends BaseCompoundNode,? extends BaseCompoundEdge> subGraph)
IModifiableCompoundGraph
canCopyHere
in interface IModifiableCompoundGraph<BaseCompoundNode,BaseCompoundEdge>
subGraph
- The subgraph to remove, cannot be null.
public final void copyHere(ISubCompoundGraph<? extends BaseCompoundNode,? extends BaseCompoundEdge> subGraph)
IModifiableCompoundGraph
copyHere
in interface IModifiableCompoundGraph<BaseCompoundNode,BaseCompoundEdge>
public final ISubCompoundGraph<BaseCompoundNode,BaseCompoundEdge> getCopiedComponents()
IModifiableCompoundGraph
getCopiedComponents
in interface IModifiableCompoundGraph<BaseCompoundNode,BaseCompoundEdge>
public abstract BaseCompoundNodeFactory nodeFactory()
IModifiableCompoundGraph
nodeFactory
in interface IModifiableCompoundGraph<BaseCompoundNode,BaseCompoundEdge>
public abstract BaseCompoundEdgeFactory edgeFactory()
IModifiableCompoundGraph
edgeFactory
in interface IModifiableCompoundGraph<BaseCompoundNode,BaseCompoundEdge>
public abstract BaseSubCompoundGraphFactory subgraphFactory()
IModifiableCompoundGraph
subgraphFactory
in interface IModifiableCompoundGraph<BaseCompoundNode,BaseCompoundEdge>
protected abstract boolean hasPassedAdditionalValidation()
public boolean isValid()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |