Top Description Inners Fields Constructors Methods
com.carrotsearch.hppc

public Class ObjectArrayList<KType>

extends AbstractObjectCollection<KType>
implements ObjectIndexedContainer<KType>, Preallocable, Cloneable, Accountable
Class Inheritance
All Implemented Interfaces
com.carrotsearch.hppc.Accountable, java.lang.Cloneable, com.carrotsearch.hppc.Preallocable, com.carrotsearch.hppc.ObjectIndexedContainer, java.util.RandomAccess, com.carrotsearch.hppc.ObjectCollection, com.carrotsearch.hppc.ObjectContainer, java.lang.Iterable
Known Direct Subclasses
com.carrotsearch.hppc.ObjectStack
Annotations
@SuppressWarnings:unchecked
@Generated:KTypeArrayList.java
date:2024-06-04T15:20:17+0200
Static Imports
com.carrotsearch.hppc.Containers.*

An array-backed list of Objects.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
ObjectArrayList.ValueIterator<KType>

An iterator implementation for ObjectArrayList#iterator.

Field Summary

Modifier and TypeField and Description
public Object[]
buffer

Internal array for storing the list.

private static final BoundedProportionalArraySizingStrategy
DEFAULT_SIZING_STRATEGY

Reuse the same strategy instance.

public int
elementsCount

Current number of elements stored in buffer.

public static final Object[]
EMPTY_ARRAY

An immutable empty buffer (array).

protected final ArraySizingStrategy
resizer

Buffer resizing strategy.

Constructor Summary

AccessConstructor and Description
public
ObjectArrayList()

New instance with sane defaults.

public
ObjectArrayList(int
The expected number of elements guaranteed not to cause buffer expansion (inclusive).
expectedElements
)

New instance with sane defaults.

public
ObjectArrayList(int
The expected number of elements guaranteed not to cause buffer expansion (inclusive).
expectedElements
,
ArraySizingStrategy
Underlying buffer sizing strategy.
resizer
)

New instance with sane defaults.

public
ObjectArrayList(ObjectContainer<? extends KType> container)

Creates a new list from the elements of another container in its iteration order.

Method Summary

Modifier and TypeMethod and Description
public void
add(KType e1)

Implements com.carrotsearch.hppc.ObjectIndexedContainer.add.

Adds an element to the end of this container (the last index is incremented by one).

public void
add(KType e1, KType e2)

Appends two elements at the end of the list.

public void
add(KType[] elements, int start, int length)

Add all elements from a range of given array to the list.

public final void
add(KType... elements)

Implements com.carrotsearch.hppc.ObjectIndexedContainer.add.

Vararg-signature method for adding elements at the end of the list.

public int
addAll(ObjectContainer<? extends KType> container)

Adds all elements from another container.

public int
addAll(Iterable<? extends ObjectCursor<? extends KType>> iterable)

Adds all elements from another iterable.

public void
clear()

Implements com.carrotsearch.hppc.ObjectCollection.clear.

Sets the number of stored elements to zero.

public ObjectArrayList<KType>
clone()

Overrides java.lang.Object.clone.

Clone this object.

public boolean
contains(KType e1)

Implements com.carrotsearch.hppc.ObjectContainer.contains.

Lookup a given element in the container.

protected void
ensureBufferSpace(int expectedAdditions)

Ensures the internal buffer has enough free slots to store expectedAdditions.

public void
ensureCapacity(int
The total number of elements, inclusive.
expectedElements
)

Implements com.carrotsearch.hppc.Preallocable.ensureCapacity.

Ensure this container can hold at least the given number of elements without resizing its buffers.

protected boolean
equalElements(ObjectArrayList<?> other)

Compare index-aligned elements against another ObjectIndexedContainer.

public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Returns true only if the other object is an instance of the same class and with the same elements.

public <T extends ObjectProcedure<? super KType>> T
forEach(T procedure)

Implements com.carrotsearch.hppc.ObjectContainer.forEach, com.carrotsearch.hppc.ObjectContainer.forEach.

Applies a procedure to all container elements.

public <T extends ObjectProcedure<? super KType>> T
forEach(T procedure, int fromIndex, final int toIndex)

Applies procedure to a slice of the list, fromIndex, inclusive, to toIndex, exclusive.

public <T extends ObjectPredicate<? super KType>> T
forEach(T predicate)

Implements com.carrotsearch.hppc.ObjectContainer.forEach, com.carrotsearch.hppc.ObjectContainer.forEach.

Applies a procedure to all container elements.

public <T extends ObjectPredicate<? super KType>> T
forEach(T predicate, int fromIndex, final int toIndex)

Applies predicate to a slice of the list, fromIndex, inclusive, to toIndex, exclusive, or until predicate returns false.

public static <KType> ObjectArrayList<KType>
from(KType... elements)

Create a list from a variable number of arguments or an array of Object.

public KType
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public int
indexOf(KType e1)

Implements com.carrotsearch.hppc.ObjectIndexedContainer.indexOf.

Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.

public void
insert(int
The index at which the element should be inserted, shifting any existing and subsequent elements to the right.
index
,
KType e1)

Implements com.carrotsearch.hppc.ObjectIndexedContainer.insert.

Inserts the specified element at the specified position in this list.

public boolean
isEmpty()

Implements com.carrotsearch.hppc.ObjectContainer.isEmpty.

Shortcut for size() == 0.

public Iterator<ObjectCursor<KType>>
iterator()

Implements com.carrotsearch.hppc.ObjectContainer.iterator.

Returns an iterator to a cursor traversing the collection.

public int
lastIndexOf(KType e1)

Implements com.carrotsearch.hppc.ObjectIndexedContainer.lastIndexOf.

Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.

public long
public long
ramBytesUsed()

Implements com.carrotsearch.hppc.Accountable.ramBytesUsed.

Bytes that is actually been used

public void
release()

Implements com.carrotsearch.hppc.ObjectCollection.release.

Sets the number of stored elements to zero and releases the internal storage array.

public int
removeAll(KType
Element to be removed from this collection, if present.
e1
)

Implements com.carrotsearch.hppc.ObjectCollection.removeAll.

Removes all occurrences of e from this collection.

public int
removeAll(ObjectPredicate<? super KType> predicate)

Implements com.carrotsearch.hppc.ObjectCollection.removeAll, com.carrotsearch.hppc.ObjectCollection.removeAll.

Removes all elements in this collection for which the given predicate returns true .

public KType
removeAt(int index)

Implements com.carrotsearch.hppc.ObjectIndexedContainer.removeAt.

Removes the element at the specified position in this container and returns it.

public boolean
removeElement(KType e1)

Implements com.carrotsearch.hppc.ObjectIndexedContainer.removeElement.

Removes the first element that equals e1, returning whether an element has been removed.

public int
removeFirst(KType e1)

Implements com.carrotsearch.hppc.ObjectIndexedContainer.removeFirst.

Removes the first element that equals e1, returning its deleted position or -1 if the element was not found.

public KType
removeLast()

Implements com.carrotsearch.hppc.ObjectIndexedContainer.removeLast.

Removes and returns the last element of this container.

public int
removeLast(KType e1)

Implements com.carrotsearch.hppc.ObjectIndexedContainer.removeLast.

Removes the last element that equals e1, returning its deleted position or -1 if the element was not found.

public void
removeRange(int fromIndex, int toIndex)

Implements com.carrotsearch.hppc.ObjectIndexedContainer.removeRange.

Removes from this container all of the elements with indexes between fromIndex, inclusive, and toIndex, exclusive.

public void
resize(int newSize)

Truncate or expand the list to the new size.

public ObjectIndexedContainer<KType>
reverse()

Implements com.carrotsearch.hppc.ObjectIndexedContainer.reverse.

Reverses the elements in this container and returns this container.

public KType
set(int index, KType e1)

Implements com.carrotsearch.hppc.ObjectIndexedContainer.set.

Replaces the element at the specified position in this list with the specified element.

public int
size()

Implements com.carrotsearch.hppc.ObjectContainer.size.

Return the current number of elements in this container.

public ObjectIndexedContainer<KType>
sort()

Implements com.carrotsearch.hppc.ObjectIndexedContainer.sort.

Sorts the elements in this container and returns this container.

public Stream<KType>
stream()

Implements com.carrotsearch.hppc.ObjectIndexedContainer.stream.

Returns this container elements as a stream.

public Object[]
toArray()

Overrides com.carrotsearch.hppc.AbstractObjectCollection.toArray.

Implements com.carrotsearch.hppc.ObjectContainer.toArray.

Copies all elements of this container to an array.

public void
trimToSize()

Trim the internal buffer to the current size.

Inherited from com.carrotsearch.hppc.AbstractObjectCollection:
equalsremoveAllretainAllretainAlltoArraytoString

Field Detail

bufferback to summary
public Object[] buffer

Internal array for storing the list. The array may be larger than the current size (size()).

DEFAULT_SIZING_STRATEGYback to summary
private static final BoundedProportionalArraySizingStrategy DEFAULT_SIZING_STRATEGY

Reuse the same strategy instance.

elementsCountback to summary
public int elementsCount

Current number of elements stored in buffer.

EMPTY_ARRAYback to summary
public static final Object[] EMPTY_ARRAY

An immutable empty buffer (array).

resizerback to summary
protected final ArraySizingStrategy resizer

Buffer resizing strategy.

Constructor Detail

ObjectArrayListback to summary
public ObjectArrayList()

New instance with sane defaults.

ObjectArrayListback to summary
public ObjectArrayList(int expectedElements)

New instance with sane defaults.

Parameters
expectedElements:int

The expected number of elements guaranteed not to cause buffer expansion (inclusive).

ObjectArrayListback to summary
public ObjectArrayList(int expectedElements, ArraySizingStrategy resizer)

New instance with sane defaults.

Parameters
expectedElements:int

The expected number of elements guaranteed not to cause buffer expansion (inclusive).

resizer:ArraySizingStrategy

Underlying buffer sizing strategy.

ObjectArrayListback to summary
public ObjectArrayList(ObjectContainer<? extends KType> container)

Creates a new list from the elements of another container in its iteration order.

Method Detail

addback to summary
public void add(KType e1)

Implements com.carrotsearch.hppc.ObjectIndexedContainer.add.

Doc from com.carrotsearch.hppc.ObjectIndexedContainer.add.

Adds an element to the end of this container (the last index is incremented by one).

Annotations
@Override
addback to summary
public void add(KType e1, KType e2)

Appends two elements at the end of the list. To add more than two elements, use add (vararg-version) or access the buffer directly (tight loop).

addback to summary
public void add(KType[] elements, int start, int length)

Add all elements from a range of given array to the list.

addback to summary
public final void add(KType... elements)

Implements com.carrotsearch.hppc.ObjectIndexedContainer.add.

Vararg-signature method for adding elements at the end of the list.

This method is handy, but costly if used in tight loops (anonymous array passing)

Annotations
@SafeVarargs
addAllback to summary
public int addAll(ObjectContainer<? extends KType> container)

Adds all elements from another container.

addAllback to summary
public int addAll(Iterable<? extends ObjectCursor<? extends KType>> iterable)

Adds all elements from another iterable.

clearback to summary
public void clear()

Implements com.carrotsearch.hppc.ObjectCollection.clear.

Sets the number of stored elements to zero. Releases and initializes the internal storage array to default values. To clear the list without cleaning the buffer, simply set the elementsCount field to zero.

Annotations
@Override
cloneback to summary
public ObjectArrayList<KType> clone()

Overrides java.lang.Object.clone.

Clone this object. The returned clone will reuse the same hash function and array resizing strategy.

Returns:ObjectArrayList<KType>

Doc from java.lang.Object.clone.

a clone of this instance.

Annotations
@Override
containsback to summary
public boolean contains(KType e1)

Implements com.carrotsearch.hppc.ObjectContainer.contains.

Doc from com.carrotsearch.hppc.ObjectContainer.contains.

Lookup a given element in the container. This operation has no speed guarantees (may be linear with respect to the size of this container).

Returns:boolean

Returns true if this container has an element equal to e.

Annotations
@Override
ensureBufferSpaceback to summary
protected void ensureBufferSpace(int expectedAdditions)

Ensures the internal buffer has enough free slots to store expectedAdditions. Increases internal buffer size if needed.

ensureCapacityback to summary
public void ensureCapacity(int expectedElements)

Implements com.carrotsearch.hppc.Preallocable.ensureCapacity.

Ensure this container can hold at least the given number of elements without resizing its buffers.

Parameters
expectedElements:int

The total number of elements, inclusive.

Annotations
@Override
equalElementsback to summary
protected boolean equalElements(ObjectArrayList<?> other)

Compare index-aligned elements against another ObjectIndexedContainer. Equality comparison is performed with this object's equals(Object, Object) method.

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Returns true only if the other object is an instance of the same class and with the same elements. Equality comparison is performed with this object's equals(Object, Object) method.

Parameters
obj:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
forEachback to summary
public <T extends ObjectProcedure<? super KType>> T forEach(T procedure)

Implements com.carrotsearch.hppc.ObjectContainer.forEach, com.carrotsearch.hppc.ObjectContainer.forEach.

Doc from com.carrotsearch.hppc.ObjectContainer.forEach.

Applies a procedure to all container elements. Returns the argument (any subclass of ObjectProcedure. This lets the caller to call methods of the argument by chaining the call (even if the argument is an anonymous type) to retrieve computed values, for example (IntContainer):

int count = container.forEach(new IntProcedure() {
  int count; // this is a field declaration in an anonymous class.

  public void apply(int value) {
    count++;
  }
}).count;
Annotations
@Override
forEachback to summary
public <T extends ObjectProcedure<? super KType>> T forEach(T procedure, int fromIndex, final int toIndex)

Applies procedure to a slice of the list, fromIndex, inclusive, to toIndex, exclusive.

forEachback to summary
public <T extends ObjectPredicate<? super KType>> T forEach(T predicate)

Implements com.carrotsearch.hppc.ObjectContainer.forEach, com.carrotsearch.hppc.ObjectContainer.forEach.

Doc from com.carrotsearch.hppc.ObjectContainer.forEach.

Applies a procedure to all container elements. Returns the argument (any subclass of ObjectProcedure. This lets the caller to call methods of the argument by chaining the call (even if the argument is an anonymous type) to retrieve computed values, for example (IntContainer):

int count = container.forEach(new IntProcedure() {
  int count; // this is a field declaration in an anonymous class.

  public void apply(int value) {
    count++;
  }
}).count;
Annotations
@Override
forEachback to summary
public <T extends ObjectPredicate<? super KType>> T forEach(T predicate, int fromIndex, final int toIndex)

Applies predicate to a slice of the list, fromIndex, inclusive, to toIndex, exclusive, or until predicate returns false.

fromback to summary
public static <KType> ObjectArrayList<KType> from(KType... elements)

Create a list from a variable number of arguments or an array of Object. The elements are copied from the argument to the internal buffer.

Annotations
@SafeVarargs
getback to summary
public KType get(int index)

Implements com.carrotsearch.hppc.ObjectIndexedContainer.get.

Returns:KType

Doc from com.carrotsearch.hppc.ObjectIndexedContainer.get.

Returns the element at index index from the list.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
indexOfback to summary
public int indexOf(KType e1)

Implements com.carrotsearch.hppc.ObjectIndexedContainer.indexOf.

Doc from com.carrotsearch.hppc.ObjectIndexedContainer.indexOf.

Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.

Annotations
@Override
insertback to summary
public void insert(int index, KType e1)

Implements com.carrotsearch.hppc.ObjectIndexedContainer.insert.

Doc from com.carrotsearch.hppc.ObjectIndexedContainer.insert.

Inserts the specified element at the specified position in this list.

Parameters
index:int

The index at which the element should be inserted, shifting any existing and subsequent elements to the right.

Annotations
@Override
isEmptyback to summary
public boolean isEmpty()

Implements com.carrotsearch.hppc.ObjectContainer.isEmpty.

Doc from com.carrotsearch.hppc.ObjectContainer.isEmpty.

Shortcut for size() == 0.

Annotations
@Override
iteratorback to summary
public Iterator<ObjectCursor<KType>> iterator()

Implements com.carrotsearch.hppc.ObjectContainer.iterator.

Doc from com.carrotsearch.hppc.ObjectContainer.iterator.

Returns an iterator to a cursor traversing the collection. The order of traversal is not defined. More than one cursor may be active at a time. The behavior of iterators is undefined if structural changes are made to the underlying collection.

The iterator is implemented as a cursor and it returns the same cursor instance on every call to Iterator#next() (to avoid boxing of primitive types). To read the current list's value (or index in the list) use the cursor's public fields. An example is shown below.

for (ObjectCursor<Object> c : container) {
  System.out.println("index=" + c.index + " value=" + c.value);
}
Returns:Iterator<ObjectCursor<KType>>

Doc from java.lang.Iterable.iterator.

an Iterator.

Annotations
@Override
lastIndexOfback to summary
public int lastIndexOf(KType e1)

Implements com.carrotsearch.hppc.ObjectIndexedContainer.lastIndexOf.

Doc from com.carrotsearch.hppc.ObjectIndexedContainer.lastIndexOf.

Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.

Annotations
@Override
ramBytesAllocatedback to summary
public long ramBytesAllocated()

Implements com.carrotsearch.hppc.Accountable.ramBytesAllocated.

Doc from com.carrotsearch.hppc.Accountable.ramBytesAllocated.

Allocated memory estimation

Returns:long

Ram allocated in bytes

Annotations
@Override
ramBytesUsedback to summary
public long ramBytesUsed()

Implements com.carrotsearch.hppc.Accountable.ramBytesUsed.

Doc from com.carrotsearch.hppc.Accountable.ramBytesUsed.

Bytes that is actually been used

Returns:long

Ram used in bytes

Annotations
@Override
releaseback to summary
public void release()

Implements com.carrotsearch.hppc.ObjectCollection.release.

Sets the number of stored elements to zero and releases the internal storage array.

Annotations
@Override
removeAllback to summary
public int removeAll(KType e1)

Implements com.carrotsearch.hppc.ObjectCollection.removeAll.

Doc from com.carrotsearch.hppc.ObjectCollection.removeAll.

Removes all occurrences of e from this collection.

Parameters
e1:KType

Element to be removed from this collection, if present.

Returns:int

The number of removed elements as a result of this call.

Annotations
@Override
removeAllback to summary
public int removeAll(ObjectPredicate<? super KType> predicate)

Implements com.carrotsearch.hppc.ObjectCollection.removeAll, com.carrotsearch.hppc.ObjectCollection.removeAll.

Doc from com.carrotsearch.hppc.ObjectCollection.removeAll.

Removes all elements in this collection for which the given predicate returns true .

Returns:int

Returns the number of removed elements.

Annotations
@Override
removeAtback to summary
public KType removeAt(int index)

Implements com.carrotsearch.hppc.ObjectIndexedContainer.removeAt.

Doc from com.carrotsearch.hppc.ObjectIndexedContainer.removeAt.

Removes the element at the specified position in this container and returns it.

Annotations
@Override
removeElementback to summary
public boolean removeElement(KType e1)

Implements com.carrotsearch.hppc.ObjectIndexedContainer.removeElement.

Doc from com.carrotsearch.hppc.ObjectIndexedContainer.removeElement.

Removes the first element that equals e1, returning whether an element has been removed.

Annotations
@Override
removeFirstback to summary
public int removeFirst(KType e1)

Implements com.carrotsearch.hppc.ObjectIndexedContainer.removeFirst.

Doc from com.carrotsearch.hppc.ObjectIndexedContainer.removeFirst.

Removes the first element that equals e1, returning its deleted position or -1 if the element was not found.

Annotations
@Override
removeLastback to summary
public KType removeLast()

Implements com.carrotsearch.hppc.ObjectIndexedContainer.removeLast.

Doc from com.carrotsearch.hppc.ObjectIndexedContainer.removeLast.

Removes and returns the last element of this container. This container must not be empty.

Annotations
@Override
removeLastback to summary
public int removeLast(KType e1)

Implements com.carrotsearch.hppc.ObjectIndexedContainer.removeLast.

Doc from com.carrotsearch.hppc.ObjectIndexedContainer.removeLast.

Removes the last element that equals e1, returning its deleted position or -1 if the element was not found.

Annotations
@Override
removeRangeback to summary
public void removeRange(int fromIndex, int toIndex)

Implements com.carrotsearch.hppc.ObjectIndexedContainer.removeRange.

Doc from com.carrotsearch.hppc.ObjectIndexedContainer.removeRange.

Removes from this container all of the elements with indexes between fromIndex, inclusive, and toIndex, exclusive.

Annotations
@Override
resizeback to summary
public void resize(int newSize)

Truncate or expand the list to the new size. If the list is truncated, the buffer will not be reallocated (use trimToSize() if you need a truncated buffer), but the truncated values will be reset to the default value (zero). If the list is expanded, the elements beyond the current size are initialized with JVM-defaults (zero or null values).

reverseback to summary
public ObjectIndexedContainer<KType> reverse()

Implements com.carrotsearch.hppc.ObjectIndexedContainer.reverse.

Doc from com.carrotsearch.hppc.ObjectIndexedContainer.reverse.

Reverses the elements in this container and returns this container.

Annotations
@Override
setback to summary
public KType set(int index, KType e1)

Implements com.carrotsearch.hppc.ObjectIndexedContainer.set.

Doc from com.carrotsearch.hppc.ObjectIndexedContainer.set.

Replaces the element at the specified position in this list with the specified element.

Returns:KType

Returns the previous value in the list.

Annotations
@Override
sizeback to summary
public int size()

Implements com.carrotsearch.hppc.ObjectContainer.size.

Doc from com.carrotsearch.hppc.ObjectContainer.size.

Return the current number of elements in this container. The time for calculating the container's size may take O(n) time, although implementing classes should try to maintain the current size and return in constant time.

Annotations
@Override
sortback to summary
public ObjectIndexedContainer<KType> sort()

Implements com.carrotsearch.hppc.ObjectIndexedContainer.sort.

Doc from com.carrotsearch.hppc.ObjectIndexedContainer.sort.

Sorts the elements in this container and returns this container.

Annotations
@Override
streamback to summary
public Stream<KType> stream()

Implements com.carrotsearch.hppc.ObjectIndexedContainer.stream.

Doc from com.carrotsearch.hppc.ObjectIndexedContainer.stream.

Returns this container elements as a stream.

Annotations
@Override
@SuppressWarnings:unchecked
toArrayback to summary
public Object[] toArray()

Overrides com.carrotsearch.hppc.AbstractObjectCollection.toArray.

Implements com.carrotsearch.hppc.ObjectContainer.toArray.

Doc from com.carrotsearch.hppc.ObjectContainer.toArray.

Copies all elements of this container to an array.

The returned array is always a copy, regardless of the storage used by the container.

The returned array is sized to match exactly the number of elements of the stack.

Annotations
@Override
trimToSizeback to summary
public void trimToSize()

Trim the internal buffer to the current size.

com.carrotsearch.hppc back to summary

pack-priv final Class ObjectArrayList.ValueIterator<KType>

extends AbstractIterator<ObjectCursor<KType>>
Class Inheritance

An iterator implementation for ObjectArrayList#iterator.

Field Summary

Modifier and TypeField and Description
private final KType[]
private final ObjectCursor<KType>
private final int

Constructor Summary

AccessConstructor and Description
public
ValueIterator(KType[] buffer, int size)

Method Summary

Modifier and TypeMethod and Description
protected ObjectCursor<KType>
fetch()

Implements abstract com.carrotsearch.hppc.AbstractIterator.fetch.

Fetch next element.

Inherited from com.carrotsearch.hppc.AbstractIterator:
donehasNextnextremove

Field Detail

bufferback to summary
private final KType[] buffer
cursorback to summary
private final ObjectCursor<KType> cursor
sizeback to summary
private final int size

Constructor Detail

ValueIteratorback to summary
public ValueIterator(KType[] buffer, int size)

Method Detail

fetchback to summary
protected ObjectCursor<KType> fetch()

Implements abstract com.carrotsearch.hppc.AbstractIterator.fetch.

Doc from com.carrotsearch.hppc.AbstractIterator.fetch.

Fetch next element. The implementation must return done() when all elements have been fetched.

Returns:ObjectCursor<KType>

Returns the next value for the iterator or chain-calls done().

Annotations
@Override