Author: schor Date: Fri May 6 20:17:36 2016 New Revision: 1742612 URL: http://svn.apache.org/viewvc?rev=1742612&view=rev Log: [UIMA-4674] remove unused methods; change to concurrent modification exception detection, minor perf tweaks
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/FsIterator_bag.java Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/FsIterator_bag.java URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/FsIterator_bag.java?rev=1742612&r1=1742611&r2=1742612&view=diff ============================================================================== --- uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/FsIterator_bag.java (original) +++ uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/FsIterator_bag.java Fri May 6 20:17:36 2016 @@ -34,10 +34,11 @@ class FsIterator_bag<T extends FeatureSt final private FsIndex_bag<T> fsBagIndex; // just an optimization, is == to fsLeafIndexImpl from super class, allows dispatch w/o casting - FsIterator_bag(FsIndex_bag<T> fsBagIndex, int[] detectIllegalIndexUpdates, int typeCode) { - super(detectIllegalIndexUpdates, typeCode, null); + FsIterator_bag(FsIndex_bag<T> fsBagIndex, TypeImpl ti) { + super(ti, null); // null: null comparator for bags this.fsBagIndex = fsBagIndex; // need for copy() bag = (ObjHashSet<T>) fsBagIndex.getObjHashSet(); + resetConcurrentModification(); moveToFirst(); } @@ -119,6 +120,13 @@ class FsIterator_bag<T extends FeatureSt } } + @Override + public void moveToPreviousNvc() { + checkConcurrentModification(); + isGoingForward = false; + position = bag.moveToPreviousFilled(--position); + } + /* (non-Javadoc) * @see org.apache.uima.cas.FSIterator#moveTo(org.apache.uima.cas.FeatureStructure) */ @@ -133,7 +141,7 @@ class FsIterator_bag<T extends FeatureSt */ @Override public FsIterator_bag<T> copy() { - FsIterator_bag<T> copy = new FsIterator_bag<T>(this.fsBagIndex, this.detectIllegalIndexUpdates, this.typeCode); + FsIterator_bag<T> copy = new FsIterator_bag<T>(this.fsBagIndex, this.ti); copy.position = position; copy.isGoingForward = isGoingForward; return copy; @@ -154,5 +162,14 @@ class FsIterator_bag<T extends FeatureSt return fsBagIndex; } + /* (non-Javadoc) + * @see org.apache.uima.cas.impl.FsIterator_singletype#getModificationCountFromIndex() + */ + @Override + protected int getModificationCountFromIndex() { + return bag.getModificationCount(); + } + + }