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:
- Iterable<T>, Collection<T>, Set<T>, Graph<T>
public class GraphImpl<T extends Node<T>>
- extends AbstractSet<T>
- implements Graph<T>
Implementation of a simple graph.
- Author:
- ken
| 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(Collection<T> coll)
add
public boolean add(T obj)
- Specified by:
add in interface Collection<T extends Node<T>>- Specified by:
add in interface Set<T extends Node<T>>- Overrides:
add in class AbstractCollection<T extends Node<T>>
iterator
public Iterator<T> iterator()
- Specified by:
iterator in interface Iterable<T extends Node<T>>- Specified by:
iterator in interface Collection<T extends Node<T>>- Specified by:
iterator in interface Set<T extends Node<T>>- Specified by:
iterator in class AbstractCollection<T extends Node<T>>
size
public int size()
- Specified by:
size in interface Collection<T extends Node<T>>- Specified by:
size in interface Set<T extends Node<T>>- Specified by:
size in class AbstractCollection<T extends Node<T>>
getNodeData
public NodeData getNodeData(T node)
- Specified by:
getNodeData in interface Graph<T extends Node<T>>
getRoots
public Set<T> getRoots()
- Specified by:
getRoots in interface Graph<T extends Node<T>>
Copyright © 2013 Oracle. All Rights Reserved.