|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.WrapperCollections.AbstractWrapperCollection
com.tangosol.util.WrapperCollections.AbstractWrapperSet
com.tangosol.util.ImmutableArrayList.SetView
protected class ImmutableArrayList.SetView
SetView exposes the underlying ImmutableArrayList through the Set
interface, maintaining correct equals() and hashCode() semantics
Constructor Summary | |
---|---|
protected |
ImmutableArrayList.SetView() Create a SetView over this ImmutableArrayList. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o) Compares the specified object with this collection for equality. |
int |
hashCode() Returns the hash code value for this collection. |
java.lang.String |
toString() |
Methods inherited from class com.tangosol.util.WrapperCollections.AbstractWrapperSet |
---|
getDelegate |
Methods inherited from class com.tangosol.util.WrapperCollections.AbstractWrapperCollection |
---|
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Methods inherited from interface java.util.Set |
---|
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Constructor Detail |
---|
protected ImmutableArrayList.SetView()
Method Detail |
---|
public boolean equals(java.lang.Object o)
While the Collection interface adds no stipulations to the general contract for the Object.equals, programmers who implement the Collection interface "directly" (in other words, create a class that is a Collection but is not a Set or a List) must exercise care if they choose to override the Object.equals. It is not necessary to do so, and the simplest course of action is to rely on Object's implementation, but the implementer may wish to implement a "value comparison" in place of the default "reference comparison." (The List and Set interfaces mandate such value comparisons.)
The general contract for the Object.equals method states that equals must be symmetric (in other words, a.equals(b) if and only if b.equals(a)). The contracts for List.equals and Set.equals state that lists are only equal to other lists, and sets to other sets. Thus, a custom equals method for a collection class that implements neither the List nor Set interface must return false when this collection is compared to any list or set. (By the same logic, it is not possible to write a class that correctly implements both the Set and List interfaces.)
equals
in interface java.util.Collection
equals
in interface java.util.Set
equals
in class WrapperCollections.AbstractWrapperCollection
o
- Object to be compared for equality with this collection.Object.equals(Object)
, Set.equals(Object)
, List.equals(Object)
public int hashCode()
hashCode
in interface java.util.Collection
hashCode
in interface java.util.Set
hashCode
in class WrapperCollections.AbstractWrapperCollection
Object.hashCode()
, Object.equals(Object)
public java.lang.String toString()
toString
in class WrapperCollections.AbstractWrapperCollection
|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |