rails.game.move
Class RemoveFromMap<K,V>
java.lang.Object
rails.game.move.Move
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
Constructor Summary |
RemoveFromMap(java.util.Map<K,V> map,
K key)
Creates a move that removes key from map |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
map
protected java.util.Map<K,V> map
key
protected K key
oldValue
protected V oldValue
keyExisted
protected boolean keyExisted
RemoveFromMap
public RemoveFromMap(java.util.Map<K,V> map,
K key)
- Creates a move that removes key from map
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