|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjgnash.util.BigDecimalCache
public class BigDecimalCache
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.
| Field Summary | |
|---|---|
private java.math.BigDecimal[] |
cache
|
| Constructor Summary | |
|---|---|
BigDecimalCache(int capacity)
|
|
| Method Summary | |
|---|---|
void |
clear()
Clear all of the BigDecimals in the cache. |
void |
clear(int fromIndex)
Clears the cache all of BigDecimals starting at fromIndex. |
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. |
java.math.BigDecimal |
get(int index)
Returns the BigDecimal at the specified position in the cache |
void |
set(int index,
java.math.BigDecimal element)
Sets the BigDecimal at the specified position in this cache. |
void |
trimToSize(int size)
Trims the capacity of this BigDecimalCache instance to the specified size. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.math.BigDecimal[] cache
| Constructor Detail |
|---|
public BigDecimalCache(int capacity)
| Method Detail |
|---|
public void trimToSize(int size)
size - the new capacity of the cachepublic void ensureCapacity(int minCapacity)
minCapacity - the desired minimum capacity.public final java.math.BigDecimal get(int index)
index - index of the BigDecimal to return.
public void set(int index,
java.math.BigDecimal element)
index - index of the BigDecimal to replace.element - BigDecimal to be stored at the specified position.public void clear()
public void clear(int fromIndex)
fromIndex - index of first BigDecimal to be cleared.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||