Class TreeUnionFind<T>
- java.lang.Object
-
- org.onebusaway.utility.collections.TreeUnionFind<T>
-
public class TreeUnionFind<T> extends Object
Simple tree-based union find data structure.- Author:
- bdferris
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceTreeUnionFind.Sentry
-
Constructor Summary
Constructors Constructor Description TreeUnionFind()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(T target)TreeUnionFind.Sentryfind(T target)Set<T>getElements()Iterable<Set<T>>getSetMembers()Collection<TreeUnionFind.Sentry>getSets()booleanisEmpty()booleanisSameSet(T a, T b)Iterator<T>iterator()Set<T>members(TreeUnionFind.Sentry sentry)intsize()TreeUnionFind.Sentryunion(T a, T b)TreeUnionFind.SentryunionWithSentries(TreeUnionFind.Sentry a, TreeUnionFind.Sentry b)TreeUnionFind.SentryunionWithSentry(TreeUnionFind.Sentry sentry, T value)
-
-
-
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()
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
-