org.mozdev.MacroTracker.toolkit.DataStructure
Class SuperSet<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by java.util.TreeSet<E>
              extended by org.mozdev.MacroTracker.toolkit.DataStructure.SuperSet<E>
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.Set<E>, java.util.SortedSet<E>

public class SuperSet<E>
extends java.util.TreeSet<E>
implements java.io.Serializable

A TreeSet with a efficient get(int) function.

This is useful if you want to have items in a data structure sorted but at the same time being able to get an object from the middle.

See Also:
Serialized Form

Constructor Summary
SuperSet()
           
 
Method Summary
 boolean add(E o)
           
 E get(int index)
          Returns an item from the SuperSet.
(precondition: 0 =< index =< size())
 boolean remove(java.lang.Object o)
           
 int size()
           
 java.lang.Object[] toArray()
           
 
Methods inherited from class java.util.TreeSet
addAll, clear, clone, comparator, contains, first, headSet, isEmpty, iterator, last, subSet, tailSet
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
containsAll, retainAll, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
containsAll, equals, hashCode, removeAll, retainAll, toArray
 

Constructor Detail

SuperSet

public SuperSet()
Method Detail

add

public boolean add(E o)
Specified by:
add in interface java.util.Collection<E>
Specified by:
add in interface java.util.Set<E>
Overrides:
add in class java.util.TreeSet<E>

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Collection<E>
Specified by:
remove in interface java.util.Set<E>
Overrides:
remove in class java.util.TreeSet<E>

get

public E get(int index)
Returns an item from the SuperSet.
(precondition: 0 =< index =< size())

Parameters:
index - The index item of the number in the set you want to return.

size

public int size()
Specified by:
size in interface java.util.Collection<E>
Specified by:
size in interface java.util.Set<E>
Overrides:
size in class java.util.TreeSet<E>

toArray

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