public class DeltaSet extends AbstractSet implements Cloneable, Serializable
| Modifier and Type | Class and Description |
|---|---|
protected class |
DeltaSet.DeltaIterator
Iterator for the contents of a delta set.
|
| Constructor and Description |
|---|
DeltaSet(Set set)
Construct this set based on an existing set.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Object o)
Ensures that this Collection contains the specified element.
|
void |
clear()
Removes all of the elements from this Collection.
|
Object |
clone()
Clone the delta set.
|
boolean |
contains(Object o)
Returns true if this Collection contains the specified element.
|
protected Set |
ensureAdded()
Get a mutable set of items that were added to the delta set.
|
protected Set |
ensureRemoved()
Get a mutable set of items that were removed from the delta set.
|
Set |
getAdded()
Determine what items were added to the delta set.
|
Set |
getOriginal()
Determine what items were in the original set.
|
Set |
getRemoved()
Determine what items were removed from the delta set.
|
boolean |
isModified()
Determine if any items were added or removed.
|
Iterator |
iterator()
Returns an Iterator over the elements contained in this Collection.
|
boolean |
remove(Object o)
Removes a single instance of the specified element from this Collection, if it is present (optional operation).
|
void |
reset()
Discard the changes to the set ("rollback").
|
void |
resolve()
Apply the changes to the underlying set ("commit").
|
int |
size()
Returns the number of elements in this Collection.
|
Object[] |
toArray()
Returns an array containing all of the elements in this Set.
|
equals, hashCode, removeAlladdAll, containsAll, isEmpty, retainAll, toArray, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitaddAll, containsAll, isEmpty, retainAll, spliterator, toArrayparallelStream, removeIf, streampublic DeltaSet(Set set)
set - the set to base this delta set onpublic Set getOriginal()
public boolean isModified()
public Set getAdded()
public Set getRemoved()
protected Set ensureAdded()
protected Set ensureRemoved()
public void resolve()
public void reset()
public Iterator iterator()
iterator in interface Iterableiterator in interface Collectioniterator in interface Setiterator in class AbstractCollectionpublic int size()
size in interface Collectionsize in interface Setsize in class AbstractCollectionpublic boolean contains(Object o)
e such that (o==null ? e==null : o.equals(e)).contains in interface Collectioncontains in interface Setcontains in class AbstractCollectiono - the object to search for in the setpublic boolean add(Object o)
add in interface Collectionadd in interface Setadd in class AbstractCollectiono - element whose presence in this Collection is to be ensuredpublic boolean remove(Object o)
e such that (o==null ? e==null : o.equals(e)), if the Collection contains one or more such elements. Returns true if the Collection contained the specified element (or equivalently, if the Collection changed as a result of the call).remove in interface Collectionremove in interface Setremove in class AbstractCollectiono - element to be removed from this Collection, if presentpublic void clear()
clear in interface Collectionclear in interface Setclear in class AbstractCollectionpublic Object[] toArray()
toArray in interface CollectiontoArray in interface SettoArray in class AbstractCollection