protected class ImmutableMultiList.ListView
extends com.oracle.common.collections.WrapperCollections.AbstractWrapperList
List interface, maintaining correct equals() and hashCode() semantics| Modifier | Constructor and Description |
|---|---|
protected |
ListView()
Create a ListView over this ImmutableMultiList.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o)
Compares the specified object with this list for equality.
|
int |
hashCode()
Returns the hash code value for this list.
|
add, addAll, get, getDelegate, indexOf, lastIndexOf, listIterator, listIterator, remove, replaceAll, set, sort, subListadd, addAll, clear, contains, containsAll, forEach, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, spliterator, toArray, toArrayparallelStream, removeIf, streampublic boolean equals(Object o)
equals in interface Collectionequals in interface Listequals in class com.oracle.common.collections.WrapperCollections.AbstractWrapperCollectiono - the object to be compared for equality with this list.public int hashCode()
hashCode = 1;
Iterator i = list.iterator();
while (i.hasNext()) {
Object obj = i.next();
hashCode = 31*hashCode + (obj==null ? 0 : obj.hashCode());
}
This ensures that list1.equals(list2) implies that list1.hashCode()==list2.hashCode() for any two lists, list1 and list2, as required by the general contract of Object.hashCode.hashCode in interface CollectionhashCode in interface ListhashCode in class com.oracle.common.collections.WrapperCollections.AbstractWrapperCollectionObject.hashCode(), Object.equals(Object), equals(Object)