protected class ImmutableMultiList.ListView extends WrapperCollections.AbstractWrapperList
List
interface, maintaining correct equals() and
hashCode() semanticsm_colDelegate
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, subList
add, addAll, clear, contains, containsAll, forEach, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, spliterator, toArray, toArray
parallelStream, removeIf, stream
public boolean equals(Object o)
equals
in interface Collection
equals
in interface List
equals
in class WrapperCollections.AbstractWrapperCollection
o
- 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 Collection
hashCode
in interface List
hashCode
in class WrapperCollections.AbstractWrapperCollection
Object.hashCode()
,
Object.equals(Object)
,
equals(Object)