Examples of IntVector


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

      if (!reuseInfoProvided) {
        throw new IllegalStateException("Reading Delta into CAS not serialized from");
      }
    }

    fixupsNeeded = new IntVector(Math.max(16, heapObj.getCellsUsed() / 10));

    /**********************************************************
     * Read in new FSs being deserialized and add them to heap
     **********************************************************/
    for (int iHeap = heapStart, targetHeapUsed = isReadingDelta ? 0 : 1; targetHeapUsed < heapUsedInTarget;) {
View Full Code Here

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

  private void readIndexedFeatureStructures() throws IOException {
    final int nbrViews = readVnumber(control_dis);
    final int nbrSofas = readVnumber(control_dis);

    IntVector fsIndexes = new IntVector(nbrViews + nbrSofas + 100);
    fsIndexes.add(nbrViews);
    fsIndexes.add(nbrSofas);
    for (int i = 0; i < nbrSofas; i++) {
      final int realAddrOfSofa = fsStartIndexes.getSrcAddrFromTgtSeq(readVnumber(control_dis));
      fsIndexes.add(realAddrOfSofa);
    }
     
    for (int i = 0; i < nbrViews; i++) {
      readFsxPart(fsIndexes);     // added FSs
      if (isDelta) {
        readFsxPart(fsIndexes);   // removed FSs
        readFsxPart(fsIndexes);   // reindexed FSs
      }
    }
   
    if (isDelta) {
      // getArray avoids copying.
      // length is too long, but extra is never accessed
      cas.reinitDeltaIndexedFSs(fsIndexes.getArray());
    } else {
      cas.reinitIndexedFSs(fsIndexes.getArray());
    }
  }
View Full Code Here

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

   *          for comments.
   * @return The generated array.
   */
  int[] toArray(int offset) {
    // This will hold the new array.
    IntVector v = new IntVector();
    // A stack for traversing the tree;
    Stack<IntRBTNode> nodeStack = new Stack<IntRBTNode>();
    // A stack for keeping addresses associated w/ the nodes on the
    // node stack.
    IntStack addressStack = new IntStack();
    IntRBTNode node = this;
    int address;
    do {
      while (node.left != null || node.right != null) {
        // While we have a non-terminal node...
        v.add(node.key);
        v.add(node.element);
        if (node.left != null) {
          if (node.right != null) {
            v.add(IntRBTArray.TWODTRS);
            addressStack.push(v.size());
            v.add(-1); // Placeholder.
            nodeStack.push(node.right);
          } else {
            v.add(IntRBTArray.LEFTDTR);
          }
          node = node.left;
        } else {
          // Because of the while loop, we know at this point that
          // node.right != null
          v.add(IntRBTArray.RIGHTDTR);
          node = node.right;
        }
      }
      // We have reached a terminal node...
      v.add(node.key);
      v.add(node.element);
      v.add(IntRBTArray.TERMINAL);
      if (addressStack.empty()) {
        node = null;
      } else {
        node = (IntRBTNode) nodeStack.pop();
        address = addressStack.pop();
        v.set(address, v.size() + offset);
      }
    } while (node != null);
    return v.toArray();
  }
View Full Code Here

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

  // [sofa-1 ... sofa-n]
  // number of FS indexed in View1
  // [FS-1 ... FS-n]
  // etc.
  int[] getIndexedFSs() {
    IntVector v = new IntVector();
    int[] fsLoopIndex;

    int numViews = getBaseSofaCount();
    v.add(numViews);

    // Get indexes for base CAS
    fsLoopIndex = this.svd.baseCAS.indexRepository.getIndexedFSs();
    v.add(fsLoopIndex.length);
    v.add(fsLoopIndex, 0, fsLoopIndex.length);
//    for (int k = 0; k < fsLoopIndex.length; k++) {
//      v.add(fsLoopIndex[k]);
//    }

    // Get indexes for each SofaFS in the CAS
    for (int sofaNum = 1; sofaNum <= numViews; sofaNum++) {
      FSIndexRepositoryImpl loopIndexRep = (FSIndexRepositoryImpl) this.svd.baseCAS
          .getSofaIndexRepository(sofaNum);
      if (loopIndexRep != null) {
        fsLoopIndex = loopIndexRep.getIndexedFSs();
      } else {
        fsLoopIndex = INT0;
      }
      v.add(fsLoopIndex.length);
      for (int k = 0; k < fsLoopIndex.length; k++) {
        v.add(fsLoopIndex[k]);
      }
    }
    return v.toArray();
  }
View Full Code Here

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

  // [FS-1 ... FS-n]
  //number of  FS reindexed in View1
  // [FS-1 ... FS-n]
  // etc.
  int[] getDeltaIndexedFSs(MarkerImpl mark) {
    IntVector v = new IntVector();
    int[] fsLoopIndex;
    int[] fsDeletedFromIndex;
    int[] fsReindexed;

    int numViews = getBaseSofaCount();
    v.add(numViews);

    // Get indexes for base CAS
    fsLoopIndex = this.svd.baseCAS.indexRepository.getIndexedFSs();
    // Get the new Sofa FS
    IntVector newSofas = new IntVector();
    for (int k = 0; k < fsLoopIndex.length; k++) {
      if ( mark.isNew(fsLoopIndex[k]) ) {
        newSofas.add(fsLoopIndex[k]);
      }
    }
   
    v.add(newSofas.size());
    v.add(newSofas.getArray(), 0, newSofas.size());
//    for (int k = 0; k < newSofas.size(); k++) {
//      v.add(newSofas.get(k));
//    }

    // Get indexes for each SofaFS in the CAS
View Full Code Here

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

        this.getByteHeap().getSize(),
        this.getShortHeap().getSize(),
        this.getLongHeap().getSize(),
        this);
    if (this.svd.modifiedPreexistingFSs == null) {
      this.svd.modifiedPreexistingFSs = new IntVector();
    } else {errorMultipleMarkers();}
    if (this.svd.modifiedFSHeapCells == null) {
      this.svd.modifiedFSHeapCells = new IntVector();
    } else {errorMultipleMarkers();}
    if (this.svd.modifiedByteHeapCells == null) {
        this.svd.modifiedByteHeapCells = new IntVector();
    } else {errorMultipleMarkers();}
    if (this.svd.modifiedShortHeapCells == null) {
        this.svd.modifiedShortHeapCells = new IntVector();
    } else {errorMultipleMarkers();}
    if (this.svd.modifiedLongHeapCells == null) {
        this.svd.modifiedLongHeapCells = new IntVector();
    } else {errorMultipleMarkers();}
    if (this.svd.trackingMarkList == null) {
      this.svd.trackingMarkList = new ArrayList<MarkerImpl>();
    } else {errorMultipleMarkers();}
    this.svd.trackingMarkList.add(this.svd.trackingMark);
View Full Code Here

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

  private int initialSize;

  FSVectorIndex(CASImpl cas, Type type, int initialSize, int indexType) {
    super(cas, type, indexType);
    this.initialSize = initialSize;
    this.index = new IntVector(initialSize);
  }
View Full Code Here

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

    return this.index;
  }

  public void flush() {
    if (this.index.size() > this.initialSize) {
      this.index = new IntVector(this.initialSize);
    } else {
      this.index.removeAllElements();
    }
  }
View Full Code Here

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

  private int initialSize;

  FSBagIndex(CASImpl cas, Type type, int initialSize, int indexType) {
    super(cas, type, indexType);
    this.initialSize = initialSize;
    this.index = new IntVector(initialSize);
  }
View Full Code Here

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

  }

  public void flush() {
    // done this way to reset to initial size if it grows
    if (this.index.size() > this.initialSize) {
      this.index = new IntVector(this.initialSize);
    } else {
      this.index.removeAllElements();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.