Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle TopLink
11g Release 1 (11.1.1)

E28847-01


org.eclipse.persistence.eis
Class EISOrderedCollectionChangeRecord

java.lang.Object
  extended by org.eclipse.persistence.internal.sessions.ChangeRecord
      extended by org.eclipse.persistence.internal.sessions.DeferrableChangeRecord
          extended by org.eclipse.persistence.internal.sessions.CollectionChangeRecord
              extended by org.eclipse.persistence.eis.EISOrderedCollectionChangeRecord

All Implemented Interfaces:
java.io.Serializable, ChangeRecord, CollectionChangeRecord, EISOrderedCollectionChangeRecord

public class EISOrderedCollectionChangeRecord
extends org.eclipse.persistence.internal.sessions.CollectionChangeRecord
implements EISOrderedCollectionChangeRecord

INTERNAL: Capture the changes for an ordered collection where the entire collection is simply replaced if it has changed.

See Also:
Serialized Form

Field Summary
private  int[] addIndexes
          The indexes into the new collection of the elements that were added.
private  java.util.Vector adds
          The added stuff.
private  int[][] moveIndexPairs
          The index pairs of the elements that were moved (before and after indexes).
private  java.util.Vector moves
          The moved stuff.
private  int[] removeIndexes
          The indexes into the old collection of the elements that were removed.
private  java.util.Vector removes
          The removed stuff.

 

Fields inherited from class org.eclipse.persistence.internal.sessions.CollectionChangeRecord
addObjectList, addOverFlow, orderedAddObjectIndices, orderedAddObjects, orderedChangeObjectList, orderedRemoveObjectIndices, orderedRemoveObjects, orderHasBeenRepaired, removeObjectList

 

Fields inherited from class org.eclipse.persistence.internal.sessions.DeferrableChangeRecord
isDeferred, latestCollection, originalCollection

 

Fields inherited from class org.eclipse.persistence.internal.sessions.ChangeRecord
attribute, mapping, owner

 

Constructor Summary
EISOrderedCollectionChangeRecord(org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, java.lang.String attributeName, DatabaseMapping mapping)
          Construct a ChangeRecord that can be used to represent the changes to an ordered collection.

 

Method Summary
 void addAddedChangeSet(java.lang.Object changeSet, int index)
          Add an added change set.
 void addMovedChangeSet(java.lang.Object changeSet, int oldIndex, int newIndex)
          Add an moved change set.
 void addRemovedChangeSet(java.lang.Object changeSet, int index)
          Add an removed change set.
private  int[][] addTo(int[] newInts, int[][] oldArray)
          Add the int[] to the end of the array.
private  int[] addTo(int newInt, int[] oldArray)
          Add the int to the end of the array.
private  void cancelAddedChangeSet(java.lang.Object changeSet)
          The specified change set was added earlier; cancel it out.
private  java.lang.Object getAdd(int index)
          Return the specified add.
 int[] getAddIndexes()
          ADVANCED: Return the indexes into the new collection of the elements that were added.
 java.util.Vector getAdds()
          ADVANCED: Return the entries for all the elements added to the new collection.
private  int getAddsIndexOf(java.lang.Object changeSet)
          Return the index in the adds of the specified change set, without triggering the instantiation of the collection.
private  int getAddsSize()
          Return the number of adds, without triggering the instantiation of the collection.
private  int getBeforeMoveIndex(int index)
          Return the specified "before" move index.
private  java.lang.Object getMove(int index)
          Return the specified move.
 int[][] getMoveIndexPairs()
          ADVANCED: Return the indexes of the elements that were simply moved within the collection.
 java.util.Vector getMoves()
          ADVANCED: Return the entries for all the elements that were simply shuffled within the collection.
private  int getMovesIndexOf(java.lang.Object changeSet)
          Return the index in the moves of the specified change set, without triggering the instantiation of the collection.
private  int getMovesSize()
          Return the number of moves, without triggering the instantiation of the collection.
 java.util.Vector getNewCollection()
          ADVANCED: Return the entries for all the elements in the new collection.
private  int getNewCollectionSize()
          Return the number of elements in the new collection, without triggering the instantiation of the collections.
private  int getRemoveIndex(int index)
          Return the specified remove index.
 int[] getRemoveIndexes()
          ADVANCED: Return the indexes into the old collection of the elements that were removed.
 java.util.Vector getRemoves()
          ADVANCED: Return the entries for all the elements removed from the old collection.
private  int getRemovesIndexOf(java.lang.Object changeSet)
          Return the index in the removes of the specified change set, without triggering the instantiation of the collection.
private  boolean hasAdds()
          Return whether any adds have been recorded with the change record.
 boolean hasChanges()
          Return whether any changes have been recorded with the change record.
private  boolean hasMoves()
          Return whether any moves have been recorded with the change record.
private  boolean hasRemoves()
          Return whether any removes have been recorded with the change record.
private  int[] removeFrom(int removeIndex, int[] oldArray)
          Remove the specified slot from the array.
private  int[][] removeFrom(int removeIndex, int[][] oldArray)
          Remove the specified slot from the array.
private  boolean removeMovedChangeSet(java.lang.Object changeSet)
          Attempt to remove the specified change set from the collection of moved change sets.
private  boolean restoreRemovedChangeSet(java.lang.Object changeSet)
          Attempt to restore the specified change set.
private  void setAddIndexes(int[] addIndexes)
          Set the indexes into the new collection of the elements that were added.
private  void setMoveIndexPairs(int[][] moveIndexPairs)
          Set the indexes of the elements that were moved.
private  void setRemoveIndexes(int[] removeIndexes)
          Set the indexes into the old collection of the elements that were removed.
 void simpleAddChangeSet(java.lang.Object changeSet)
          Add a change set after it has been applied.
 void simpleRemoveChangeSet(java.lang.Object changeSet)
          Remove a change set after it has been applied.

 

Methods inherited from class org.eclipse.persistence.internal.sessions.CollectionChangeRecord
addAdditionChange, addOrderedAdditionChange, addOrderedRemoveChange, addRemoveChange, clearChanges, getAddObjectList, getAddOverFlow, getCurrentIndexesOfOriginalObjects, getOrderedAddObjectIndex, getOrderedAddObjectIndices, getOrderedAddObjects, getOrderedChangeObjectList, getOrderedRemoveObject, getOrderedRemoveObjectIndices, getOrderedRemoveObjects, getRemoveObjectList, internalRecreateOriginalCollection, mergeRecord, orderHasBeenRepaired, setAddObjectList, setOrderedAddObjectIndices, setOrderedAddObjects, setOrderedChangeObjectList, setOrderedRemoveObjects, setOrderHasBeenRepaired, setRemoveObjectList, updateReferences

 

Methods inherited from class org.eclipse.persistence.internal.sessions.DeferrableChangeRecord
getLatestCollection, getOldValue, getOldValue, getOriginalCollection, isDeferred, recreateOriginalCollection, setIsDeferred, setLatestCollection, setOriginalCollection

 

Methods inherited from class org.eclipse.persistence.internal.sessions.ChangeRecord
getAttribute, getMapping, getOwner, prepareForSynchronization, setAttribute, setMapping, setOwner, toString, updateChangeRecordWithNewValue

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Methods inherited from interface org.eclipse.persistence.sessions.changesets.ChangeRecord
getAttribute, getOldValue, getOwner

 

Field Detail

adds

private java.util.Vector adds
The added stuff.

addIndexes

private int[] addIndexes
The indexes into the new collection of the elements that were added.

moves

private java.util.Vector moves
The moved stuff.

moveIndexPairs

private int[][] moveIndexPairs
The index pairs of the elements that were moved (before and after indexes).

removes

private java.util.Vector removes
The removed stuff.

removeIndexes

private int[] removeIndexes
The indexes into the old collection of the elements that were removed.

Constructor Detail

EISOrderedCollectionChangeRecord

public EISOrderedCollectionChangeRecord(org.eclipse.persistence.internal.sessions.ObjectChangeSet owner,
                                        java.lang.String attributeName,
                                        DatabaseMapping mapping)
Construct a ChangeRecord that can be used to represent the changes to an ordered collection.

Method Detail

addAddedChangeSet

public void addAddedChangeSet(java.lang.Object changeSet,
                              int index)
Add an added change set.

addMovedChangeSet

public void addMovedChangeSet(java.lang.Object changeSet,
                              int oldIndex,
                              int newIndex)
Add an moved change set.

addRemovedChangeSet

public void addRemovedChangeSet(java.lang.Object changeSet,
                                int index)
Add an removed change set.

addTo

private int[] addTo(int newInt,
                    int[] oldArray)
Add the int to the end of the array. Return the new array.

addTo

private int[][] addTo(int[] newInts,
                      int[][] oldArray)
Add the int[] to the end of the array. Return the new array.

getAdd

private java.lang.Object getAdd(int index)
Return the specified add.

getAddIndexes

public int[] getAddIndexes()
ADVANCED: Return the indexes into the new collection of the elements that were added.
Specified by:
getAddIndexes in interface EISOrderedCollectionChangeRecord

getAdds

public java.util.Vector getAdds()
ADVANCED: Return the entries for all the elements added to the new collection. The contents of this collection is determined by the mapping that populated it
Specified by:
getAdds in interface EISOrderedCollectionChangeRecord

getAddsIndexOf

private int getAddsIndexOf(java.lang.Object changeSet)
Return the index in the adds of the specified change set, without triggering the instantiation of the collection.

getAddsSize

private int getAddsSize()
Return the number of adds, without triggering the instantiation of the collection.

getMove

private java.lang.Object getMove(int index)
Return the specified move.

getBeforeMoveIndex

private int getBeforeMoveIndex(int index)
Return the specified "before" move index.

getMoveIndexPairs

public int[][] getMoveIndexPairs()
ADVANCED: Return the indexes of the elements that were simply moved within the collection. Each element in the outer array is another two-element array where the first entry [0] is the index of the object in the old collection and the second entry [1] is the index of the object in the new collection. These two indexes can be equal.
Specified by:
getMoveIndexPairs in interface EISOrderedCollectionChangeRecord

getMoves

public java.util.Vector getMoves()
ADVANCED: Return the entries for all the elements that were simply shuffled within the collection. The contents of this collection is determined by the mapping that populated it
Specified by:
getMoves in interface EISOrderedCollectionChangeRecord

getMovesIndexOf

private int getMovesIndexOf(java.lang.Object changeSet)
Return the index in the moves of the specified change set, without triggering the instantiation of the collection.

getMovesSize

private int getMovesSize()
Return the number of moves, without triggering the instantiation of the collection.

getNewCollection

public java.util.Vector getNewCollection()
ADVANCED: Return the entries for all the elements in the new collection. The contents of this collection is determined by the mapping that populated it
Specified by:
getNewCollection in interface EISOrderedCollectionChangeRecord

getNewCollectionSize

private int getNewCollectionSize()
Return the number of elements in the new collection, without triggering the instantiation of the collections.

getRemoveIndex

private int getRemoveIndex(int index)
Return the specified remove index.

getRemoveIndexes

public int[] getRemoveIndexes()
ADVANCED: Return the indexes into the old collection of the elements that were removed.
Specified by:
getRemoveIndexes in interface EISOrderedCollectionChangeRecord

getRemoves

public java.util.Vector getRemoves()
ADVANCED: Return the entries for all the elements removed from the old collection. The contents of this collection is determined by the mapping that populated it
Specified by:
getRemoves in interface EISOrderedCollectionChangeRecord

getRemovesIndexOf

private int getRemovesIndexOf(java.lang.Object changeSet)
Return the index in the removes of the specified change set, without triggering the instantiation of the collection.

hasAdds

private boolean hasAdds()
Return whether any adds have been recorded with the change record. Directly reference the instance variable, so as to not trigger the lazy instantiation.

hasChanges

public boolean hasChanges()
Return whether any changes have been recorded with the change record.
Specified by:
hasChanges in interface CollectionChangeRecord
Specified by:
hasChanges in interface EISOrderedCollectionChangeRecord
Overrides:
hasChanges in class org.eclipse.persistence.internal.sessions.CollectionChangeRecord
Returns:
boolean

hasMoves

private boolean hasMoves()
Return whether any moves have been recorded with the change record. Directly reference the instance variable, so as to not trigger the lazy instantiation.

hasRemoves

private boolean hasRemoves()
Return whether any removes have been recorded with the change record. Directly reference the instance variable, so as to not trigger the lazy instantiation.

removeFrom

private int[] removeFrom(int removeIndex,
                         int[] oldArray)
Remove the specified slot from the array. Return the new array.

removeFrom

private int[][] removeFrom(int removeIndex,
                           int[][] oldArray)
Remove the specified slot from the array. Return the new array.

cancelAddedChangeSet

private void cancelAddedChangeSet(java.lang.Object changeSet)
The specified change set was added earlier; cancel it out.

removeMovedChangeSet

private boolean removeMovedChangeSet(java.lang.Object changeSet)
Attempt to remove the specified change set from the collection of moved change sets. Return true if the change set was moved earlier and was successfully removed.

restoreRemovedChangeSet

private boolean restoreRemovedChangeSet(java.lang.Object changeSet)
Attempt to restore the specified change set. Return true if the change set was removed earlier and was successfully restored to the end of the collection.

setAddIndexes

private void setAddIndexes(int[] addIndexes)
Set the indexes into the new collection of the elements that were added.

setMoveIndexPairs

private void setMoveIndexPairs(int[][] moveIndexPairs)
Set the indexes of the elements that were moved.

setRemoveIndexes

private void setRemoveIndexes(int[] removeIndexes)
Set the indexes into the old collection of the elements that were removed.

simpleAddChangeSet

public void simpleAddChangeSet(java.lang.Object changeSet)
Add a change set after it has been applied.

simpleRemoveChangeSet

public void simpleRemoveChangeSet(java.lang.Object changeSet)
Remove a change set after it has been applied.

Skip navigation links

Copyright © 1998, 2012, Oracle. All Rights Reserved.