edu.ksu.cis.projects.trove.custom
Class UnionFindSet<E,A>

java.lang.Object
  extended by edu.ksu.cis.projects.trove.custom.UnionFindSet<E,A>
All Implemented Interfaces:
Iterable<E>, Collection<E>, Set<E>

public abstract class UnionFindSet<E,A>
extends Object
implements Set<E>


Constructor Summary
UnionFindSet()
           
UnionFindSet(Collection<E> c)
           
 
Method Summary
 boolean add(E e)
           
 boolean addAll(Collection<? extends E> c)
           
 boolean addAllTo(Collection<E> c, E orep)
           
 boolean addTo(E o, E orep)
           
 void clear()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
           
 E find(E o)
           
 A getAttribute(E o)
           
 boolean isEmpty()
           
 Iterator<E> iterator()
           
static void main(String[] args)
           
 boolean remove(Object object)
           
 boolean removeAll(Collection<?> c)
           
 boolean retainAll(Collection<?> c)
           
 boolean setAttribute(E o, A attr)
           
 int size()
           
 Object[] toArray()
           
 String toString()
           
 boolean union(E o1, E o2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
equals, hashCode, toArray
 

Constructor Detail

UnionFindSet

public UnionFindSet()

UnionFindSet

public UnionFindSet(Collection<E> c)
Method Detail

getAttribute

public A getAttribute(E o)
Parameters:
o - java.lang.Object
Returns:
java.lang.Object

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<E>
Specified by:
isEmpty in interface Set<E>
Returns:
boolean

add

public boolean add(E e)
Specified by:
add in interface Collection<E>
Specified by:
add in interface Set<E>
Parameters:
o - java.lang.Object
Returns:
boolean

addAll

public boolean addAll(Collection<? extends E> c)
Specified by:
addAll in interface Collection<E>
Specified by:
addAll in interface Set<E>
Parameters:
c - java.util.Collection
Returns:
boolean

addAllTo

public boolean addAllTo(Collection<E> c,
                        E orep)
Parameters:
c - java.util.Collection
orep - java.lang.Object
Returns:
boolean

addTo

public boolean addTo(E o,
                     E orep)
Parameters:
o - java.lang.Object
orep - java.lang.Object
Returns:
boolean

clear

public void clear()
Specified by:
clear in interface Collection<E>
Specified by:
clear in interface Set<E>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<E>
Specified by:
contains in interface Set<E>
Parameters:
o - java.lang.Object
Returns:
boolean

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<E>
Specified by:
containsAll in interface Set<E>
Parameters:
c - java.util.Collection
Returns:
boolean

find

public E find(E o)
Parameters:
o - java.lang.Object
Returns:
java.lang.Object

iterator

public Iterator<E> iterator()
Specified by:
iterator in interface Iterable<E>
Specified by:
iterator in interface Collection<E>
Specified by:
iterator in interface Set<E>
Returns:
java.util.Iterator

main

public static void main(String[] args)
Parameters:
args - java.lang.String[]

setAttribute

public boolean setAttribute(E o,
                            A attr)
Parameters:
o - java.lang.Object
attr - java.lang.Object
Returns:
boolean

remove

public boolean remove(Object object)
Specified by:
remove in interface Collection<E>
Specified by:
remove in interface Set<E>
Parameters:
object - java.lang.Object
Returns:
boolean

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<E>
Specified by:
removeAll in interface Set<E>
Parameters:
c - java.util.Collection
Returns:
boolean

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<E>
Specified by:
retainAll in interface Set<E>
Parameters:
c - java.util.Collection
Returns:
boolean

size

public int size()
Specified by:
size in interface Collection<E>
Specified by:
size in interface Set<E>
Returns:
int

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<E>
Specified by:
toArray in interface Set<E>
Returns:
java.lang.Object[]

toString

public String toString()
Overrides:
toString in class Object
Returns:
java.lang.String

union

public boolean union(E o1,
                     E o2)
Parameters:
o1 - java.lang.Object
o2 - java.lang.Object
Returns:
boolean