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 interface
GraphImpl.NodeVisitor<T extends Node>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
private void
getNodeData
(T node) getRoots()
iterator()
private void
int
size()
(package private) void
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
Methods inherited from class java.util.AbstractCollection
addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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:
getNodeData
in interfaceGraph<T extends Node<T>>
-
clearNodeData
private void clearNodeData() -
visitAll
-
markNonRoots
private void markNonRoots() -
collectRootSet
-
getRoots
-