|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ed.inf.graph.impl.EdgeFactory
public class EdgeFactory
Constructor Summary | |
---|---|
EdgeFactory(Graph graph)
|
Method Summary | |
---|---|
boolean |
canCreateEdge()
Tests is all the conditions have been met in the factory so that edge creation will succeed. |
Edge |
createEdge()
Create a new edge and add it to the graph. |
IBasicPair<Node,Edge> |
getCurrentNodePair()
Returns the current node pair, or false if no nodes have been set. |
IBasicGraph<Node,Edge> |
getGraph()
Get the graph to which this factory acts upon. |
boolean |
isValidNodePair(Node thisNode,
Node thatNode)
Test if the node pair is valid. |
void |
setPair(Node oneNode,
Node twoNode)
Sets a pair of nodes with which to create a new edge. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
EdgeFactory(Graph graph)
Method Detail |
---|
public void setPair(Node oneNode, Node twoNode)
IBasicEdgeFactory
setPair
in interface IBasicEdgeFactory<Node,Edge>
setPair
in interface IUndirectedEdgeFactory<Node,Edge>
oneNode
- a node in the edge pair, cannot be null.twoNode
- another node in the edge pair, cannot be null.public Edge createEdge()
IBasicEdgeFactory
createEdge
in interface IBasicEdgeFactory<Node,Edge>
public IBasicGraph<Node,Edge> getGraph()
IBasicEdgeFactory
getGraph
in interface IBasicEdgeFactory<Node,Edge>
public IBasicPair<Node,Edge> getCurrentNodePair()
IBasicEdgeFactory
getCurrentNodePair
in interface IBasicEdgeFactory<Node,Edge>
setPair(thisNode, thatNode)
has not
been called.public boolean canCreateEdge()
IBasicEdgeFactory
isValidNodePair(thisNode, thatNode)
should be true.
canCreateEdge
in interface IBasicEdgeFactory<Node,Edge>
public boolean isValidNodePair(Node thisNode, Node thatNode)
IBasicEdgeFactory
getGraph()
, do both nodes belong to the same
graph and are both nodes not null.
isValidNodePair
in interface IBasicEdgeFactory<Node,Edge>
thisNode
- a node that may be the end of an edge.thatNode
- another node that may be the end of an edge.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |