|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.samskivert.util.CompactIntListUtil
public class CompactIntListUtil
This class manages compact arrays of ints. It is similar to 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 Summary | |
|---|---|
CompactIntListUtil()
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CompactIntListUtil()
| Method Detail |
|---|
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)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||