org.glassfish.pfl.basic.graph
Class GraphImpl<T extends Node<T>>
java.lang.Object
java.util.AbstractCollection<E>
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:
- java.lang.Iterable<T>, java.util.Collection<T>, java.util.Set<T>, Graph<T>
public class GraphImpl<T extends Node<T>>
- extends java.util.AbstractSet<T>
- implements Graph<T>
Implementation of a simple graph.
- Author:
- ken
| 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.Set |
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArray |
GraphImpl
public GraphImpl()
GraphImpl
public GraphImpl(java.util.Collection<T> coll)
add
public boolean add(T obj)
- Specified by:
add in interface java.util.Collection<T extends Node<T>>- Specified by:
add in interface java.util.Set<T extends Node<T>>- Overrides:
add in class java.util.AbstractCollection<T extends Node<T>>
iterator
public java.util.Iterator<T> iterator()
- Specified by:
iterator in interface java.lang.Iterable<T extends Node<T>>- Specified by:
iterator in interface java.util.Collection<T extends Node<T>>- Specified by:
iterator in interface java.util.Set<T extends Node<T>>- Specified by:
iterator in class java.util.AbstractCollection<T extends Node<T>>
size
public int size()
- Specified by:
size in interface java.util.Collection<T extends Node<T>>- Specified by:
size in interface java.util.Set<T extends Node<T>>- Specified by:
size in class java.util.AbstractCollection<T extends Node<T>>
getNodeData
public NodeData getNodeData(T node)
- Specified by:
getNodeData in interface Graph<T extends Node<T>>
getRoots
public java.util.Set<T> getRoots()
- Specified by:
getRoots in interface Graph<T extends Node<T>>