public class ListReorderer extends Object
| Constructor and Description |
|---|
ListReorderer() |
| Modifier and Type | Method and Description |
|---|---|
static <T> boolean |
allElementsInBack(List<T> sourceList,
List<T> checkList) |
static <T> boolean |
allElementsInFront(List<T> sourceList,
List<T> checkList)
Returns true if all the elements of the check list are at the end of the source list.
|
static <T> int[] |
getIndices(List<T> sourceList,
List<T> objectsToMove)
This is mainly used for after doing a move.
|
static <T> void |
moveAfter(List<T> sourceList,
List<T> objectsToMove)
Moves the objects in the list up one index position in this list while maintaining their relative position.
|
static <T> boolean |
moveAfter(List<T> sourceList,
T object)
Moves the object up one index position in the list.
|
static <T> void |
moveBefore(List<T> sourceList,
List<T> objectsToMove)
Moves a list of elements in this list while keeping their relative positions.
|
static <T> boolean |
moveBefore(List<T> sourceList,
T object)
Moves the object down one position in the group list.
|
static <T> void |
moveTo(List<T> sourceList,
List<T> moveList,
int index)
Moves a list of objects to a new index location.
|
static <T> void |
moveToBack(List<T> sourceList,
List<T> objectsToMove)
Moves a list of objects to the front of the list.
|
static <T> boolean |
moveToBack(List<T> sourceList,
T object)
Moves an object to the back of the list.
|
static <T> void |
moveToFront(List<T> sourceList,
List<T> objectsToMove)
Moves a list of objects to the front of the list.
|
static <T> boolean |
moveToFront(List<T> sourceList,
T object)
Moves an object to the front of the list.
|
static <T> void |
sortMoveListByRelativeOrder(List<T> parentList,
List<T> childList)
Sorts a child list by position in a parent list to preserve relative ordering of the elements.
|
public static <T> boolean moveBefore(List<T> sourceList, T object)
sourceList - The list whose elements we want to reorder.object - The object to move.public static <T> void moveBefore(List<T> sourceList, List<T> objectsToMove)
sourceList - The list whose elements we want to reorder.objectsToMove - List of elements to move.public static <T> void moveTo(List<T> sourceList, List<T> moveList, int index)
sourceList - The list where the move will occur.moveList - The objects to move.index - The object's new location in the list.public static <T> boolean moveToFront(List<T> sourceList, T object)
sourceList - The list the object is in.object - The object to move.public static <T> void moveToFront(List<T> sourceList, List<T> objectsToMove)
sourceList - The list the object is in.objectsToMove - The object to move.public static <T> boolean moveAfter(List<T> sourceList, T object)
sourceList - The list whose elements we want to reorder.object - The object to move.public static <T> void moveAfter(List<T> sourceList, List<T> objectsToMove)
sourceList - The list whose elements we want to reorder.objectsToMove - List of elements to move.public static <T> boolean moveToBack(List<T> sourceList, T object)
sourceList - The list the object is in.object - The object to move.public static <T> void moveToBack(List<T> sourceList, List<T> objectsToMove)
sourceList - The list the object is in.objectsToMove - The object to move.public static <T> void sortMoveListByRelativeOrder(List<T> parentList, List<T> childList)
parentList - .childList - .public static <T> boolean allElementsInFront(List<T> sourceList, List<T> checkList)
sourceList - .checkList - .public static <T> boolean allElementsInBack(List<T> sourceList, List<T> checkList)
public static <T> int[] getIndices(List<T> sourceList, List<T> objectsToMove)
sourceList - the source listobjectsToMove - the elements to moveCopyright © 2013. All rights reserved