|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-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.WrapperCollections.AbstractWrapperSortedSet
com.tangosol.util.ImmutableArrayList.SortedSetView
protected class ImmutableArrayList.SortedSetView
SetView exposes the underlying ImmutableArrayList through the SortedSet
interface, maintaining correct equals() and hashCode() semantics
Field Summary |
---|
Fields inherited from class com.tangosol.util.WrapperCollections.AbstractWrapperCollection |
---|
m_colDelegate |
Constructor Summary | |
---|---|
protected |
ImmutableArrayList.SortedSetView() Create a SortedSetView over this ImmutableArrayList. |
Method Summary | |
---|---|
boolean |
equals(Object o) Compares the specified object with this collection for equality. 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.) |
int |
hashCode() Returns the hash code value for this collection. While the Collection interface adds no stipulations to the general contract for the Object.hashCode method, programmers should take note that any class that overrides the Object.equals method must also override the Object.hashCode method in order to satisfy the general contract for the Object.hashCodemethod. In particular, c1.equals(c2) implies that c1.hashCode()==c2.hashCode(). |
String |
toString() |
Methods inherited from class com.tangosol.util.WrapperCollections.AbstractWrapperSortedSet |
---|
comparator, first, getDelegate, headSet, last, subSet, tailSet |
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.SortedSetView()
Method Detail |
---|
public boolean equals(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 Collection
equals
in interface 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 Collection
hashCode
in interface Set
hashCode
in class WrapperCollections.AbstractWrapperCollection
Object.hashCode()
, Object.equals(Object)
public String toString()
|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |