rails.game.state
Class HashSetState<E>

java.lang.Object
  extended by rails.game.state.HashSetState<E>

public class HashSetState<E>
extends java.lang.Object

State class that wraps a HashSet Generates according set moves Remark: Does not extend State or implements StateI do avoid additional overhead All state/move mechanisms already contained in Move objects TODO: Replace all stateful sets by this class and simplify according move objects


Constructor Summary
HashSetState(java.lang.String setName)
          constructor for an empty set
HashSetState(java.lang.String setName, java.util.Collection<E> collection)
          constructor for a prefilled set
 
Method Summary
 void add(E element)
           
 void clear()
           
 boolean contains(E element)
           
 boolean remove(E element)
           
 int size()
           
 java.util.Set<E> viewSet()
          returns unmodifiable view of set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HashSetState

public HashSetState(java.lang.String setName)
constructor for an empty set

Parameters:
name -

HashSetState

public HashSetState(java.lang.String setName,
                    java.util.Collection<E> collection)
constructor for a prefilled set

Parameters:
element -
Method Detail

add

public void add(E element)

remove

public boolean remove(E element)

contains

public boolean contains(E element)

clear

public void clear()

viewSet

public java.util.Set<E> viewSet()
returns unmodifiable view of set


size

public int size()