edu.stanford.multiagent.gamer
Class SortedAndRandomSet

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractSet
              |
              +--java.util.TreeSet
                    |
                    +--edu.stanford.multiagent.gamer.SortedAndRandomSet
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.io.Serializable, java.util.Set, java.util.SortedSet

public class SortedAndRandomSet
extends java.util.TreeSet

Utility class holding a list of objects that can be returned either by size (largest or smallest) or randomly from the remaining elements in the list

See Also:
Serialized Form

Constructor Summary
SortedAndRandomSet()
           
 
Method Summary
 java.lang.Object removeLargest()
          Removes the largest element in the list.
 java.lang.Object removeRandom()
          Removes a random element from the list.
 java.lang.Object removeSmallest()
          Removes the smallest element in the list
 
Methods inherited from class java.util.TreeSet
add, addAll, clear, clone, comparator, contains, first, headSet, isEmpty, iterator, last, remove, size, subSet, tailSet
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
containsAll, retainAll, toArray, 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, toArray
 

Constructor Detail

SortedAndRandomSet

public SortedAndRandomSet()
Method Detail

removeSmallest

public java.lang.Object removeSmallest()
Removes the smallest element in the list


removeLargest

public java.lang.Object removeLargest()
Removes the largest element in the list.


removeRandom

public java.lang.Object removeRandom()
Removes a random element from the list.