|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tangosol.util.Base
com.tangosol.util.AbstractLongArray
com.tangosol.util.SimpleLongArray
public class SimpleLongArray
An implementation of LongArray that stores values in an array, thus is actually an "IntArray". Optimized for 0-based arrays. Null values are not considered to be entries, thus will not affect "first" and "last" and will not show up in the iterator. Note: not designed to be thread safe.
Nested Class Summary | |
---|---|
class |
SimpleLongArray.Iterator
An Iterator that adds a "current element" concept, similar to the Map.Entry interface. |
Field Summary | |
---|---|
static Object[] |
EMPTY
Empty array of objects. |
static long |
MAX
Maximum index value. |
Constructor Summary | |
---|---|
SimpleLongArray()
Construct an empty SimpleLongArray. |
Method Summary | |
---|---|
long |
add(Object oValue)
Add the passed element value to the LongArray and return the index at which the element value was stored. |
void |
clear()
Remove all nodes from the LongArray. |
Object |
clone()
Make a clone of the LongArray. |
boolean |
contains(Object oValue)
Determine if the LongArray contains the specified element. |
boolean |
exists(long lIndex)
Determine if the specified index is in use. |
Object |
get(long lIndex)
Return the value stored at the specified index. |
long |
getFirstIndex()
Determine the first index that exists in the LongArray. |
long |
getLastIndex()
Determine the last index that exists in the LongArray. |
int |
getSize()
Determine the size of the LongArray. |
boolean |
isEmpty()
Test for empty LongArray. |
LongArray.Iterator |
iterator()
Obtain a LongArray.Iterator of the contents of the LongArray. |
LongArray.Iterator |
iterator(long lIndex)
Obtain a LongArray.Iterator of the contents of the LongArray, starting at a particular index such that the first call to next will set the location of the iterator at the first existent index that is greater than or equal to the specified index, or will throw a NoSuchElementException if there is no such existent index. |
Object |
remove(long lIndex)
Remove the specified index from the LongArray, returning its associated value. |
Object |
set(long lIndex,
Object oValue)
Add the passed item to the LongArray at the specified index. |
Methods inherited from class com.tangosol.util.AbstractLongArray |
---|
equals, toString |
Field Detail |
---|
public static final long MAX
public static final Object[] EMPTY
Constructor Detail |
---|
public SimpleLongArray()
Method Detail |
---|
public Object get(long lIndex)
get
in interface LongArray
get
in class AbstractLongArray
lIndex
- a long index value
public Object set(long lIndex, Object oValue)
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.
set
in interface LongArray
lIndex
- a long index valueoValue
- the object to store at the specified index
public long add(Object oValue)
add
in interface LongArray
add
in class AbstractLongArray
oValue
- the object to add to the LongArray
public boolean exists(long lIndex)
exists
in interface LongArray
exists
in class AbstractLongArray
lIndex
- a long index value
public Object remove(long lIndex)
remove
in interface LongArray
remove
in class AbstractLongArray
lIndex
- the index into the LongArray
public boolean contains(Object oValue)
More formally, returns true if and only if this LongArray contains at least one element e such that (oValue==null ? e==null : oValue.equals(e)).
contains
in interface LongArray
contains
in class AbstractLongArray
oValue
- element whose presence in this list is to be tested
public void clear()
clear
in interface LongArray
clear
in class AbstractLongArray
public boolean isEmpty()
isEmpty
in interface LongArray
isEmpty
in class AbstractLongArray
public int getSize()
getSize
in interface LongArray
getSize
in class AbstractLongArray
public LongArray.Iterator iterator()
iterator
in interface LongArray
public LongArray.Iterator iterator(long lIndex)
iterator
in interface LongArray
lIndex
- the LongArray index to iterate from
public long getFirstIndex()
getFirstIndex
in interface LongArray
getFirstIndex
in class AbstractLongArray
public long getLastIndex()
getLastIndex
in interface LongArray
getLastIndex
in class AbstractLongArray
public Object clone()
clone
in interface LongArray
clone
in class AbstractLongArray
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |