-
- All Implemented Interfaces:
-
io.github.millibyte1.array64.Array64
,io.github.millibyte1.array64.IntArray64
,kotlin.collections.Iterable
public class FastIntArray64 implements IntArray64
A 64-bit-indexed byte array with an interface mirroring that of the standard library class IntArray.
Internally uses a 2D array and the FastUtil BigArrays library.
-
-
Constructor Summary
Constructors Constructor Description FastIntArray64(Long size)
Creates a new array of the specified size, with all elements initialized to zero. FastIntArray64(Long size, Function1<Long, Integer> init)
Creates a new array of the specified size, with all elements initialized according to the given init function. FastIntArray64(FastIntArray64 array)
Creates a copy of the given array. FastIntArray64(Array<IntArray> array, Boolean copy)
Creates a new array from the given 2D array, either by copying its contents or simply wrapping it. FastIntArray64(Array<IntArray> array)
Creates a new array from the given 2D array, either by copying its contents or simply wrapping it. FastIntArray64(IntArray array, Boolean copy)
Creates a new array from the given standard library array, either by copying its contents or simply wrapping it. FastIntArray64(IntArray array)
Creates a new array from the given standard library array, either by copying its contents or simply wrapping it.
-
Method Summary
Modifier and Type Method Description Long
size()
The number of elements in this array. FastIntArray64
copy()
Produces a shallow copy of this array. Integer
get(Long index)
Returns the element at the given index. Unit
set(Long index, Integer value)
Sets the element at the given index to the given value. IntArray64Iterator
iterator(Long index)
Returns an iterator to the element at the given index. IntArray64Iterator
iterator()
Returns an iterator to the first element in this array. Boolean
equals(Object other)
Integer
hashCode()
-
-
Constructor Detail
-
FastIntArray64
FastIntArray64(Long size)
Creates a new array of the specified size, with all elements initialized to zero.
-
FastIntArray64
FastIntArray64(Long size, Function1<Long, Integer> init)
Creates a new array of the specified size, with all elements initialized according to the given init function.
-
FastIntArray64
FastIntArray64(FastIntArray64 array)
Creates a copy of the given array.- Parameters:
array
- the array in question
-
FastIntArray64
FastIntArray64(Array<IntArray> array, Boolean copy)
Creates a new array from the given 2D array, either by copying its contents or simply wrapping it.- Parameters:
array
- the array in questioncopy
- whether to copy (true) the array or directly use it as the internal array (false)
-
FastIntArray64
FastIntArray64(Array<IntArray> array)
Creates a new array from the given 2D array, either by copying its contents or simply wrapping it.- Parameters:
array
- the array in question
-
FastIntArray64
FastIntArray64(IntArray array, Boolean copy)
Creates a new array from the given standard library array, either by copying its contents or simply wrapping it.- Parameters:
array
- the array in questioncopy
- whether to copy (true) the array or directly use it as the internal array (false)
-
FastIntArray64
FastIntArray64(IntArray array)
Creates a new array from the given standard library array, either by copying its contents or simply wrapping it.- Parameters:
array
- the array in question
-
-
Method Detail
-
copy
FastIntArray64 copy()
Produces a shallow copy of this array.
-
get
Integer get(Long index)
Returns the element at the given index. This method can be called using the index operator.
-
iterator
IntArray64Iterator iterator(Long index)
Returns an iterator to the element at the given index.
-
iterator
IntArray64Iterator iterator()
Returns an iterator to the first element in this array.
-
-
-
-