Package net.ontopia.persistence.proxy
Class TrackableLazySet<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.HashSet<E>
net.ontopia.persistence.proxy.TrackableLazySet<E>
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<E>,Collection<E>,Set<E>,TrackableCollectionIF<E>
INTERNAL: A set implementation that track the changes performed on
it. It keeps track of the objects that have been added and the ones
that has been removed. What makes this implementation different
from TrackableSet is that the field value is only loaded from the
storage when it is actually needed.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends E> c) booleanaddWithTracking(E _o) INTERNAL: Adds the item to the collection tracking the change.voidclear()voidINTERNAL: Removes all items from the collection tracking the changes.booleanbooleancontainsAll(Collection<?> c) voiddump()booleangetAdded()INTERNAL: Gets the objects that have been added to the set.INTERNAL: Gets the objects that have been removed from the set.inthashCode()booleanisEmpty()booleanisLoaded()iterator()protected voidbooleanbooleanremoveAll(Collection<?> c) booleanremoveWithTracking(E _o) INTERNAL: Removes the item from the collection tracking the change.voidINTERNAL: Clears the list of added and removed objects without touching the original collection.booleanretainAll(Collection<?> c) voidINTERNAL: Consider existing collection elements as having just been added.intsize()Object[]toArray()<T> T[]toArray(T[] a) Methods inherited from class java.util.AbstractCollection
toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Field Details
-
txn
-
identity
-
field
protected int field -
loaded
protected boolean loaded -
added
-
removed
-
-
Constructor Details
-
TrackableLazySet
-
-
Method Details
-
dump
public void dump() -
resetTracking
public void resetTracking()Description copied from interface:TrackableCollectionIFINTERNAL: Clears the list of added and removed objects without touching the original collection.- Specified by:
resetTrackingin interfaceTrackableCollectionIF<E>
-
selfAdded
public void selfAdded()Description copied from interface:TrackableCollectionIFINTERNAL: Consider existing collection elements as having just been added.- Specified by:
selfAddedin interfaceTrackableCollectionIF<E>
-
getAdded
Description copied from interface:TrackableCollectionIFINTERNAL: Gets the objects that have been added to the set. This collection is immutable. Null is returned if the added collection has not been initialized, ie. it is empty.- Specified by:
getAddedin interfaceTrackableCollectionIF<E>
-
getRemoved
Description copied from interface:TrackableCollectionIFINTERNAL: Gets the objects that have been removed from the set. This collection is immutable. Null is returned if the removed collection has not been initialized, ie. it is empty.- Specified by:
getRemovedin interfaceTrackableCollectionIF<E>
-
addWithTracking
Description copied from interface:TrackableCollectionIFINTERNAL: Adds the item to the collection tracking the change.- Specified by:
addWithTrackingin interfaceTrackableCollectionIF<E>
-
removeWithTracking
Description copied from interface:TrackableCollectionIFINTERNAL: Removes the item from the collection tracking the change.- Specified by:
removeWithTrackingin interfaceTrackableCollectionIF<E>
-
clearWithTracking
public void clearWithTracking()Description copied from interface:TrackableCollectionIFINTERNAL: Removes all items from the collection tracking the changes.- Specified by:
clearWithTrackingin interfaceTrackableCollectionIF<E>
-
clear
public void clear() -
add
-
addAll
- Specified by:
addAllin interfaceCollection<E>- Specified by:
addAllin interfaceSet<E>- Overrides:
addAllin classAbstractCollection<E>
-
remove
-
removeAll
- Specified by:
removeAllin interfaceCollection<E>- Specified by:
removeAllin interfaceSet<E>- Overrides:
removeAllin classAbstractSet<E>
-
retainAll
- Specified by:
retainAllin interfaceCollection<E>- Specified by:
retainAllin interfaceSet<E>- Overrides:
retainAllin classAbstractCollection<E>
-
iterator
-
contains
-
containsAll
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceSet<E>- Overrides:
containsAllin classAbstractCollection<E>
-
equals
- Specified by:
equalsin interfaceCollection<E>- Specified by:
equalsin interfaceSet<E>- Overrides:
equalsin classAbstractSet<E>
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<E>- Specified by:
hashCodein interfaceSet<E>- Overrides:
hashCodein classAbstractSet<E>
-
isEmpty
public boolean isEmpty() -
size
public int size() -
toArray
-
toArray
public <T> T[] toArray(T[] a) -
isLoaded
public boolean isLoaded() -
loadField
protected void loadField() -
spliterator
- Specified by:
spliteratorin interfaceCollection<E>- Specified by:
spliteratorin interfaceIterable<E>- Specified by:
spliteratorin interfaceSet<E>- Overrides:
spliteratorin classHashSet<E>
-