public class ListUtils
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ListUtils.RandomRemoveResult<E> |
| Constructor and Description |
|---|
ListUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <E> E |
removeBySwapLast(java.util.List<E> a,
int idx)
Removes element by index from List by swapping with last element.
|
static <E> boolean |
removeBySwapLast(java.util.List<E> a,
java.lang.Object o)
Removes element from List by swapping with last element.
|
static <E> ListUtils.RandomRemoveResult<E> |
removeRandomBySwapLast(java.util.Random random,
java.util.List<E> a)
Removes random element from List by swapping with last element.
|
static <E> E |
removeRandomBySwapLastSimple(java.util.Random random,
java.util.List<E> a)
Removes random element from List by swapping with last element.
|
public static <E> boolean removeBySwapLast(java.util.List<E> a,
java.lang.Object o)
true if element was removed.public static <E> E removeBySwapLast(java.util.List<E> a,
int idx)
java.lang.IndexOutOfBoundsException - if idx is not valid index
WARNING: Don't dare to break this method contract!public static <E> ListUtils.RandomRemoveResult<E> removeRandomBySwapLast(java.util.Random random, java.util.List<E> a)
public static <E> E removeRandomBySwapLastSimple(java.util.Random random,
java.util.List<E> a)