|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet
common.HashSetDiff
public class HashSetDiff
Implementation of SetDiff that uses hash sets to store additions and removals.
| Constructor Summary | |
|---|---|
HashSetDiff(java.util.Set underlying)
Creates a new HashSetDiff with the given underlying set. |
|
HashSetDiff(java.util.Set underlying,
boolean maintainOrder)
Creates a new HashSetDiff with the given underlying set. |
|
| Method Summary | |
|---|---|
boolean |
add(java.lang.Object o)
|
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.lang.Object |
clone()
Returns a shallow copy of this set diff, expressed relative to the same underlying set. |
boolean |
contains(java.lang.Object o)
|
protected java.util.Set |
copySet(java.util.Set orig)
|
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. |
java.util.Iterator |
iterator()
|
protected java.util.Set |
newSet()
|
boolean |
remove(java.lang.Object o)
|
int |
size()
|
| Methods inherited from class java.util.AbstractSet |
|---|
equals, hashCode, removeAll |
| Methods inherited from class java.util.AbstractCollection |
|---|
addAll, clear, containsAll, isEmpty, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
addAll, clear, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public HashSetDiff(java.util.Set underlying)
public HashSetDiff(java.util.Set underlying,
boolean maintainOrder)
maintainOrder is true, then this instance will use
LinkedHashSets to keep the order of iteration predictable.
| Method Detail |
|---|
public int size()
size in interface java.util.Collectionsize in interface java.util.Setsize in class java.util.AbstractCollectionpublic boolean contains(java.lang.Object o)
contains in interface java.util.Collectioncontains in interface java.util.Setcontains in class java.util.AbstractCollectionpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Setiterator in class java.util.AbstractCollectionpublic boolean add(java.lang.Object o)
add in interface java.util.Collectionadd in interface java.util.Setadd in class java.util.AbstractCollectionpublic boolean remove(java.lang.Object o)
remove in interface java.util.Collectionremove in interface java.util.Setremove in class java.util.AbstractCollectionpublic java.util.Set getAdditions()
SetDiff
getAdditions in interface SetDiffpublic java.util.Set getRemovals()
SetDiff
getRemovals in interface SetDiffpublic void changeUnderlying()
SetDiff
changeUnderlying in interface SetDiffpublic void clearChanges()
SetDiff
clearChanges in interface SetDiffpublic java.lang.Object clone()
clone in class java.lang.Objectprotected java.util.Set newSet()
protected java.util.Set copySet(java.util.Set orig)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||