public interface Graph extends Attributable
Modifier and Type | Interface and Description |
---|---|
static class |
Graph.NoEdgeException
This class is thrown by getEdgeLength(node1, node2) if node1 and node2
are not directly connected by an edge.
|
static class |
Graph.Utils |
Modifier and Type | Method and Description |
---|---|
java.util.List<Node> |
getAdjacencies(Node node)
Returns a list of nodes connected to this node by an edge
|
Edge |
getEdge(Node node1,
Node node2)
Returns the Edge that connects these two nodes
|
double |
getEdgeLength(Node node1,
Node node2)
Returns the length of the edge that connects these two nodes
|
java.util.Set<Edge> |
getEdges() |
java.util.List<Edge> |
getEdges(Node node)
Returns a list of edges connected to this node
|
java.util.Set<Node> |
getNodes() |
Node[] |
getNodes(Edge edge)
Returns an array of 2 nodes which are the nodes at either end of the edge.
|
java.util.Set<Node> |
getNodes(int degree) |
getAttribute, getAttributeMap, getAttributeNames, removeAttribute, setAttribute
java.util.List<Edge> getEdges(Node node)
node
- java.util.List<Node> getAdjacencies(Node node)
node
- Edge getEdge(Node node1, Node node2) throws Graph.NoEdgeException
node1
- node2
- Graph.NoEdgeException
- if the nodes are not directly connected by an edge.double getEdgeLength(Node node1, Node node2) throws Graph.NoEdgeException
node1
- node2
- Graph.NoEdgeException
- if the nodes are not directly connected by an edge.Node[] getNodes(Edge edge)
edge
- java.util.Set<Node> getNodes()
java.util.Set<Edge> getEdges()
java.util.Set<Node> getNodes(int degree)
degree
- the number of edges connected to a nodehttp://code.google.com/p/jebl2/