|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Graph
An interface representing a graph structure, using Node and Edge components.
Supports actions like adding and removing nodes and edges, getting the graph's size and lists of edges and nodes, filtering nodes by name, and testing if a node or edge belong to the graph.
Warning: depending on implementation, a Graph instance may not check if all edges have sources and
destinations inside the graph.
| Method Summary | |
|---|---|
Graph |
add(GraphComponent component)
|
Graph |
addAll(java.util.Collection<? extends GraphComponent> components)
|
Graph |
addEdge(Edge edge)
|
Graph |
addNode(Node node)
|
boolean |
contains(GraphComponent component)
|
java.util.Collection<GraphComponent> |
getComponents()
|
java.util.Collection<Edge> |
getEdges()
|
java.util.Collection<Edge> |
getInEdges(Node node)
Retrieves the edges going into the specified node. |
java.util.Collection<Node> |
getNodes()
|
java.util.Collection<Node> |
getNodesNamed(java.lang.String name)
|
java.util.Collection<Edge> |
getOutEdges(Node node)
Retrieves the edges outgoing from the specified node. |
int |
m()
|
int |
n()
|
Graph |
remove(GraphComponent component)
|
Graph |
removeAll(java.util.Collection<? extends GraphComponent> components)
|
Graph |
removeEdge(Edge edge)
|
Graph |
removeNode(Node node)
|
int |
size()
|
| Method Detail |
|---|
Graph addNode(Node node)
node - - the Node to add.
Graph addEdge(Edge edge)
edge - - the Edge to add.
Graph add(GraphComponent component)
component - - the component to add. Must be an implementation of GraphComponent that the implementing
class can recognize.
Graph addAll(java.util.Collection<? extends GraphComponent> components)
components - - the components to add. Each must be an implementation of GraphComponent that the
implementing class can recognize.
Graph removeNode(Node node)
node - - the Node to remove.
Graph removeEdge(Edge edge)
edge - - the Edge to remove.
Graph remove(GraphComponent component)
component - - the component to remove. Must be an implementation of GraphComponent that the implementing
class can recognize.
Graph removeAll(java.util.Collection<? extends GraphComponent> components)
components - - the components to remove. Each must be an implementation of GraphComponent that the
implementing class can recognize.
int n()
int m()
int size()
java.util.Collection<Node> getNodes()
Node instances in the graph. May be an immutable collection.java.util.Collection<Edge> getEdges()
Edge instances in the graph. May be an immutable collection.java.util.Collection<GraphComponent> getComponents()
GraphComponent instances in the graph. May be an immutable collection.java.util.Collection<Edge> getOutEdges(Node node)
node - - the node.
java.util.Collection<Edge> getInEdges(Node node)
node - - the node.
boolean contains(GraphComponent component)
component - - the component search for. Must be an implementation of GraphComponent that the implementing
class can recognize.
true if the component is contained; false otherwise.java.util.Collection<Node> getNodesNamed(java.lang.String name)
name - - the name to search for.
Collection of Node instances with the required label.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||