org.glassfish.pfl.basic.graph
Class GraphImpl<T extends Node<T>>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<T>
          extended by 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

Constructor Summary
GraphImpl()
           
GraphImpl(Collection<T> coll)
           
 
Method Summary
 boolean add(T obj)
           
 NodeData getNodeData(T node)
           
 Set<T> getRoots()
           
 Iterator<T> iterator()
           
 int size()
           
 
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
 

Constructor Detail

GraphImpl

public GraphImpl()

GraphImpl

public GraphImpl(Collection<T> coll)
Method Detail

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.