Package com.tangosol.util
Class ImmutableMultiList.ListView
java.lang.Object
com.tangosol.util.WrapperCollections.AbstractWrapperCollection
com.tangosol.util.WrapperCollections.AbstractWrapperList
com.tangosol.util.ImmutableMultiList.ListView
- All Implemented Interfaces:
Serializable
,Iterable
,Collection
,List
,SequencedCollection
- Enclosing class:
ImmutableMultiList
ListView exposes the underlying ImmutableMultiList through the
List
interface, maintaining correct equals() and
hashCode() semantics- See Also:
-
Field Summary
Fields inherited from class com.tangosol.util.WrapperCollections.AbstractWrapperCollection
m_colDelegate
-
Constructor Summary
ModifierConstructorDescriptionprotected
ListView()
Create a ListView over this ImmutableMultiList. -
Method Summary
Methods inherited from class com.tangosol.util.WrapperCollections.AbstractWrapperList
add, addAll, get, getDelegate, indexOf, lastIndexOf, listIterator, listIterator, remove, replaceAll, set, sort, subList
Methods inherited from class com.tangosol.util.WrapperCollections.AbstractWrapperCollection
add, addAll, clear, contains, containsAll, forEach, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Constructor Details
-
ListView
protected ListView()Create a ListView over this ImmutableMultiList.
-
-
Method Details
-
equals
Compares the specified object with this list for equality. Returns true if and only if the specified object is also a list, both lists have the same size, and all corresponding pairs of elements in the two lists are equal. (Two elements e1 and e2 are equal if (e1==null ? e2==null : e1.equals(e2)).) In other words, two lists are defined to be equal if they contain the same elements in the same order. This definition ensures that the equals method works properly across different implementations of the List interface.- Specified by:
equals
in interfaceCollection
- Specified by:
equals
in interfaceList
- Overrides:
equals
in classWrapperCollections.AbstractWrapperCollection
- Parameters:
o
- the object to be compared for equality with this list.- Returns:
- true if the specified object is equal to this list.
-
hashCode
public int hashCode()Returns the hash code value for this list. The hash code of a list is defined to be the result of the following calculation: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.- Specified by:
hashCode
in interfaceCollection
- Specified by:
hashCode
in interfaceList
- Overrides:
hashCode
in classWrapperCollections.AbstractWrapperCollection
- Returns:
- the hash code value for this list.
- See Also:
-