Class CollectionChangeRecord

    • Field Detail

      • orderedAddObjects

        protected List<ObjectChangeSet> orderedAddObjects
        Contains the added values to the collection and their corresponding ChangeSets in order.
      • orderedAddObjectIndices

        protected Map<ObjectChangeSet,​Integer> orderedAddObjectIndices
        Contains the added values index to the collection.
      • orderedChangeObjectList

        protected List<OrderedChangeObject> orderedChangeObjectList
        Contains OrderedChangeObjects representing each change made to the collection.
      • orderedRemoveObjects

        protected Map<Integer,​ObjectChangeSet> orderedRemoveObjects
        Contains the removed values to the collection and their corresponding ChangeSets.
      • orderedRemoveObjectIndices

        protected transient List<Integer> orderedRemoveObjectIndices
        Contains the removed values index to the collection.
      • addOverFlow

        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.
      • removeObjectList

        protected Map<ObjectChangeSet,​ObjectChangeSet> removeObjectList
        Contains the removed values from the collection and their corresponding ChangeSets.
      • orderHasBeenRepaired

        protected boolean orderHasBeenRepaired
        Indicates whether IndirectList's order has been repaired.
    • Constructor Detail

      • CollectionChangeRecord

        public CollectionChangeRecord()
        This default constructor.
      • CollectionChangeRecord

        public CollectionChangeRecord​(ObjectChangeSet owner)
        Constructor for the ChangeRecord representing a collection mapping
        Parameters:
        owner - the changeSet that uses this record
    • Method Detail

      • addOrderedAdditionChange

        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

        public void addOrderedRemoveChange​(List<Integer> indicesToRemove,
                                           Map 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.
      • getAddOverFlow

        public List<ObjectChangeSet> getAddOverFlow()
        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.
      • hasChanges

        public boolean hasChanges()
        PUBLIC: Returns true if the change set has changes.
        Specified by:
        hasChanges in interface CollectionChangeRecord
        Returns:
        boolean
      • getOrderedAddObjects

        public List<ObjectChangeSet> getOrderedAddObjects()
        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.
      • getOrderedAddObjectIndex

        public Integer getOrderedAddObjectIndex​(ObjectChangeSet changes)
        This method returns the index of an object added to the collection.
      • getOrderedAddObjectIndices

        public Map<ObjectChangeSet,​Integer> getOrderedAddObjectIndices()
        This method returns the collection of ChangeSets that they were added to the collection.
      • getOrderedChangeObjectList

        public List<OrderedChangeObject> getOrderedChangeObjectList()
        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.
      • getOrderedRemoveObjectIndices

        public List<Integer> getOrderedRemoveObjectIndices()
        This method returns the ordered list of indices to remove from the collection.
      • getOrderedRemoveObject

        public Object getOrderedRemoveObject​(Integer index)
        This method returns the index of an object removed from the collection.
      • getOrderedRemoveObjects

        public Map<Integer,​ObjectChangeSet> getOrderedRemoveObjects()
        This method returns the collection of ChangeSets of objects removed from the collection.
      • setOrderedAddObjectIndices

        public void setOrderedAddObjectIndices​(Map<ObjectChangeSet,​Integer> orderedAddObjectIndices)
        Sets collection of ChangeSets (and their respective index) that they were added to the collection.
      • setOrderedAddObjects

        public void setOrderedAddObjects​(List<ObjectChangeSet> orderedAddObjects)
        Sets collection of ChangeSets that they were added to the collection.
      • setOrderedChangeObjectList

        public void setOrderedChangeObjectList​(List<OrderedChangeObject> orderedChangeObjectList)
      • setOrderedRemoveObjects

        public void setOrderedRemoveObjects​(Map<Integer,​ObjectChangeSet> orderedRemoveObjects)
        Sets collection of ChangeSets that they were removed from the collection.
      • getCurrentIndexesOfOriginalObjects

        public List<Integer> getCurrentIndexesOfOriginalObjects​(List 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);
      • setOrderHasBeenRepaired

        public void setOrderHasBeenRepaired​(boolean hasBeenRepaired)
      • orderHasBeenRepaired

        public boolean orderHasBeenRepaired()