|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.AbstractLongArray
com.tangosol.util.AbstractSparseArray
com.tangosol.util.PrimitiveSparseArray
public class PrimitiveSparseArray
A data structure resembling a long array indexed by long values.
While the PrimitiveSparseArray implements the LongArray interface, it stores all values as primitive longs, and as such any Object supplied to its LongArray interface must be provided as a java.lang.Long. The PrimitiveSparseArray provides additional methods whose signatures utilize primitive longs to avoid the creation of temporary Long objects.
SparseArray| Nested Class Summary | |
|---|---|
class |
PrimitiveSparseArray.IteratorIterator over long values stored in the tree. |
protected static class |
PrimitiveSparseArray.PrimitiveNodeNode mapping long key to Object value. |
| Nested classes/interfaces inherited from class com.tangosol.util.AbstractSparseArray |
|---|
AbstractSparseArray.Crawler, AbstractSparseArray.Node |
| Field Summary |
|---|
| Fields inherited from class com.tangosol.util.AbstractSparseArray |
|---|
m_head, m_size |
| Fields inherited from interface com.tangosol.util.LongArray |
|---|
NOT_FOUND |
| Constructor Summary | |
|---|---|
PrimitiveSparseArray()Default constructor. |
|
PrimitiveSparseArray(PrimitiveSparseArray array)Copy constructor. |
|
| Method Summary | |
|---|---|
long |
getPrimitive(long lIndex)Return the value stored at the specified index. |
protected AbstractSparseArray.Crawler |
instantiateCrawler(AbstractSparseArray.Node head, int fromdir, boolean fForward)Instantate a new Crawler at the specified location and direction. |
protected AbstractSparseArray.Node |
instantiateNode(long lKey, long lValue)Create a new Node with the specified key and value. |
protected AbstractSparseArray.Node |
instantiateNode(long lKey, java.lang.Object oValue)Factory pattern: create a new Node with the specified key and value. |
long |
removePrimitive(long lIndex)Remove the specified index from the PrimitiveSparseArray, returning its associated value. |
long |
setPrimitive(long lIndex, long lValue)Add the passed item to the PrimitiveSparseArray at the specified index. |
| Methods inherited from class com.tangosol.util.AbstractSparseArray |
|---|
adjustDoubleBalance, balancedInsertion, balancePostRemove, clear, clone, doubleRotate, exists, find, findInsertionPoint, get, getFirstIndex, getLastIndex, getSize, iterator, iterator, print, remove, remove, replace, reverseIterator, reverseIterator, rotate, set, validate |
| Methods inherited from class com.tangosol.util.AbstractLongArray |
|---|
add, contains, equals, hashCode, indexOf, indexOf, isEmpty, lastIndexOf, lastIndexOf, toString |
| Constructor Detail |
|---|
public PrimitiveSparseArray()
public PrimitiveSparseArray(PrimitiveSparseArray array)
array - a PrimitiveSparseArray to copy from.| Method Detail |
|---|
public long getPrimitive(long lIndex)
lIndex - a long index valuepublic long removePrimitive(long lIndex)
lIndex - the index into the LongArray
public long setPrimitive(long lIndex,
long lValue)
If the index is already used, the passed value will replace the current value stored with the key, and the replaced value will be returned.
It is expected that LongArray implementations will "grow" as necessary to support the specified index.
lIndex - a long index valuelValue - the long value to store at the specified index
protected AbstractSparseArray.Node instantiateNode(long lKey,
java.lang.Object oValue)
instantiateNode in class AbstractSparseArraylKey - the long keyoValue - the object value
protected AbstractSparseArray.Node instantiateNode(long lKey,
long lValue)
lKey - the long keylValue - the long value
protected AbstractSparseArray.Crawler instantiateCrawler(AbstractSparseArray.Node head,
int fromdir,
boolean fForward)
instantiateCrawler in class AbstractSparseArrayhead - the node at which to start the crawlfromdir - the direction in which to start the crawl
|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||