Class ConverterCollections.ConverterLongArray<F,T>
java.lang.Object
com.tangosol.util.ConverterCollections.ConverterLongArray<F,T>
- Type Parameters:
F
- the type of the provided LongArrayT
- the type of the desired type
- All Implemented Interfaces:
LongArray<T>
,Serializable
,Cloneable
,Iterable<T>
- Enclosing class:
ConverterCollections
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
An Iterator that can convert from raw types to desired types.Nested classes/interfaces inherited from interface com.tangosol.util.LongArray
LongArray.Iterator<V>
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe Converter to use to convert from type T to type F.The Converter to use to convert from type F to type T.The LongArray to delegate to. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
Add the passed element value to the LongArray and return the index at which the element value was stored.ceiling
(long lIndex) Return the "first" value with an index which is greater than or equal to the specified index.long
ceilingIndex
(long lIndex) Return the "first" index which is greater than or equal to the specified index.void
clear()
Remove all nodes from the LongArray.clone()
Make a clone of the LongArray.boolean
Determine if the LongArray contains the specified element.boolean
exists
(long lIndex) Determine if the specified index is in use.floor
(long lIndex) Return the "first" value with an index which is less than or equal to the specified index.long
floorIndex
(long lIndex) Return the "first" index which is less than or equal to the specified index.get
(long lIndex) Return the value stored at the specified index.long
Determine the first index that exists in the LongArray.long
Determine the last index that exists in the LongArray.int
getSize()
Determine the size of the LongArray.long
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.long
Return the index in this LongArray of the first occurrence of the specified element such that (index greater or equal to lIndex), or NOT_FOUND if this LongArray does not contain the specified element.protected LongArray.Iterator
<T> Instantiate a new Iterator wrapping the provided iterator.boolean
isEmpty()
Test for empty LongArray.iterator()
Obtain a LongArray.Iterator of the contents of the LongArray in order of increasing indices.iterator
(long lIndex) Obtain a LongArray.Iterator of the contents of the LongArray in order of increasing indices, 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.long
lastIndexOf
(T 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.long
lastIndexOf
(T oValue, long lIndex) Return the index in this LongArray of the last occurrence of the specified element such that (index less then or equal to lIndex), or NOT_FOUND if this LongArray does not contain the specified element.remove
(long lIndex) Remove the specified index from the LongArray, returning its associated value.void
remove
(long lIndexFrom, long lIndexTo) Remove all nodes in the specified range.Obtain a LongArray.Iterator of the contents of the LongArray in reverse order (decreasing indices).reverseIterator
(long lIndex) Obtain a LongArray.Iterator of the contents of the LongArray in reverse order (decreasing indices), 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 less than or equal to the specified index, or will throw a NoSuchElementException if there is no such existent index.Add the passed item to the LongArray at the specified index.Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
f_laDelegate
-
f_convUp
-
f_convDown
-
-
Constructor Details
-
Method Details
-
get
-
floorIndex
public long floorIndex(long lIndex) Description copied from interface:LongArray
Return the "first" index which is less than or equal to the specified index.- Specified by:
floorIndex
in interfaceLongArray<F>
- Parameters:
lIndex
- the index- Returns:
- the index or NOT_FOUND
-
floor
-
ceilingIndex
public long ceilingIndex(long lIndex) Description copied from interface:LongArray
Return the "first" index which is greater than or equal to the specified index.- Specified by:
ceilingIndex
in interfaceLongArray<F>
- Parameters:
lIndex
- the index- Returns:
- the index or NOT_FOUND
-
ceiling
-
set
Description copied from interface:LongArray
Add the passed item to the LongArray at the specified index.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.
-
add
Description copied from interface:LongArray
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) Description copied from interface:LongArray
Determine if the specified index is in use. -
remove
Description copied from interface:LongArray
Remove the specified index from the LongArray, returning its associated value. -
remove
-
contains
Description copied from interface:LongArray
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
-
isEmpty
-
getSize
-
iterator
Description copied from interface:LongArray
Obtain a LongArray.Iterator of the contents of the LongArray in order of increasing indices. -
iterator
Description copied from interface:LongArray
Obtain a LongArray.Iterator of the contents of the LongArray in order of increasing indices, 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. -
reverseIterator
Description copied from interface:LongArray
Obtain a LongArray.Iterator of the contents of the LongArray in reverse order (decreasing indices).- Specified by:
reverseIterator
in interfaceLongArray<F>
- Returns:
- an instance of LongArray.Iterator
-
reverseIterator
Description copied from interface:LongArray
Obtain a LongArray.Iterator of the contents of the LongArray in reverse order (decreasing indices), 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 less than or equal to the specified index, or will throw a NoSuchElementException if there is no such existent index.- Specified by:
reverseIterator
in interfaceLongArray<F>
- Parameters:
lIndex
- the LongArray index to iterate from- Returns:
- an instance of LongArray.Iterator
-
getFirstIndex
public long getFirstIndex()Description copied from interface:LongArray
Determine the first index that exists in the LongArray.- Specified by:
getFirstIndex
in interfaceLongArray<F>
- Returns:
- the lowest long value that exists in this LongArray, or NOT_FOUND if the LongArray is empty
-
getLastIndex
public long getLastIndex()Description copied from interface:LongArray
Determine the last index that exists in the LongArray.- Specified by:
getLastIndex
in interfaceLongArray<F>
- Returns:
- the highest long value that exists in this LongArray, or NOT_FOUND if the LongArray is empty
-
indexOf
Description copied from interface:LongArray
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
Description copied from interface:LongArray
Return the index in this LongArray of the first occurrence of the specified element such that (index greater or equal to lIndex), or NOT_FOUND if this LongArray does not contain the specified element. -
lastIndexOf
Description copied from interface:LongArray
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:
lastIndexOf
in interfaceLongArray<F>
- Parameters:
oValue
- the object to find the index for- Returns:
- the index of the last occurrence of the specified object in the LongArray
-
lastIndexOf
Description copied from interface:LongArray
Return the index in this LongArray of the last occurrence of the specified element such that (index less then or equal to lIndex), or NOT_FOUND if this LongArray does not contain the specified element.- Specified by:
lastIndexOf
in interfaceLongArray<F>
- 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
-
clone
-
instantiateIterator
Instantiate a new Iterator wrapping the provided iterator.- Parameters:
iter
- the Iterator to wrap- Returns:
- an iterator converting the raw type to the desired type
-