|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.Iterable<Node> nodes(Graph graph)
Graph.nodes()
.
graph
- the graph to provide an Iterable
for.
Iterable
over the graph's Graph.nodes()
public static java.lang.Iterable<Edge> edges(Graph graph)
Graph.edges()
.
graph
- the graph to provide an Iterable
for.
Iterable
over the graph's Graph.edges()
public static java.lang.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 java.lang.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 java.lang.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 java.lang.Iterable<Node> successors(Node node)
Node.successors()
.
node
- the node to provide an Iterable
for.
Iterable
over the node's Node.successors()
public static java.lang.Iterable<Node> predecessors(Node node)
Node.predecessors()
.
node
- the node to provide an Iterable
for.
Iterable
over the node's Node.predecessors()
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |