org.gersteinlab.tyna.core.util
Class IntegerPool

java.lang.Object
  extended by org.gersteinlab.tyna.core.util.IntegerPool

public class IntegerPool
extends java.lang.Object

        This class represents a pool of integer objects for reuse.
        

Version:
1.0 (March 8, 2007) Change History: 1.0 - Initial version
Author:
Kevin Yuk-Lap Yip

Field Summary
static java.util.Map pool
          The pool of integers (each integer maps to itself)
 
Constructor Summary
IntegerPool()
           
 
Method Summary
static void clear()
          Remove all the integers from the pool.
static java.lang.Integer get(int value)
          Get a pooled integer object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pool

public static java.util.Map pool
The pool of integers (each integer maps to itself)

Constructor Detail

IntegerPool

public IntegerPool()
Method Detail

get

public static java.lang.Integer get(int value)
Get a pooled integer object. If the object was not in the pool, it would be added.

Parameters:
value - The integer value
Returns:
An integer object for the value

clear

public static void clear()
Remove all the integers from the pool.