Package org.apache.uima.internal.util

Examples of org.apache.uima.internal.util.ComparableIntPointerIterator


        this.indexes[this.currentIndex].dec();
        ensureIndexValidity(this.currentIndex);
      } else {
        // Else the current index is fine, but we have to decrement all
        // indexes.
        ComparableIntPointerIterator it;
        for (int i = 0; i < this.indexesSize; i++) {
          if (i != this.currentIndex) {
            it = this.indexes[i];
            // while (it.isValid() &&
            // (it.compareTo(indexes[this.currentIndex]) > 0)) {
            if (!it.isValid()) {
              it.moveToLast();
            }
            while (it.isValid()
                && (this.iteratorComparator
                    .compare(it.get(), this.indexes[this.currentIndex].get()) > 0)) {
              it.dec();
            }
          }
        }
        this.indexes[this.currentIndex].dec();
        this.numIndexes = this.indexesSize;
View Full Code Here


    /**
     * @see java.lang.Comparable#compareTo(Object)
     */
    public int compareTo(Object o) throws NoSuchElementException {
      ComparableIntPointerIterator it = (ComparableIntPointerIterator) o;
      // assert(this.comp != null);
      return this.comp.compare(get(), it.get());
    }
View Full Code Here

      ArrayList iteratorCache = iicp0.iteratorCache;
      this.indexesSize = iteratorCache.size();
      this.indexes = new ComparableIntPointerIterator[this.indexesSize];
      this.numIndexes = this.indexesSize;
      this.iteratorComparator = new IteratorComparator((FSLeafIndexImpl) iteratorCache.get(0));
      ComparableIntPointerIterator it;
      for (int i = 0; i < this.indexesSize; i++) {
        final FSLeafIndexImpl leafIndex = ((FSLeafIndexImpl) iteratorCache.get(i));
        it = leafIndex.pointerIterator(this.iteratorComparator,
            FSIndexRepositoryImpl.this.detectIllegalIndexUpdates, ((TypeImpl) leafIndex.getType())
                .getCode());
View Full Code Here

      // We're valid as long as at least one index is.
      return (this.numIndexes > 0);
    }

    private ComparableIntPointerIterator checkConcurrentModification(int i) {
      ComparableIntPointerIterator cipi = this.indexes[i];
      if (cipi.isConcurrentModification())
        throw new ConcurrentModificationException();
      return cipi;
    }
View Full Code Here

        throw new ConcurrentModificationException();
      return cipi;
    }

    private void resetConcurrentModification(int i) {
      ComparableIntPointerIterator cipi = this.indexes[i];
      cipi.resetConcurrentModification();
    }
View Full Code Here

        } else {
          // Else we shrink the array and swap the previously last
          // element to
          // the position where we want to delete the index.
          --this.numIndexes;
          ComparableIntPointerIterator tempIt = this.indexes[index];
          this.indexes[index] = this.indexes[this.numIndexes];
          this.indexes[this.numIndexes] = tempIt;
        }
      }
    }
View Full Code Here

        // Make sure it's still valid.
        ensureIndexValidity(this.currentIndex);
      } else {
        // Else we need to increment everything, including the currently
        // inactive indexes!
        ComparableIntPointerIterator it;
        for (int i = 0; i < this.indexesSize; i++) {
          // Any iterator other than the current one needs to be
          // incremented
          // until it's pointing at something that's greater than the
          // current
          // element.
          if (i != this.currentIndex) {
            it = this.indexes[i];
            // If the iterator we're considering is not valid, we
            // set it to the
            // first element. This should be it for this iterator...
            if (!it.isValid()) {
              it.moveToFirst();
            }
            // while (it.isValid() &&
            // (it.compareTo(indexes[this.currentIndex]) < 0)) {
            // Increment the iterator while it is valid and pointing
            // at something
            // smaller than the current element.
            while (it.isValid()
                && (this.iteratorComparator
                    .compare(it.get(), this.indexes[this.currentIndex].get()) < 0)) {
              it.inc();
            }
          }
        }
        // Increment the current index.
        this.indexes[this.currentIndex].inc();
View Full Code Here

        this.indexes[this.currentIndex].dec();
        ensureIndexValidity(this.currentIndex);
      } else {
        // Else the current index is fine, but we have to decrement all
        // indexes.
        ComparableIntPointerIterator it;
        for (int i = 0; i < this.indexesSize; i++) {
          if (i != this.currentIndex) {
            it = this.indexes[i];
            // while (it.isValid() &&
            // (it.compareTo(indexes[this.currentIndex]) > 0)) {
            if (!it.isValid()) {
              it.moveToLast();
            }
            while (it.isValid()
                && (this.iteratorComparator
                    .compare(it.get(), this.indexes[this.currentIndex].get()) > 0)) {
              it.dec();
            }
          }
        }
        this.indexes[this.currentIndex].dec();
        this.numIndexes = this.indexesSize;
View Full Code Here

TOP

Related Classes of org.apache.uima.internal.util.ComparableIntPointerIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.