edu.ksu.cis.projects.trove.custom
Class UnionFindSet<E,A>
java.lang.Object
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>
UnionFindSet
public UnionFindSet()
UnionFindSet
public UnionFindSet(Collection<E> c)
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.Collectionorep
- java.lang.Object
- Returns:
- boolean
addTo
public boolean addTo(E o,
E orep)
- Parameters:
o
- java.lang.Objectorep
- 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.Objectattr
- 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.Objecto2
- java.lang.Object
- Returns:
- boolean