Package com.tangosol.util
Class AbstractLongArray<V>
- java.lang.Object
-
- com.tangosol.util.AbstractLongArray<V>
-
- All Implemented Interfaces:
LongArray<V>,Serializable,Cloneable,Iterable<V>
- Direct Known Subclasses:
AbstractSparseArray,SimpleLongArray
public abstract class AbstractLongArray<V> extends Object implements LongArray<V>
An implementation of portions of the LongArray interface.- Version:
- 1.00 2002.04.24
- Author:
- cp
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.tangosol.util.LongArray
LongArray.Iterator<V>
-
-
Constructor Summary
Constructors Constructor Description AbstractLongArray()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longadd(V oValue)Add the passed element value to the LongArray and return the index at which the element value was stored.voidclear()Remove all nodes from the LongArray.AbstractLongArray<V>clone()Make a clone of the LongArray.booleancontains(V value)Determine if the LongArray contains the specified element.booleanequals(Object o)Test for LongArray equality.booleanexists(long lIndex)Determine if the specified index is in use.Vget(long lIndex)Return the value stored at the specified index.longgetFirstIndex()Determine the first index that exists in the LongArray.longgetLastIndex()Determine the last index that exists in the LongArray.intgetSize()Determine the size of the LongArray.inthashCode()longindexOf(V oValue)Return the index in this LongArray of the first occurrence of the specified element, or NOT_FOUND if this LongArray does not contain the specified element.longindexOf(V oValue, long lIndex)Return the index in this LongArray of the first occurrence of the specified element such that (index is greater or equal to lIndex), or NOT_FOUND if this LongArray does not contain the specified element.booleanisEmpty()Test for empty LongArray.longlastIndexOf(V oValue)Return the index in this LongArray of the last occurrence of the specified element, or NOT_FOUND if this LongArray does not contain the specified element.longlastIndexOf(V oValue, long lIndex)Return the index in this LongArray of the last occurrence of the specified element such that (index less than or equal to lIndex), or NOT_FOUND if this LongArray does not contain the specified element.Vremove(long lIndex)Remove the specified key from the LongArray, returning its associated value.voidremove(long lIndexFrom, long lIndexTo)Remove all nodes in the specified range.StringtoString()Provide a string representation of the LongArray.-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface com.tangosol.util.LongArray
ceiling, ceilingIndex, floor, floorIndex, iterator, iterator, keys, reverseIterator, reverseIterator, set
-
-
-
-
Method Detail
-
get
public V get(long lIndex)
Return the value stored at the specified index.
-
add
public long add(V oValue)
Add the passed element value to the LongArray and return the index at which the element value was stored.
-
exists
public boolean exists(long lIndex)
Determine if the specified index is in use.
-
remove
public V remove(long lIndex)
Remove the specified key from the LongArray, returning its associated value.
-
remove
public void remove(long lIndexFrom, long lIndexTo)Remove all nodes in the specified range.
-
contains
public boolean contains(V value)
Determine if the LongArray contains the specified element.More formally, returns true if and only if this LongArray contains at least one element e such that (o==null ? e==null : o.equals(e)).
-
clear
public void clear()
Remove all nodes from the LongArray.
-
isEmpty
public boolean isEmpty()
Test for empty LongArray.
-
getSize
public int getSize()
Determine the size of the LongArray.
-
getFirstIndex
public long getFirstIndex()
Determine the first index that exists in the LongArray.- Specified by:
getFirstIndexin interfaceLongArray<V>- Returns:
- the lowest long value that exists in this LongArray, or NOT_FOUND if the LongArray is empty
-
getLastIndex
public long getLastIndex()
Determine the last index that exists in the LongArray.- Specified by:
getLastIndexin interfaceLongArray<V>- Returns:
- the highest long value that exists in this LongArray, or NOT_FOUND if the LongArray is empty
-
indexOf
public long indexOf(V oValue)
Return the index in this LongArray of the first occurrence of the specified element, or NOT_FOUND if this LongArray does not contain the specified element.
-
indexOf
public long indexOf(V oValue, long lIndex)
Return the index in this LongArray of the first occurrence of the specified element such that (index is greater or equal to lIndex), or NOT_FOUND if this LongArray does not contain the specified element.
-
lastIndexOf
public long lastIndexOf(V oValue)
Return the index in this LongArray of the last occurrence of the specified element, or NOT_FOUND if this LongArray does not contain the specified element.- Specified by:
lastIndexOfin interfaceLongArray<V>- Parameters:
oValue- the object to find the index for- Returns:
- the index of the last occurrence of the specified object in the LongArray
-
lastIndexOf
public long lastIndexOf(V oValue, long lIndex)
Return the index in this LongArray of the last occurrence of the specified element such that (index less than or equal to lIndex), or NOT_FOUND if this LongArray does not contain the specified element.- Specified by:
lastIndexOfin interfaceLongArray<V>- Parameters:
oValue- the object to find the index forlIndex- the index to compare to- Returns:
- the index of the specified object in this LongArray that is less or equal to the specified index
-
toString
public String toString()
Provide a string representation of the LongArray.
-
equals
public boolean equals(Object o)
Test for LongArray equality.
-
-