opennlp.maxent
Class IntegerPool

java.lang.Object
  extended by opennlp.maxent.IntegerPool

public class IntegerPool
extends java.lang.Object

A pool of read-only, unsigned Integer objects within a fixed, non-sparse range. Use this class for operations in which a large number of Integer wrapper objects will be created. Created: Sat Oct 27 10:59:11 2001

Version:
$Id: IntegerPool.java,v 1.1 2001/10/28 03:17:03 ericdf Exp $
Author:
Eric Friedman

Constructor Summary
IntegerPool(int size)
          Creates an IntegerPool with 0..size Integer objects.
 
Method Summary
 java.lang.Integer get(int value)
          Returns the shared Integer wrapper for value if it is inside the range managed by this pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntegerPool

public IntegerPool(int size)
Creates an IntegerPool with 0..size Integer objects.

Parameters:
size - the size of the pool.
Method Detail

get

public java.lang.Integer get(int value)
Returns the shared Integer wrapper for value if it is inside the range managed by this pool. if value is outside the range, a new Integer instance is returned.

Parameters:
value - an int value
Returns:
an Integer value


Copyright © 2005 Jason Baldridge, Gann Bierner, and Thomas Morton. All Rights Reserved.