org.vizzini.game.boardgame.action
Class AbstractGridBoardActionPool

java.lang.Object
  extended by org.vizzini.game.boardgame.action.AbstractGridBoardActionPool
Direct Known Subclasses:
CastleActionPool, EnPassantCaptureActionPool, MoveActionPool, MoveCaptureActionPool, PawnPromotionActionPool, PawnPromotionCaptureActionPool, PlaceActionPool, RemoveActionPool

public abstract class AbstractGridBoardActionPool
extends Object

Provides base functionality for a pool for grid board action objects.

Since:
v0.3
Version:
v0.3
Author:
Jeffrey M. Thompson

Constructor Summary
AbstractGridBoardActionPool()
          Construct this object.
AbstractGridBoardActionPool(int maxSize)
          Construct this object with the given parameter.
 
Method Summary
protected  List getPool()
          Return the pool vector.
protected  void incrementCreationCount()
          Increment the creation count.
 void release(IAction action)
          Return an instance to the reusable object pool.
 void report()
          Log a statistics report.
 int size()
          Return the current size of the pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractGridBoardActionPool

public AbstractGridBoardActionPool()
Construct this object.

Since:
v0.3

AbstractGridBoardActionPool

public AbstractGridBoardActionPool(int maxSize)
Construct this object with the given parameter.

Parameters:
maxSize - Guess at the maximum size of the pool. The pool will expand as necessary.
Since:
v0.3
Method Detail

release

public void release(IAction action)
Return an instance to the reusable object pool.

Parameters:
action - The instance to release.
Since:
v0.3

report

public void report()
Log a statistics report.

Since:
v0.3

size

public int size()
Return the current size of the pool.

Since:
v0.3

getPool

protected List getPool()
Return the pool vector.

Since:
v0.3

incrementCreationCount

protected void incrementCreationCount()
Increment the creation count.

Since:
v0.3


Copyright © 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02