rails.game.move
Class RemoveFromMap<K,V>

java.lang.Object
  extended by rails.game.move.Move
      extended by rails.game.move.RemoveFromMap<K,V>

public class RemoveFromMap<K,V>
extends Move

This Move class handles removable from a stateful map (collection)

Author:
Erik Vos

Field Summary
protected  K key
           
protected  boolean keyExisted
           
protected  java.util.Map<K,V> map
           
protected  V oldValue
           
 
Fields inherited from class rails.game.move.Move
log, models
 
Constructor Summary
RemoveFromMap(java.util.Map<K,V> map, K key)
          Creates a move that removes key from map
 
Method Summary
 boolean execute()
           
 java.lang.String toString()
           
 boolean undo()
           
 
Methods inherited from class rails.game.move.Move
registerModelToUpdate, updateModels
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

map

protected java.util.Map<K,V> map

key

protected K key

oldValue

protected V oldValue

keyExisted

protected boolean keyExisted
Constructor Detail

RemoveFromMap

public RemoveFromMap(java.util.Map<K,V> map,
                     K key)
Creates a move that removes key from map

Method Detail

execute

public boolean execute()
Specified by:
execute in class Move

undo

public boolean undo()
Specified by:
undo in class Move

toString

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