public class TrackableSet<E> extends HashSet<E> implements TrackableCollectionIF<E>
Modifier and Type | Field and Description |
---|---|
protected Set<E> |
added |
protected Set<E> |
removed |
protected TransactionIF |
txn |
Constructor and Description |
---|
TrackableSet(TransactionIF txn,
Collection<E> coll) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(E o) |
boolean |
addAll(Collection<? extends E> c) |
boolean |
addWithTracking(E _o)
INTERNAL: Adds the item to the collection tracking the change.
|
void |
clear() |
void |
clearWithTracking()
INTERNAL: Removes all items from the collection tracking the
changes.
|
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
void |
dump() |
Collection<E> |
getAdded()
INTERNAL: Gets the objects that have been added to the set.
|
Collection<E> |
getRemoved()
INTERNAL: Gets the objects that have been removed from the
set.
|
Iterator<E> |
iterator() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
removeWithTracking(E _o)
INTERNAL: Removes the item from the collection tracking the
change.
|
void |
resetTracking()
INTERNAL: Clears the list of added and removed objects without
touching the original collection.
|
boolean |
retainAll(Collection<?> c) |
void |
selfAdded()
INTERNAL: Consider existing collection elements as having just
been added.
|
Spliterator<E> |
spliterator() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
equals, hashCode
toString
finalize, getClass, notify, notifyAll, wait, wait, wait
equals, hashCode, isEmpty, parallelStream, removeIf, size, stream
protected TransactionIF txn
public TrackableSet(TransactionIF txn, Collection<E> coll)
public void dump()
public void resetTracking()
TrackableCollectionIF
resetTracking
in interface TrackableCollectionIF<E>
public void selfAdded()
TrackableCollectionIF
selfAdded
in interface TrackableCollectionIF<E>
public Collection<E> getAdded()
TrackableCollectionIF
getAdded
in interface TrackableCollectionIF<E>
public Collection<E> getRemoved()
TrackableCollectionIF
getRemoved
in interface TrackableCollectionIF<E>
public boolean addWithTracking(E _o)
TrackableCollectionIF
addWithTracking
in interface TrackableCollectionIF<E>
public boolean removeWithTracking(E _o)
TrackableCollectionIF
removeWithTracking
in interface TrackableCollectionIF<E>
public void clearWithTracking()
TrackableCollectionIF
clearWithTracking
in interface TrackableCollectionIF<E>
public void clear()
public boolean add(E o)
public boolean addAll(Collection<? extends E> c)
addAll
in interface Collection<E>
addAll
in interface Set<E>
addAll
in class AbstractCollection<E>
public boolean remove(Object o)
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<E>
removeAll
in interface Set<E>
removeAll
in class AbstractSet<E>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<E>
retainAll
in interface Set<E>
retainAll
in class AbstractCollection<E>
public boolean contains(Object o)
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<E>
containsAll
in interface Set<E>
containsAll
in class AbstractCollection<E>
public Object[] toArray()
toArray
in interface Collection<E>
toArray
in interface Set<E>
toArray
in class AbstractCollection<E>
public <T> T[] toArray(T[] a)
toArray
in interface Collection<E>
toArray
in interface Set<E>
toArray
in class AbstractCollection<E>
public Spliterator<E> spliterator()
spliterator
in interface Iterable<E>
spliterator
in interface Collection<E>
spliterator
in interface Set<E>
spliterator
in class HashSet<E>