| java.lang.Object jgnash.util.BigDecimalCache
BigDecimalCache | public class BigDecimalCache (Code) | | A list class to cache BigDecimals at specified indexes. BigDecimalCache
operates under the assumption that it may need to expand the size of the list
if an index larger than the current capacity is being set. A returned value
of null on a get(index) operation means that the value at that index has not
been set.
author: Craig Cavanaugh author: $Id: BigDecimalCache.java 197 2008-01-01 08:13:35Z ccavanaugh $ |
Method Summary | |
public int | capacity() | public void | clear() Clear all of the BigDecimals in the cache. | public void | clear(int fromIndex) Clears the cache all of BigDecimals starting at fromIndex. | public void | ensureCapacity(int minCapacity) Increases the capacity of this BigDecimalCache instance, if
necessary, to ensure that it can hold at least the number of BigDecimals
specified by the minimum capacity argument. | final public BigDecimal | get(int index) Returns the BigDecimal at the specified position in the cache
Parameters: index - index of the BigDecimal to return. | public void | set(int index, BigDecimal element) Sets the BigDecimal at the specified position in this cache. | public void | trimToSize(int size) Trims the capacity of this BigDecimalCache instance to the
specified size. |
BigDecimalCache | public BigDecimalCache(int capacity)(Code) | | |
capacity | public int capacity()(Code) | | Returns the capacity of the cache
the capacity of the cache. |
clear | public void clear()(Code) | | Clear all of the BigDecimals in the cache.
|
clear | public void clear(int fromIndex)(Code) | | Clears the cache all of BigDecimals starting at fromIndex.
Parameters: fromIndex - index of first BigDecimal to be cleared. |
ensureCapacity | public void ensureCapacity(int minCapacity)(Code) | | Increases the capacity of this BigDecimalCache instance, if
necessary, to ensure that it can hold at least the number of BigDecimals
specified by the minimum capacity argument.
Parameters: minCapacity - the desired minimum capacity. |
get | final public BigDecimal get(int index)(Code) | | Returns the BigDecimal at the specified position in the cache
Parameters: index - index of the BigDecimal to return. the BigDecimal at the specified position in this list. |
set | public void set(int index, BigDecimal element)(Code) | | Sets the BigDecimal at the specified position in this cache.
Parameters: index - index of the BigDecimal to replace. Parameters: element - BigDecimal to be stored at the specified position. |
trimToSize | public void trimToSize(int size)(Code) | | Trims the capacity of this BigDecimalCache instance to the
specified size.
Parameters: size - the new capacity of the cache |
|
|