|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjwo.landserf.structure.msn.GraphJunction
public class GraphJunction
Structure to store a graph junction. Stores a reference to the junction node and any directly connected edges in clockwise order.
| Constructor Summary | |
|---|---|
GraphJunction(GraphNode node,
Vector edges)
Creates a graph junction with the given edges at the given node. |
|
| Method Summary | |
|---|---|
boolean |
addEdge(GraphEdge newEdge)
Adds the given edge to the end of the edge list at the junction. |
boolean |
addEdges(Vector newEdges)
Adds the given list of edges to the the junction. |
GraphNode |
getCentreNode()
Returns the central node at this junction. |
Vector |
getEdges()
Returns a list of edges connected to this junction. |
GraphNode |
getLeftNode(GraphNode node)
Returns the node to the 'left' (clockwise) of the given node, or null if the given node is not found. |
Vector |
getNodes()
Returns a list of nodes connected to the central node. |
GraphNode |
getRightNode(GraphNode node)
Returns the node to the 'right' (anti-clockwise) of the given node, or null if the given node is not found. |
int |
getValency()
Reports the valency of the junction (should be at least 2). |
boolean |
removeEdge(GraphEdge edgeToRemove)
Removes the given edge from the junction. |
String |
toString()
Provides a text summary of the junction. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public GraphJunction(GraphNode node,
Vector edges)
node - Node forming junction.edges - List of edges joining at this node. Edges should be
listed in clockwise order.| Method Detail |
|---|
public boolean addEdges(Vector newEdges)
newEdges - List of new edges to add to junction.
public boolean addEdge(GraphEdge newEdge)
newEdge - New edge to add to junction.
public boolean removeEdge(GraphEdge edgeToRemove)
edgeToRemove - Edge to remove from junction.
public String toString()
toString in class Objectpublic GraphNode getLeftNode(GraphNode node)
node - Node to search from.
public GraphNode getRightNode(GraphNode node)
node - Node to search from.
public GraphNode getCentreNode()
public Vector getNodes()
public Vector getEdges()
public int getValency()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||