Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


com.tangosol.util
Class ImmutableMultiList.ListView

java.lang.Object
  extended by com.tangosol.util.WrapperCollections.AbstractWrapperCollection
      extended by com.tangosol.util.WrapperCollections.AbstractWrapperList
          extended by com.tangosol.util.ImmutableMultiList.ListView

All Implemented Interfaces:
java.lang.Iterable, java.util.Collection, java.util.List
Enclosing class:
ImmutableMultiList

protected class ImmutableMultiList.ListView
extends WrapperCollections.AbstractWrapperList

ListView exposes the underlying ImmutableMultiList through the List interface, maintaining correct equals() and hashCode() semantics


Field Summary

 

Fields inherited from class com.tangosol.util.WrapperCollections.AbstractWrapperList
m_listDelegate

 

Fields inherited from class com.tangosol.util.WrapperCollections.AbstractWrapperCollection
m_colDelegate

 

Constructor Summary
protected ImmutableMultiList.ListView()
          Create a ListView over this ImmutableMultiList.

 

Method Summary
 boolean equals(java.lang.Object o)
          Compares the specified object with this list for equality.
 int hashCode()
          Returns the hash code value for this list.

 

Methods inherited from class com.tangosol.util.WrapperCollections.AbstractWrapperList
add, addAll, get, getDelegate, indexOf, lastIndexOf, listIterator, listIterator, remove, set, subList

 

Methods inherited from class com.tangosol.util.WrapperCollections.AbstractWrapperCollection
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString

 

Methods inherited from interface java.util.List
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray

 

Constructor Detail

ImmutableMultiList.ListView

protected ImmutableMultiList.ListView()
Create a ListView over this ImmutableMultiList.

Method Detail

equals

public boolean equals(java.lang.Object o)
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 interface java.util.Collection
Specified by:
equals in interface java.util.List
Overrides:
equals in class WrapperCollections.AbstractWrapperCollection
Parameters:
o - the object to be compared for equality with this list.
Returns:
true if the specified object is equal to this list.
See Also:
Object.equals(Object), Set.equals(Object), List.equals(Object)

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 interface java.util.Collection
Specified by:
hashCode in interface java.util.List
Overrides:
hashCode in class WrapperCollections.AbstractWrapperCollection
Returns:
the hash code value for this list.
See Also:
Object.hashCode(), Object.equals(Object), equals(Object)

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.