public abstract class ListUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <T> void |
move(List<T> list,
int[] indexes,
int offset)
Moves some indexes of a list up or down.
|
static <T> void |
move(List<T> list,
int index,
int offset)
Moves a list element with a specified offset.
|
public static <T> void move(List<T> list, int[] indexes, int offset)
T
- The type of list elementslist
- The list where to move the elementsindexes
- The indexes of the elements to move (should be sorted in ascending order).offset
- the offset of the elements in the final list (example 1 to move elements 1 position down, -1 for one position up).public static <T> void move(List<T> list, int index, int offset)
T
- The type of list elementslist
- The list where to move the elementsindex
- The index of the element to move.offset
- the offset of the elements in the final list (example 1 to move elements 1 position down, -1 for one position up).Copyright © 2022. All rights reserved.