Package org.glassfish.pfl.basic.graph
Class GraphImpl<T extends Node<T>>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractSet<T>
org.glassfish.pfl.basic.graph.GraphImpl<T>
- Type Parameters:
T- The type of a Node in the graph, which must extend Node.
- All Implemented Interfaces:
Iterable<T>,Collection<T>,Set<T>,Graph<T>
Implementation of a simple graph.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interfaceGraphImpl.NodeVisitor<T extends Node> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanprivate voidgetNodeData(T node) getRoots()iterator()private voidintsize()(package private) voidMethods inherited from class java.util.AbstractSet
equals, hashCode, removeAllMethods inherited from class java.util.AbstractCollection
addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Field Details
-
nodeToData
-
-
Constructor Details
-
GraphImpl
public GraphImpl() -
GraphImpl
-
-
Method Details
-
add
-
iterator
-
size
public int size() -
getNodeData
- Specified by:
getNodeDatain interfaceGraph<T extends Node<T>>
-
clearNodeData
private void clearNodeData() -
visitAll
-
markNonRoots
private void markNonRoots() -
collectRootSet
-
getRoots
-