Top Description Fields Constructors Methods
org.eclipse.persistence.eis

public Class EISOrderedCollectionChangeRecord

extends CollectionChangeRecord
implements EISOrderedCollectionChangeRecord
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.sessions.changesets.EISOrderedCollectionChangeRecord, org.eclipse.persistence.sessions.changesets.ChangeRecord
Imports
java.util.ArrayList, .List, org.eclipse.persistence.internal.sessions.CollectionChangeRecord, .ObjectChangeSet, org.eclipse.persistence.mappings.DatabaseMapping

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

Field Summary

Modifier and TypeField and Description
private int[]
addIndexes

The indexes into the new collection of the elements that were added.

private List<E>
adds

The added stuff.

private int[][]
moveIndexPairs

The index pairs of the elements that were moved (before and after indexes).

private List<E>
moves

The moved stuff.

private int[]
removeIndexes

The indexes into the old collection of the elements that were removed.

private List<E>
removes

The removed stuff.

Inherited from org.eclipse.persistence.internal.sessions.CollectionChangeRecord:
addObjectListaddOverFloworderedAddObjectIndicesorderedAddObjectsorderedChangeObjectListorderedRemoveObjectIndicesorderedRemoveObjectsorderHasBeenRepairedremoveObjectList

Constructor Summary

AccessConstructor and Description
public
EISOrderedCollectionChangeRecord(ObjectChangeSet owner, String attributeName, DatabaseMapping mapping)

Construct a ChangeRecord that can be used to represent the changes to an ordered collection.

Method Summary

Modifier and TypeMethod and Description
public void
addAddedChangeSet(Object changeSet, int index)

Add an added change set.

public void
addMovedChangeSet(Object changeSet, int oldIndex, int newIndex)

Add an moved change set.

public void
addRemovedChangeSet(Object changeSet, int index)

Add an removed change set.

private int[]
addTo(int newInt, int[] oldArray)

Add the int to the end of the array.

private int[][]
addTo(int[] newInts, int[][] oldArray)

Add the int[] to the end of the array.

private void
cancelAddedChangeSet(Object changeSet)

The specified change set was added earlier; cancel it out.

private Object
getAdd(int index)

Return the specified add.

public int[]
getAddIndexes()

Implements org.eclipse.persistence.sessions.changesets.EISOrderedCollectionChangeRecord.getAddIndexes.

ADVANCED: Return the indexes into the new collection of the elements that were added.
public List<E>
getAdds()

Implements org.eclipse.persistence.sessions.changesets.EISOrderedCollectionChangeRecord.getAdds.

ADVANCED: Return the entries for all the elements added to the new collection.
private int
getAddsIndexOf(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 Object
getMove(int index)

Return the specified move.

public int[][]
getMoveIndexPairs()

Implements org.eclipse.persistence.sessions.changesets.EISOrderedCollectionChangeRecord.getMoveIndexPairs.

ADVANCED: Return the indexes of the elements that were simply moved within the collection.
public List<E>
getMoves()

Implements org.eclipse.persistence.sessions.changesets.EISOrderedCollectionChangeRecord.getMoves.

ADVANCED: Return the entries for all the elements that were simply shuffled within the collection.
private int
getMovesIndexOf(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.

public List<E>
getNewCollection()

Implements org.eclipse.persistence.sessions.changesets.EISOrderedCollectionChangeRecord.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.

public int[]
getRemoveIndexes()

Implements org.eclipse.persistence.sessions.changesets.EISOrderedCollectionChangeRecord.getRemoveIndexes.

ADVANCED: Return the indexes into the old collection of the elements that were removed.
public List<E>
getRemoves()

Implements org.eclipse.persistence.sessions.changesets.EISOrderedCollectionChangeRecord.getRemoves.

ADVANCED: Return the entries for all the elements removed from the old collection.
private int
getRemovesIndexOf(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.

public boolean
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(Object changeSet)

Attempt to remove the specified change set from the collection of moved change sets.

private boolean
restoreRemovedChangeSet(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.

public void
simpleAddChangeSet(Object changeSet)

Add a change set after it has been applied.

public void
simpleRemoveChangeSet(Object changeSet)

Remove a change set after it has been applied.

Inherited from org.eclipse.persistence.internal.sessions.CollectionChangeRecord:
addAdditionChangeaddOrderedAdditionChangeaddOrderedRemoveChangeaddRemoveChangeclearChangesgetAddObjectListgetAddOverFlowgetCurrentIndexesOfOriginalObjectsgetOrderedAddObjectIndexgetOrderedAddObjectIndicesgetOrderedAddObjectsgetOrderedChangeObjectListgetOrderedRemoveObjectgetOrderedRemoveObjectIndicesgetOrderedRemoveObjectsgetRemoveObjectListinternalRecreateOriginalCollectionmergeRecordorderHasBeenRepairedsetAddObjectListsetOrderedAddObjectIndicessetOrderedAddObjectssetOrderedChangeObjectListsetOrderedRemoveObjectssetOrderHasBeenRepairedsetRemoveObjectListupdateReferences

Field Detail

addIndexesback to summary
private int[] addIndexes

The indexes into the new collection of the elements that were added.

addsback to summary
private List<E> adds

The added stuff.

moveIndexPairsback to summary
private int[][] moveIndexPairs

The index pairs of the elements that were moved (before and after indexes).

movesback to summary
private List<E> moves

The moved stuff.

removeIndexesback to summary
private int[] removeIndexes

The indexes into the old collection of the elements that were removed.

removesback to summary
private List<E> removes

The removed stuff.

Constructor Detail

EISOrderedCollectionChangeRecordback to summary
public EISOrderedCollectionChangeRecord(ObjectChangeSet owner, String attributeName, DatabaseMapping mapping)

Construct a ChangeRecord that can be used to represent the changes to an ordered collection.

Method Detail

addAddedChangeSetback to summary
public void addAddedChangeSet(Object changeSet, int index)

Add an added change set.

addMovedChangeSetback to summary
public void addMovedChangeSet(Object changeSet, int oldIndex, int newIndex)

Add an moved change set.

addRemovedChangeSetback to summary
public void addRemovedChangeSet(Object changeSet, int index)

Add an removed change set.

addToback to summary
private int[] addTo(int newInt, int[] oldArray)

Add the int to the end of the array. Return the new array.

addToback to summary
private int[][] addTo(int[] newInts, int[][] oldArray)

Add the int[] to the end of the array. Return the new array.

cancelAddedChangeSetback to summary
private void cancelAddedChangeSet(Object changeSet)

The specified change set was added earlier; cancel it out.

getAddback to summary
private Object getAdd(int index)

Return the specified add.

getAddIndexesback to summary
public int[] getAddIndexes()

Implements org.eclipse.persistence.sessions.changesets.EISOrderedCollectionChangeRecord.getAddIndexes.

ADVANCED: Return the indexes into the new collection of the elements that were added.

Annotations
@Override
getAddsback to summary
public List<E> getAdds()

Implements org.eclipse.persistence.sessions.changesets.EISOrderedCollectionChangeRecord.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

Annotations
@Override
getAddsIndexOfback to summary
private int getAddsIndexOf(Object changeSet)

Return the index in the adds of the specified change set, without triggering the instantiation of the collection.

getAddsSizeback to summary
private int getAddsSize()

Return the number of adds, without triggering the instantiation of the collection.

getBeforeMoveIndexback to summary
private int getBeforeMoveIndex(int index)

Return the specified "before" move index.

getMoveback to summary
private Object getMove(int index)

Return the specified move.

getMoveIndexPairsback to summary
public int[][] getMoveIndexPairs()

Implements org.eclipse.persistence.sessions.changesets.EISOrderedCollectionChangeRecord.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.

Annotations
@Override
getMovesback to summary
public List<E> getMoves()

Implements org.eclipse.persistence.sessions.changesets.EISOrderedCollectionChangeRecord.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

Annotations
@Override
getMovesIndexOfback to summary
private int getMovesIndexOf(Object changeSet)

Return the index in the moves of the specified change set, without triggering the instantiation of the collection.

getMovesSizeback to summary
private int getMovesSize()

Return the number of moves, without triggering the instantiation of the collection.

getNewCollectionback to summary
public List<E> getNewCollection()

Implements org.eclipse.persistence.sessions.changesets.EISOrderedCollectionChangeRecord.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

Annotations
@Override
getNewCollectionSizeback to summary
private int getNewCollectionSize()

Return the number of elements in the new collection, without triggering the instantiation of the collections.

getRemoveIndexback to summary
private int getRemoveIndex(int index)

Return the specified remove index.

getRemoveIndexesback to summary
public int[] getRemoveIndexes()

Implements org.eclipse.persistence.sessions.changesets.EISOrderedCollectionChangeRecord.getRemoveIndexes.

ADVANCED: Return the indexes into the old collection of the elements that were removed.

Annotations
@Override
getRemovesback to summary
public List<E> getRemoves()

Implements org.eclipse.persistence.sessions.changesets.EISOrderedCollectionChangeRecord.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

Annotations
@Override
getRemovesIndexOfback to summary
private int getRemovesIndexOf(Object changeSet)

Return the index in the removes of the specified change set, without triggering the instantiation of the collection.

hasAddsback to summary
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.

hasChangesback to summary
public boolean hasChanges()

Overrides org.eclipse.persistence.internal.sessions.CollectionChangeRecord.hasChanges.

Implements org.eclipse.persistence.sessions.changesets.EISOrderedCollectionChangeRecord.hasChanges, org.eclipse.persistence.sessions.changesets.CollectionChangeRecord.hasChanges.

Return whether any changes have been recorded with the change record.

Returns:boolean

Doc from org.eclipse.persistence.sessions.changesets.CollectionChangeRecord.hasChanges.

boolean

Annotations
@Override
hasMovesback to summary
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.

hasRemovesback to summary
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.

removeFromback to summary
private int[] removeFrom(int removeIndex, int[] oldArray)

Remove the specified slot from the array. Return the new array.

removeFromback to summary
private int[][] removeFrom(int removeIndex, int[][] oldArray)

Remove the specified slot from the array. Return the new array.

removeMovedChangeSetback to summary
private boolean removeMovedChangeSet(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.

restoreRemovedChangeSetback to summary
private boolean restoreRemovedChangeSet(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.

setAddIndexesback to summary
private void setAddIndexes(int[] addIndexes)

Set the indexes into the new collection of the elements that were added.

setMoveIndexPairsback to summary
private void setMoveIndexPairs(int[][] moveIndexPairs)

Set the indexes of the elements that were moved.

setRemoveIndexesback to summary
private void setRemoveIndexes(int[] removeIndexes)

Set the indexes into the old collection of the elements that were removed.

simpleAddChangeSetback to summary
public void simpleAddChangeSet(Object changeSet)

Add a change set after it has been applied.

simpleRemoveChangeSetback to summary
public void simpleRemoveChangeSet(Object changeSet)

Remove a change set after it has been applied.