org.onebusaway.utility.collections
Class TreeUnionFind<T>

java.lang.Object
  extended by org.onebusaway.utility.collections.TreeUnionFind<T>

public class TreeUnionFind<T>
extends Object

Simple tree-based union find data structure.

Author:
bdferris

Nested Class Summary
static interface TreeUnionFind.Sentry
           
 
Constructor Summary
TreeUnionFind()
           
 
Method Summary
 boolean contains(T target)
           
 TreeUnionFind.Sentry find(T target)
           
 Set<T> getElements()
           
 Iterable<Set<T>> getSetMembers()
           
 Collection<TreeUnionFind.Sentry> getSets()
           
 boolean isEmpty()
           
 boolean isSameSet(T a, T b)
           
 Iterator<T> iterator()
           
 Set<T> members(TreeUnionFind.Sentry sentry)
           
 int size()
           
 TreeUnionFind.Sentry union(T a, T b)
           
 TreeUnionFind.Sentry unionWithSentries(TreeUnionFind.Sentry a, TreeUnionFind.Sentry b)
           
 TreeUnionFind.Sentry unionWithSentry(TreeUnionFind.Sentry sentry, T value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeUnionFind

public TreeUnionFind()
Method Detail

contains

public boolean contains(T target)

find

public TreeUnionFind.Sentry find(T target)

members

public Set<T> members(TreeUnionFind.Sentry sentry)

union

public TreeUnionFind.Sentry union(T a,
                                  T b)

unionWithSentry

public TreeUnionFind.Sentry unionWithSentry(TreeUnionFind.Sentry sentry,
                                            T value)

unionWithSentries

public TreeUnionFind.Sentry unionWithSentries(TreeUnionFind.Sentry a,
                                              TreeUnionFind.Sentry b)

getSets

public Collection<TreeUnionFind.Sentry> getSets()

getSetMembers

public Iterable<Set<T>> getSetMembers()

size

public int size()

isEmpty

public boolean isEmpty()

getElements

public Set<T> getElements()

iterator

public Iterator<T> iterator()

isSameSet

public boolean isSameSet(T a,
                         T b)


Copyright © 2012 OneBusAway. All Rights Reserved.