LongArrayList

An array-backed list of long.

Mostly forked and trimmed from com.carrotsearch.hppc.LongArrayList

github: https://github.com/carrotsearch/hppc release 0.10.0

Constructors

Link copied to clipboard
constructor(expectedElements: Int)
constructor()

New instance with sane defaults.

constructor(list: LongArrayList)

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

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

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

Link copied to clipboard

Returns nested resources of this class. The result should be a point-in-time snapshot (to avoid race conditions).

Link copied to clipboard

Current number of elements stored in .buffer.

Link copied to clipboard

Functions

Link copied to clipboard
fun add(e1: Long)

fun add(vararg elements: Long)

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

fun add(elements: LongArray, start: Int, length: Int)

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

Link copied to clipboard
fun addAll(iterable: Iterable<LongCursor>): Int

Adds all elements from another iterable.

Adds all elements from another list.

Link copied to clipboard

Returns a sequence of all the elements contained in this list.

Link copied to clipboard
fun 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.

Link copied to clipboard
open override fun clone(): LongArrayList

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

Link copied to clipboard
Link copied to clipboard
fun ensureCapacity(expectedElements: Int)

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

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

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

Link copied to clipboard
fun get(index: Int): Long
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun indexOf(e1: Long): Int
Link copied to clipboard
fun insert(index: Int, e1: Long)
Link copied to clipboard
open operator override fun iterator(): MutableIterator<LongCursor>
Link copied to clipboard
fun lastIndexOf(e1: Long): Int
Link copied to clipboard
open override fun ramBytesUsed(): Long

Return the memory usage of this object in bytes. Negative values are illegal.

Link copied to clipboard
fun release()

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

Link copied to clipboard
fun removeAll(e: Long): Int

Removes all occurrences of e from this collection.

Link copied to clipboard
fun removeAt(index: Int): Long

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

Link copied to clipboard

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

Link copied to clipboard
fun removeFirst(e1: Long): Int

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

Link copied to clipboard

Removes and returns the last element of this list.

fun removeLast(e1: Long): Int

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

Link copied to clipboard
fun removeRange(fromIndex: Int, toIndex: Int)

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

Link copied to clipboard
fun resize(newSize: Int)

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).

Link copied to clipboard

Reverses the elements in this list and returns this list.

Link copied to clipboard
fun set(index: Int, e1: Long): Long
Link copied to clipboard
fun size(): Int
Link copied to clipboard

Sorts the elements in this list and returns this list.

Link copied to clipboard

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

Link copied to clipboard
open override fun toString(): String

Convert the contents of this list to a human-friendly string.

Link copied to clipboard

Trim the internal buffer to the current size.