public class ArrayUtil extends Object
Constructor and Description |
---|
ArrayUtil() |
Modifier and Type | Method and Description |
---|---|
static com.carrotsearch.hppc.IntArrayList |
constant(int size,
int value)
Creates an IntArrayList of a given size where each element is set to the given value
|
static com.carrotsearch.hppc.IntArrayList |
iota(int size)
Creates an IntArrayList filled with the integers 0,1,2,3,...,size-1
|
static com.carrotsearch.hppc.IntArrayList |
permutation(int size,
Random rnd)
Creates an IntArrayList filled with a permutation of the numbers 0,1,2,...,size-1
|
static com.carrotsearch.hppc.IntIndexedContainer |
removeConsecutiveDuplicates(com.carrotsearch.hppc.IntIndexedContainer arr)
Creates a copy of the given list where all consecutive duplicates are removed
|
static com.carrotsearch.hppc.IntArrayList |
reverse(com.carrotsearch.hppc.IntArrayList list)
Reverses the order of the given list's elements in place and returns it
|
static com.carrotsearch.hppc.IntArrayList |
shuffle(com.carrotsearch.hppc.IntArrayList list,
Random random)
Shuffles the elements of the given list in place and returns it
|
public static com.carrotsearch.hppc.IntArrayList constant(int size, int value)
public static com.carrotsearch.hppc.IntArrayList iota(int size)
public static com.carrotsearch.hppc.IntArrayList permutation(int size, Random rnd)
public static com.carrotsearch.hppc.IntArrayList reverse(com.carrotsearch.hppc.IntArrayList list)
public static com.carrotsearch.hppc.IntArrayList shuffle(com.carrotsearch.hppc.IntArrayList list, Random random)
public static com.carrotsearch.hppc.IntIndexedContainer removeConsecutiveDuplicates(com.carrotsearch.hppc.IntIndexedContainer arr)
Copyright © 2012–2021. All rights reserved.