Stay organized with collections
Save and categorize content based on your preferences.
@UnstableApi
class LongArray
An append-only, auto-growing long[].
Summary
Public functions |
Unit |
Appends a value.
|
Unit |
Appends all elements of the specified array.
|
Long |
Returns the value at a specified index.
|
Int |
Returns the current size of the array.
|
LongArray<Long>! |
Copies the current values into a newly allocated primitive array.
|
Public constructors
LongArray(initialCapacity: Int)
| Parameters |
initialCapacity: Int |
The initial capacity of the array.
|
Public functions
fun add(value: Long): Unit
Appends a value.
| Parameters |
value: Long |
The value to append.
|
fun addAll(values: LongArray!): Unit
Appends all elements of the specified array.
| Parameters |
values: LongArray! |
The array whose elements are to be added.
|
fun get(index: Int): Long
Returns the value at a specified index.
| Parameters |
index: Int |
The index.
|
| Returns |
Long |
The corresponding value.
|
fun size(): Int
Returns the current size of the array.
fun toArray(): LongArray<Long>!
Copies the current values into a newly allocated primitive array.
| Returns |
LongArray<Long>! |
The primitive array containing the copied values.
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-05-15 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-15 UTC."],[],[]]