rails.game.move
Class MapChange<K,V>
java.lang.Object
rails.game.move.Move
rails.game.move.MapChange<K,V>
public class MapChange<K,V>
- extends Move
This Move class handles adding an entry to a Map.
- Author:
- Erik Vos
Constructor Summary |
MapChange(java.util.Map<K,V> map,
K key,
V newValue)
Creates a move that changes a map pair |
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
newValue
protected V newValue
oldValue
protected V oldValue
keyExisted
protected boolean keyExisted
MapChange
public MapChange(java.util.Map<K,V> map,
K key,
V newValue)
- Creates a move that changes a map pair
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