|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectBasicGraphable
BasicEdge
public class BasicEdge
Basic implementation of Edge.
| Field Summary |
|---|
| Fields inherited from interface Edge |
|---|
EQUAL_NODE_ORIENTATION, OPPOSITE_NODE_ORIENTATION, UNEQUAL_NODE_ORIENTATION |
| Constructor Summary | |
|---|---|
BasicEdge(Node nodeA,
Node nodeB)
Constructs a new edge. |
|
| Method Summary | |
|---|---|
int |
compareNodes(Edge other)
Compares the node orientation of the edge with another edge. |
Node |
getNodeA()
Returns the A node of the edge. |
Node |
getNodeB()
Returns the B node of the edge. |
Node |
getOtherNode(Node node)
Returns null if the specified node is neither the A node or the B node. |
Iterator |
getRelated()
Returns all edges that are adjacent to both the A and B nodes. |
void |
reverse()
Reverses the node orientation of the edge. |
String |
toString()
Returns ([A node.toString()],[B node.toString()]). |
| Methods inherited from class BasicGraphable |
|---|
getCount, getID, getObject, isVisited, setCount, setID, setObject, setVisited |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface Graphable |
|---|
getCount, getID, getObject, isVisited, setCount, setID, setObject, setVisited |
| Constructor Detail |
|---|
public BasicEdge(Node nodeA,
Node nodeB)
nodeA - A node of edge.nodeB - B node of edge.| Method Detail |
|---|
public Node getNodeA()
Edge
getNodeA in interface EdgeEdge.getNodeA()public Node getNodeB()
Edge
getNodeB in interface EdgeEdge.getNodeB()public Node getOtherNode(Node node)
getOtherNode in interface Edgenode - The node opposite of the node to return.
Edge.getOtherNode(Node)public Iterator getRelated()
getRelated in interface GraphableGraphable.getRelated()public void reverse()
Edge
reverse in interface EdgeEdge.reverse()public int compareNodes(Edge other)
Edge
compareNodes in interface EdgeEdge.compareNodes(Edge)public String toString()
toString in class BasicGraphableGraphable.getID()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||