org.vizzini.game.boardgame.action
Class RemoveAction

java.lang.Object
  extended by org.vizzini.game.action.AbstractAction
      extended by org.vizzini.game.boardgame.action.AbstractGridBoardAction
          extended by org.vizzini.game.boardgame.action.RemoveAction
All Implemented Interfaces:
Serializable, Comparable, IAction, IGridBoardAction

public class RemoveAction
extends AbstractGridBoardAction

Provides an action for removal of a token from a grid board.

Since:
v0.2
Version:
v0.3
Author:
Jeffrey M. Thompson
See Also:
Serialized Form

Constructor Summary
protected RemoveAction(IGridBoard gridBoard, IAgent agent, IntegerPosition position)
          Construct this object.
 
Method Summary
 void clear()
          Clear the properties of this object.
 boolean doIt()
          Perform the command encapsulated by this object.
 boolean equals(Object object)
          Return true if the given object is equal to this.
static RemoveAction get(IGridBoard gridBoard, IAgent agent, IntegerPosition position)
          Return an instance of this class using the given parameters.
 int hashCode()
          Returns a hash code value for the object.
static void poolReport()
          Log a statistics report.
 void release()
          Return this instance to the reusable object pool.
protected  void set(IGridBoard gridBoard, IAgent agent, IntegerPosition position)
          Set parameters on this object.
 String toString()
          Return a string representation of this object.
 boolean undoIt()
          Undo the last invocation of doIt.
 
Methods inherited from class org.vizzini.game.boardgame.action.AbstractGridBoardAction
getGridBoard, getToPosition, prettyPrint, setGridBoard, setToPosition
 
Methods inherited from class org.vizzini.game.action.AbstractAction
compareTo, getAgent, getRating, setAgent, setRating
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.vizzini.game.action.IAction
getAgent, getRating, setAgent, setRating
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

RemoveAction

protected RemoveAction(IGridBoard gridBoard,
                       IAgent agent,
                       IntegerPosition position)
Construct this object.

Since:
v0.2
Method Detail

get

public static RemoveAction get(IGridBoard gridBoard,
                               IAgent agent,
                               IntegerPosition position)
Return an instance of this class using the given parameters.

Since:
v0.2

poolReport

public static void poolReport()
Log a statistics report.

Since:
v0.3

clear

public void clear()
Clear the properties of this object.

Specified by:
clear in interface IAction
Overrides:
clear in class AbstractGridBoardAction
Since:
v0.3

doIt

public boolean doIt()
Perform the command encapsulated by this object.

Specified by:
doIt in interface IAction
Overrides:
doIt in class AbstractAction
Returns:
true if successful and can be undone.
Since:
v0.2

equals

public boolean equals(Object object)
Return true if the given object is equal to this.

Specified by:
equals in interface IAction
Overrides:
equals in class AbstractGridBoardAction
Parameters:
object - The object to compare.
Since:
v0.2

hashCode

public int hashCode()
Returns a hash code value for the object.

Specified by:
hashCode in interface IAction
Overrides:
hashCode in class AbstractGridBoardAction
Since:
v0.2

release

public void release()
Return this instance to the reusable object pool.

Specified by:
release in interface IAction
Overrides:
release in class AbstractAction
Since:
v0.3

toString

public String toString()
Return a string representation of this object.

Overrides:
toString in class AbstractAction
Since:
v0.2

undoIt

public boolean undoIt()
Undo the last invocation of doIt.

Specified by:
undoIt in interface IAction
Overrides:
undoIt in class AbstractAction
Returns:
true if the undo was successful.
Since:
v0.2

set

protected void set(IGridBoard gridBoard,
                   IAgent agent,
                   IntegerPosition position)
Set parameters on this object.

Since:
v0.3


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02