Purpose: This class holds the record of the changes made to a collection attribute of an object.
Description: Collections must be compared to each other and added and removed objects must be recorded separately.
| Modifier and Type | Field and Description |
|---|---|
| protected Map | addObjectList
Contains the added values to the collection and their corresponding ChangeSets. |
| protected transient List | addOverFlow
Contains a list of extra adds. |
| protected Map | orderedAddObjectIndices
Contains the added values index to the collection. |
| protected List | orderedAddObjects
Contains the added values to the collection and their corresponding ChangeSets in order. |
| protected List | orderedChangeObjectList
Contains OrderedChangeObjects representing each change made to the collection. |
| protected transient List | orderedRemoveObjectIndices
Contains the removed values index to the collection. |
| protected Map | orderedRemoveObjects
Contains the removed values to the collection and their corresponding ChangeSets. |
| protected boolean | orderHasBeenRepaired
Indicates whether IndirectList's order has been repaired. |
| protected Map | removeObjectList
Contains the removed values from the collection and their corresponding ChangeSets. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | CollectionChangeRecord(ObjectChangeSet
the changeSet that uses this record owner)Constructor for the ChangeRecord representing a collection mapping |
| Modifier and Type | Method and Description |
|---|---|
| public void | addAdditionChange(Map<K, V> objectChanges, ContainerPolicy cp, UnitOfWorkChangeSet changeSet, AbstractSession session)
This method takes a Map of objects, converts these into ObjectChangeSets. |
| public void | addOrderedAdditionChange(List<Object> orderedObjectsToAdd, Map<Object, Integer> objectChangesIndices, UnitOfWorkChangeSet changeSet, AbstractSession session)
This method takes a list of objects and converts them into ObjectChangeSets. |
| public void | addOrderedRemoveChange(List<Integer> indicesToRemove, Map<K, V> objectChanges, UnitOfWorkChangeSet changeSet, AbstractSession session)
This method takes a map of objects and converts them into ObjectChangeSets. |
| public void | addRemoveChange(Map<K, V> objectChanges, ContainerPolicy cp, UnitOfWorkChangeSet changeSet, AbstractSession session)
This method takes a Map of objects, converts these into ObjectChangeSets. |
| public void | clearChanges()
Implements abstract org. |
| public Map | getAddObjectList()
Implements org. |
| public List | |
| public List | getCurrentIndexesOfOriginalObjects(List<E> newList)
The same size as original list, at the i-th position holds the index of the i-th original object in the current list (-1 if the object was removed): for example: {0, -1, 1, -1, 3} means that: previous(0) == current(0); previous(1) was removed; previous(2) == current(1); previous(3) was removed; previous(4) == current(3); |
| public Integer | getOrderedAddObjectIndex(ObjectChangeSet changes)
This method returns the index of an object added to the collection. |
| public Map | getOrderedAddObjectIndices()
This method returns the collection of ChangeSets that they were added to the collection. |
| public List | getOrderedAddObjects()
This method returns the collection of ChangeSets in the order they were added to the collection. |
| public List | |
| public Object | getOrderedRemoveObject(Integer index)
This method returns the index of an object removed from the collection. |
| public List | getOrderedRemoveObjectIndices()
This method returns the ordered list of indices to remove from the collection. |
| public Map | getOrderedRemoveObjects()
This method returns the collection of ChangeSets of objects removed from the collection. |
| pack-priv ClassDescriptor | getReferenceDescriptor(Object object, AbstractSession session)
Returns descriptor corresponding to the object. |
| public Map | getRemoveObjectList()
Implements org. |
| public boolean | hasChanges()
Implements org. |
| public void | internalRecreateOriginalCollection(Object currentCollection, AbstractSession session)
Implements abstract org. |
| public void | mergeRecord(ChangeRecord mergeFromRecord, UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet)
Implements abstract org. |
| public boolean | |
| public void | setAddObjectList(Map<ObjectChangeSet, ObjectChangeSet> objectChangesList)
Sets the Added objects list. |
| public void | setOrderedAddObjectIndices(Map<ObjectChangeSet, Integer> orderedAddObjectIndices)
Sets collection of ChangeSets (and their respective index) that they were added to the collection. |
| public void | setOrderedAddObjects(List<ObjectChangeSet> orderedAddObjects)
Sets collection of ChangeSets that they were added to the collection. |
| public void | |
| public void | setOrderedRemoveObjects(Map<Integer, ObjectChangeSet> orderedRemoveObjects)
Sets collection of ChangeSets that they were removed from the collection. |
| public void | |
| public void | setRemoveObjectList(Map<ObjectChangeSet, ObjectChangeSet> objectChangesList)
Sets the removed objects list. |
| public void | updateReferences(UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet)
Implements abstract org. |
| addObjectList | back to summary |
|---|---|
| protected Map<ObjectChangeSet, ObjectChangeSet> addObjectList Contains the added values to the collection and their corresponding ChangeSets. | |
| addOverFlow | back to summary |
|---|---|
| protected transient List<ObjectChangeSet> addOverFlow Contains a list of extra adds. These extra adds are used by attribute change tracking to replicate behavior when someone adds the same object to a list and removes it once. In this case the object should still appear once in the change set. | |
| orderedAddObjectIndices | back to summary |
|---|---|
| protected Map<ObjectChangeSet, Integer> orderedAddObjectIndices Contains the added values index to the collection. | |
| orderedAddObjects | back to summary |
|---|---|
| protected List<ObjectChangeSet> orderedAddObjects Contains the added values to the collection and their corresponding ChangeSets in order. | |
| orderedChangeObjectList | back to summary |
|---|---|
| protected List<OrderedChangeObject> orderedChangeObjectList Contains OrderedChangeObjects representing each change made to the collection. | |
| orderedRemoveObjectIndices | back to summary |
|---|---|
| protected transient List<Integer> orderedRemoveObjectIndices Contains the removed values index to the collection. | |
| orderedRemoveObjects | back to summary |
|---|---|
| protected Map<Integer, ObjectChangeSet> orderedRemoveObjects Contains the removed values to the collection and their corresponding ChangeSets. | |
| orderHasBeenRepaired | back to summary |
|---|---|
| protected boolean orderHasBeenRepaired Indicates whether IndirectList's order has been repaired. | |
| removeObjectList | back to summary |
|---|---|
| protected Map<ObjectChangeSet, ObjectChangeSet> removeObjectList Contains the removed values from the collection and their corresponding ChangeSets. | |
| CollectionChangeRecord | back to summary |
|---|---|
| public CollectionChangeRecord() This default constructor. | |
| CollectionChangeRecord | back to summary |
|---|---|
| public CollectionChangeRecord(ObjectChangeSet owner) Constructor for the ChangeRecord representing a collection mapping
| |
| addAdditionChange | back to summary |
|---|---|
| public void addAdditionChange(Map<K, V> objectChanges, ContainerPolicy cp, UnitOfWorkChangeSet changeSet, AbstractSession session) This method takes a Map of objects, converts these into ObjectChangeSets. | |
| addOrderedAdditionChange | back to summary |
|---|---|
| public void addOrderedAdditionChange(List<Object> orderedObjectsToAdd, Map<Object, Integer> objectChangesIndices, UnitOfWorkChangeSet changeSet, AbstractSession session) This method takes a list of objects and converts them into ObjectChangeSets. This method should only be called from a ListContainerPolicy. Additions to the list are made by index, hence, the second Map of objectChangesIndices. | |
| addOrderedRemoveChange | back to summary |
|---|---|
| public void addOrderedRemoveChange(List<Integer> indicesToRemove, Map<K, V> objectChanges, UnitOfWorkChangeSet changeSet, AbstractSession session) This method takes a map of objects and converts them into ObjectChangeSets. This method should only be called from a ListContainerPolicy. Deletions from the list is made by index, hence, the second Vector of indicesToRemove. | |
| addRemoveChange | back to summary |
|---|---|
| public void addRemoveChange(Map<K, V> objectChanges, ContainerPolicy cp, UnitOfWorkChangeSet changeSet, AbstractSession session) This method takes a Map of objects, converts these into ObjectChangeSets. | |
| clearChanges | back to summary |
|---|---|
| public void clearChanges() Implements abstract org. Clears info about added / removed objects set by change tracker.
| |
| getAddObjectList | back to summary |
|---|---|
| public Map Implements org. ADVANCED: This method returns the collection of ChangeSets that were added to the collection.
| |
| getAddOverFlow | back to summary |
|---|---|
| public List Returns a list of extra adds. These extra adds are used by attribute change tracking to replicate behavior when someone adds the same object to a list and removes it once. In this case the object should still appear once in the change set. | |
| getCurrentIndexesOfOriginalObjects | back to summary |
|---|---|
| public List The same size as original list, at the i-th position holds the index of the i-th original object in the current list (-1 if the object was removed): for example: {0, -1, 1, -1, 3} means that: previous(0) == current(0); previous(1) was removed; previous(2) == current(1); previous(3) was removed; previous(4) == current(3); | |
| getOrderedAddObjectIndex | back to summary |
|---|---|
| public Integer getOrderedAddObjectIndex(ObjectChangeSet changes) This method returns the index of an object added to the collection. | |
| getOrderedAddObjectIndices | back to summary |
|---|---|
| public Map This method returns the collection of ChangeSets that they were added to the collection. | |
| getOrderedAddObjects | back to summary |
|---|---|
| public List This method returns the collection of ChangeSets in the order they were added to the collection. This list includes those objects that were moved within the collection. | |
| getOrderedChangeObjectList | back to summary |
|---|---|
| public List This method returns the Vector of OrderedChangeObjects. These objects represent all changes made to the collection, and their order in the vector represents the order they were performed. | |
| getOrderedRemoveObject | back to summary |
|---|---|
| public Object getOrderedRemoveObject(Integer index) This method returns the index of an object removed from the collection. | |
| getOrderedRemoveObjectIndices | back to summary |
|---|---|
| public List This method returns the ordered list of indices to remove from the collection. | |
| getOrderedRemoveObjects | back to summary |
|---|---|
| public Map This method returns the collection of ChangeSets of objects removed from the collection. | |
| getReferenceDescriptor | back to summary |
|---|---|
| pack-priv ClassDescriptor getReferenceDescriptor(Object object, AbstractSession session) Returns descriptor corresponding to the object. | |
| getRemoveObjectList | back to summary |
|---|---|
| public Map Implements org. PUBLIC: This method returns the Map that contains the removed values from the collection and their corresponding ChangeSets.
| |
| hasChanges | back to summary |
|---|---|
| public boolean hasChanges() Implements org. PUBLIC: Returns true if the change set has changes.
| |
| internalRecreateOriginalCollection | back to summary |
|---|---|
| public void internalRecreateOriginalCollection(Object currentCollection, AbstractSession session) Implements abstract org. Recreates the original state of currentCollection.
| |
| mergeRecord | back to summary |
|---|---|
| public void mergeRecord(ChangeRecord mergeFromRecord, UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet) Implements abstract org. This method will be used to merge one record into another.
| |
| orderHasBeenRepaired | back to summary |
|---|---|
| public boolean orderHasBeenRepaired() | |
| setAddObjectList | back to summary |
|---|---|
| public void setAddObjectList(Map<ObjectChangeSet, ObjectChangeSet> objectChangesList) Sets the Added objects list. | |
| setOrderedAddObjectIndices | back to summary |
|---|---|
| public void setOrderedAddObjectIndices(Map<ObjectChangeSet, Integer> orderedAddObjectIndices) Sets collection of ChangeSets (and their respective index) that they were added to the collection. | |
| setOrderedAddObjects | back to summary |
|---|---|
| public void setOrderedAddObjects(List<ObjectChangeSet> orderedAddObjects) Sets collection of ChangeSets that they were added to the collection. | |
| setOrderedChangeObjectList | back to summary |
|---|---|
| public void setOrderedChangeObjectList(List<OrderedChangeObject> orderedChangeObjectList) | |
| setOrderedRemoveObjects | back to summary |
|---|---|
| public void setOrderedRemoveObjects(Map<Integer, ObjectChangeSet> orderedRemoveObjects) Sets collection of ChangeSets that they were removed from the collection. | |
| setOrderHasBeenRepaired | back to summary |
|---|---|
| public void setOrderHasBeenRepaired(boolean hasBeenRepaired) | |
| setRemoveObjectList | back to summary |
|---|---|
| public void setRemoveObjectList(Map<ObjectChangeSet, ObjectChangeSet> objectChangesList) Sets the removed objects list. | |
| updateReferences | back to summary |
|---|---|
| public void updateReferences(UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet) Implements abstract org. This method will be used to update the objectsChangeSets references.
| |