Methods Summary |
---|
private void | buildInitialObjects(int startingSize, int maximumSize)
_availableObjects = new Object[maximumSize];
int counter;
for (counter = 0; counter < startingSize; counter++) {
_availableObjects[counter] = _helper.create();
}
_currentPosition = startingSize - 1;
|
public synchronized java.lang.Object | getObject()
if (_currentPosition == -1) {
return _helper.create();
}
return getObjectFromArray();
|
private java.lang.Object | getObjectFromArray()
Object returnValue = _availableObjects[_currentPosition];
_availableObjects[_currentPosition] = null;
_currentPosition--;
return returnValue;
|
public synchronized void | returnObject(java.lang.Object object)
if (_currentPosition == _maximumIndex) {
_helper.dispose(object);
return;
}
if (!_helper.isObjectStillValid(object)) {
_helper.dispose(object);
return;
}
_currentPosition++;
_availableObjects[_currentPosition] = object;
|