/** * Add a change set after it has been applied. */ public void simpleAddChangeSet(Object changeSet) { // check whether the change set was removed earlier if (!this.restoreRemovedChangeSet(changeSet)) { // the change set is tacked on the end of the new collection this.addAddedChangeSet(changeSet, this.getNewCollectionSize()); } }
/** * Add a change set after it has been applied. */ public void simpleAddChangeSet(Object changeSet) { // check whether the change set was removed earlier if (!this.restoreRemovedChangeSet(changeSet)) { // the change set is tacked on the end of the new collection this.addAddedChangeSet(changeSet, this.getNewCollectionSize()); } }
/** * Add a change set after it has been applied. */ public void simpleAddChangeSet(Object changeSet) { // check whether the change set was removed earlier if (!this.restoreRemovedChangeSet(changeSet)) { // the change set is tacked on the end of the new collection this.addAddedChangeSet(changeSet, this.getNewCollectionSize()); } }
int newSize = getNewCollectionSize(); List newCollection = new ArrayList(newSize);
int newSize = this.getNewCollectionSize(); Vector newCollection = new Vector(newSize);
int newSize = getNewCollectionSize(); List newCollection = new ArrayList(newSize);
/** * 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. */ private boolean restoreRemovedChangeSet(Object changeSet) { int changeSetIndex = this.getRemovesIndexOf(changeSet); if (changeSetIndex == -1) { return false; } this.getRemoves().remove(changeSetIndex); int removeIndex = this.getRemoveIndex(changeSetIndex); this.setRemoveIndexes(this.removeFrom(changeSetIndex, this.getRemoveIndexes())); // now move the change set over to the collection of moves this.addMovedChangeSet(changeSet, removeIndex, this.getNewCollectionSize()); return true; }
/** * 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. */ private boolean restoreRemovedChangeSet(Object changeSet) { int changeSetIndex = this.getRemovesIndexOf(changeSet); if (changeSetIndex == -1) { return false; } this.getRemoves().remove(changeSetIndex); int removeIndex = this.getRemoveIndex(changeSetIndex); this.setRemoveIndexes(this.removeFrom(changeSetIndex, this.getRemoveIndexes())); // now move the change set over to the collection of moves this.addMovedChangeSet(changeSet, removeIndex, this.getNewCollectionSize()); return true; }
/** * 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. */ private boolean restoreRemovedChangeSet(Object changeSet) { int changeSetIndex = this.getRemovesIndexOf(changeSet); if (changeSetIndex == -1) { return false; } this.getRemoves().remove(changeSetIndex); int removeIndex = this.getRemoveIndex(changeSetIndex); this.setRemoveIndexes(this.removeFrom(changeSetIndex, this.getRemoveIndexes())); // now move the change set over to the collection of moves this.addMovedChangeSet(changeSet, removeIndex, this.getNewCollectionSize()); return true; }