common
Interface SetDiff

All Superinterfaces:
java.util.Collection, java.lang.Iterable, java.util.Set
All Known Subinterfaces:
IndexedSetDiff
All Known Implementing Classes:
HashSetDiff, IndexedHashSetDiff, IndexedTreeSetDiff

public interface SetDiff
extends java.util.Set

Interface for sets that are represented in terms of additions and removals relative to an underlying set.

A SetDiff should still behave correctly if objects are added to the underlying set after the SetDiff is created, as long as the objects have not also been added to the SetDiff (then they may be double-counted). Removals from the underlying set may invalidate a SetDiff.


Method Summary
 void changeUnderlying()
          Changes the underlying set so it's equal to this set.
 void clearChanges()
          Changes this set so it's equal to the underlying set.
 java.util.Set getAdditions()
          Returns the set of objects that are in this set and not in the underlying set.
 java.util.Set getRemovals()
          Returns the set of objects that are in the underlying set but not in this set.
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Method Detail

getAdditions

java.util.Set getAdditions()
Returns the set of objects that are in this set and not in the underlying set.

Returns:
unmodifiable Set of objects

getRemovals

java.util.Set getRemovals()
Returns the set of objects that are in the underlying set but not in this set.


changeUnderlying

void changeUnderlying()
Changes the underlying set so it's equal to this set.


clearChanges

void clearChanges()
Changes this set so it's equal to the underlying set.