public class ListUtils
extends java.lang.Object
Constructor and Description |
---|
ListUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
arrayListHashCode(ArrayList<?> list)
Get the "deep" hash code for an ArrayList, by combining hash codes of elements in the list.
|
static boolean |
arrayListsEqual(ArrayList<?> list1,
ArrayList<?> list2)
See if two ArrayLists are the same.
|
static <E> ArrayList<E> |
distinctElements(List<E> list)
Return a list of all distinct elements in the list, removing any duplicates.
|
public static boolean arrayListsEqual(ArrayList<?> list1, ArrayList<?> list2)
list1
- 1st ArrayListlist2
- 2nd ArrayListpublic static int arrayListHashCode(ArrayList<?> list)
list
- list to compute hashCode ofpublic static <E> ArrayList<E> distinctElements(List<E> list)
E
- list element typelist
- list to remove duplicates from