org.vizzini.ui.graphics
Class PolygonShapePool

java.lang.Object
  extended by org.vizzini.ui.graphics.PolygonShapePool

public final class PolygonShapePool
extends Object

Provides a pool for polygon shape objects.

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

Constructor Summary
PolygonShapePool()
          Construct this object.
PolygonShapePool(int maxSize)
          Construct this object with the given parameter.
 
Method Summary
 PolygonShape acquire()
          Return an instance from the reusable object pool, creating it if necessary.
 PolygonShape acquire(Color color, List points, boolean isWireframe)
          Return an instance from the reusable object pool, creating it if necessary.
 void release(PolygonShape polygon)
          Return an instance to the reusable object pool.
 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

PolygonShapePool

public PolygonShapePool()
Construct this object.

Since:
v0.2

PolygonShapePool

public PolygonShapePool(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.2
Method Detail

acquire

public PolygonShape acquire()
Return an instance from the reusable object pool, creating it if necessary.

Since:
v0.2

acquire

public PolygonShape acquire(Color color,
                            List points,
                            boolean isWireframe)
Return an instance from the reusable object pool, creating it if necessary.

Parameters:
color - Color.
points - Points.
isWireframe - Flag indicating whether the polygon should be drawn solid or wireframe.
Since:
v0.2

release

public void release(PolygonShape polygon)
Return an instance to the reusable object pool.

Parameters:
polygon - The instance to release.
Since:
v0.2

size

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

Since:
v0.2


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