public class CompactIntListUtil extends Object
IntListUtil
except that the int arrays never contain empty slots and
expansion is done one element at a time. In spite of its reduced
computational efficiency, compact int lists are at times required.Constructor and Description |
---|
CompactIntListUtil() |
Modifier and Type | Method and Description |
---|---|
static int[] |
add(int[] list,
int value)
Adds the specified value to the list iff it is not already in the
list.
|
static boolean |
contains(int[] list,
int value)
Looks for an element that is equal to the supplied value.
|
static int |
indexOf(int[] list,
int value)
Looks for an element that is equal to the supplied value and
returns its index in the array.
|
static int[] |
remove(int[] list,
int value)
Removes the first value that is equal to the supplied value.
|
static int[] |
removeAt(int[] list,
int index)
Removes the value at the specified index.
|
public static int[] add(int[] list, int value)
list
- the list to which to add the value. Can be null.value
- the value to add.public static boolean contains(int[] list, int value)
public static int indexOf(int[] list, int value)
public static int[] remove(int[] list, int value)
public static int[] removeAt(int[] list, int index)
Copyright © 2015. All rights reserved.