|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.util.Generics
public final class Generics
Utility class with static methods that can be used to conveniently
iterate over a graph's structure using Java 5's enhanced for loop.
E.g.:
This can be achieved by statically importing the utility methods of this class
into your source file.
for (Node node : nodes(graph)) {
for (Edge edge : outEdges(node)) {
System.out.println(edge);
}
}
| Method Summary | |
|---|---|
static Iterable<Edge> |
edges(Graph graph)
Static utility method that can be used in enhanced for loops to conveniently iterate over a graph's Graph.edges(). |
static Iterable<Edge> |
edges(Node node)
Static utility method that can be used in enhanced for loops to conveniently iterate over a node's adjacent Node.edges(). |
static Iterable<Edge> |
inEdges(Node node)
Static utility method that can be used in enhanced for loops to conveniently iterate over a node's adjacent Node.inEdges(). |
static Iterable<Node> |
nodes(Graph graph)
Static utility method that can be used in enhanced for loops to conveniently iterate over a graph's Graph.nodes(). |
static Iterable<Edge> |
outEdges(Node node)
Static utility method that can be used in enhanced for loops to conveniently iterate over a node's adjacent Node.outEdges(). |
static Iterable<Node> |
predecessors(Node node)
Static utility method that can be used in enhanced for loops to conveniently iterate over a node's Node.predecessors(). |
static Iterable<Node> |
successors(Node node)
Static utility method that can be used in enhanced for loops to conveniently iterate over a node's Node.successors(). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Iterable<Node> nodes(Graph graph)
Graph.nodes().
graph - the graph to provide an Iterable for.
Iterable over the graph's Graph.nodes()public static Iterable<Edge> edges(Graph graph)
Graph.edges().
graph - the graph to provide an Iterable for.
Iterable over the graph's Graph.edges()public static Iterable<Edge> inEdges(Node node)
Node.inEdges().
node - the node to provide an Iterable for.
Iterable over the node's adjacent Node.inEdges()public static Iterable<Edge> outEdges(Node node)
Node.outEdges().
node - the node to provide an Iterable for.
Iterable over the node's adjacent Node.outEdges()public static Iterable<Edge> edges(Node node)
Node.edges().
node - the node to provide an Iterable for.
Iterable over the node's adjacent Node.edges()public static Iterable<Node> successors(Node node)
Node.successors().
node - the node to provide an Iterable for.
Iterable over the node's Node.successors()public static Iterable<Node> predecessors(Node node)
Node.predecessors().
node - the node to provide an Iterable for.
Iterable over the node's Node.predecessors()
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||