Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-01


com.tangosol.util
Class UnsafeSubSet

java.lang.Object
  extended by java.util.AbstractCollection
      extended by java.util.AbstractSet
          extended by com.tangosol.util.SubSet
              extended by com.tangosol.util.UnsafeSubSet

All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.Set

public class UnsafeSubSet
extends SubSet

The UnsafeSubSet is a SubSet which assumes that the backing set already contains all of the keys that would be retained or removed.

This could be used for indexes (as an example), since all indexed keys also must be contained in the backing map.

Since:
Coherence 3.7.2
Author:
coh 2011.06.02

Nested Class Summary
protected static class UnsafeSubSet.WrapperSet
          The WrapperSet wraps a Set to provide a hook for initialization.

 

Nested classes/interfaces inherited from class com.tangosol.util.SubSet
SubSet.SubSetIterator

 

Constructor Summary
UnsafeSubSet(java.util.Set set)
          Construct this set based on the assigned set.

 

Method Summary
 UnsafeSubSet.WrapperSet getOriginal()
          Determine what items were in the original set.
 boolean isModified()
          Determine if the set has been modified.
 boolean removeAll(java.util.Collection col)
          Removes all this collection's elements that are also contained in the specified collection (optional operation).
 void reset()
          Discard the changes to the set ("rollback").
 void resolve()
          Apply the changes to the underlying set ("commit").
 boolean retainAll(java.util.Collection col)
          Retains only the elements in this collection that are contained in the specified collection (optional operation).

 

Methods inherited from class com.tangosol.util.SubSet
add, addAll, clear, clone, contains, containsAll, ensureRemoved, ensureRetained, getRemoved, getRetained, isEmpty, isTrackingRemoved, isTrackingRetained, iterator, remove, resetState, size, toArray, toArray

 

Methods inherited from class java.util.AbstractSet
equals, hashCode

 

Methods inherited from class java.util.AbstractCollection
toString

 

Constructor Detail

UnsafeSubSet

public UnsafeSubSet(java.util.Set set)
Construct this set based on the assigned set.
Parameters:
set - the WrapperSet to base this StableSubSet on

Method Detail

getOriginal

public UnsafeSubSet.WrapperSet getOriginal()
Determine what items were in the original set.
Overrides:
getOriginal in class SubSet
Returns:
the set used to construct this SubSet

resolve

public void resolve()
Apply the changes to the underlying set ("commit").
Overrides:
resolve in class SubSet

isModified

public boolean isModified()
Determine if the set has been modified.
Overrides:
isModified in class SubSet
Returns:
true if any items have been removed

reset

public void reset()
Discard the changes to the set ("rollback").
Overrides:
reset in class SubSet

removeAll

public boolean removeAll(java.util.Collection col)
Removes all this collection's elements that are also contained in the specified collection (optional operation). After this call returns, this collection will contain no elements in common with the specified collection.
Specified by:
removeAll in interface java.util.Collection
Specified by:
removeAll in interface java.util.Set
Overrides:
removeAll in class SubSet
Parameters:
col - elements to be removed from this collection
Returns:
true if this collection changed as a result of the call
See Also:
AbstractCollection.remove(Object), AbstractCollection.contains(Object)

retainAll

public boolean retainAll(java.util.Collection col)
Retains only the elements in this collection that are contained in the specified collection (optional operation). In other words, removes from this collection all of its elements that are not contained in the specified collection.
Specified by:
retainAll in interface java.util.Collection
Specified by:
retainAll in interface java.util.Set
Overrides:
retainAll in class SubSet
Parameters:
col - elements to be retained in this collection.
Returns:
true if this collection changed as a result of the call
See Also:
AbstractCollection.remove(Object), AbstractCollection.contains(Object)

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-01


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