Package org.apache.uima.internal.util

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());
    for (int k = 0; k < newSofas.size(); k++) {
      v.add(newSofas.get(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.getAddedFSs();
        fsDeletedFromIndex = loopIndexRep.getDeletedFSs();
        fsReindexed = loopIndexRep.getReindexedFSs();
      } else {
        fsLoopIndex = (new IntVector()).toArray();
        fsDeletedFromIndex = (new IntVector()).toArray();
        fsReindexed = (new IntVector()).toArray();
      }
      v.add(fsLoopIndex.length);
      for (int k = 0; k < fsLoopIndex.length; k++) {
        v.add(fsLoopIndex[k]);
      }
View Full Code Here


        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

  // Public only for testing purposes.
  public FSIndexComparatorImpl(CASImpl cas) {
    super();
    this.keyVector = new Vector<Object>();
    this.compVector = new IntVector();
    this.keyTypeVector = new IntVector();
    this.type = null;
    this.ts = cas.getTypeSystem();
    this.cas = cas;
  }
View Full Code Here

  FSIndexRepositoryImpl(CASImpl cas) {
    super();
    this.cas = cas;
    this.typeSystem = cas.getTypeSystemImpl();
    this.name2indexMap = new HashMap<String, IndexIteratorCachePair>();
    this.indexUpdates = new IntVector();
    this.indexUpdateOperation = new BitSet();
    this.fsAddedToIndex = new IntSet();
    this.fsDeletedFromIndex = new IntSet();
    this.fsReindexed = new IntSet();
    this.logProcessed = false;
View Full Code Here

  FSIndexRepositoryImpl(CASImpl cas, FSIndexRepositoryImpl baseIndexRepo) {
    super();
    this.cas = cas;
    this.typeSystem = cas.getTypeSystemImpl();
    this.name2indexMap = new HashMap<String, IndexIteratorCachePair>();
    this.indexUpdates = new IntVector();
    this.indexUpdateOperation = new BitSet();
    this.fsAddedToIndex = new IntSet();
    this.fsDeletedFromIndex = new IntSet();
    this.fsReindexed = new IntSet();
    this.logProcessed = false;
View Full Code Here

    }
    this.detectIllegalIndexUpdates = new int[numTypes];
    for (int i = 0; i < this.detectIllegalIndexUpdates.length; i++) {
      this.detectIllegalIndexUpdates[i] = Integer.MIN_VALUE;
    }
    this.usedIndexes = new IntVector();
    this.isUsed = new boolean[numTypes];
  }
View Full Code Here

   * an index. The order in which FSs occur in the array does not reflect the order in which they
   * were added to the repository. This means that set indexes deserialized from this list may
   * contain different but equal elements than the original index.
   */
  public int[] getIndexedFSs() {
    final IntVector v = new IntVector();
    IndexIteratorCachePair iicp;
    IntPointerIterator it;
    ArrayList<IndexIteratorCachePair> iv, cv;
    // We may need to profile this. If this is a bottleneck, use a different
    // implementation.
    SortedIntSet set;
    int jMax, indStrat;
    // Iterate over indexes with something in there
    for (int i = 0; i < this.usedIndexes.size(); i++) {
      iv = this.indexArray[this.usedIndexes.get(i)];
      // Iterate over the indexes for the type.
      jMax = iv.size();
      // Create a vector of IICPs. If there is at least one sorted or bag
      // index, pick one arbitrarily and add its FSs (since it contains all
      // FSs that all other indexes for the same type contain). If there are
      // only set indexes, create a set of the FSs in those indexes, since they
      // may all contain different elements (FSs that are duplicates for one
      // index may not be duplicates for a different one).
      cv = new ArrayList<IndexIteratorCachePair>();
      for (int j = 0; j < jMax; j++) {
        iicp = iv.get(j);
        indStrat = iicp.index.getIndexingStrategy();
        if (indStrat == FSIndex.SET_INDEX) {
          cv.add(iicp);
        } else {
          if (cv.size() > 0) {
            cv = new ArrayList<IndexIteratorCachePair>();
          }
          cv.add(iicp);
          break;
        }
      }
      if (cv.size() > 0) {
        set = new SortedIntSet();
        for (int k = 0; k < cv.size(); k++) {
          it = cv.get(k).index.refIterator();
          while (it.isValid()) {
            set.add(it.get());
            it.inc();
          }
        }
        for (int k = 0; k < set.size(); k++) {
          v.add(set.get(k));
        }
      }
    }
    return v.toArray();
  }
View Full Code Here

  private IntVector codes;

  private Vector<Float> values;

  FSFloatConstraintImpl() {
    this.codes = new IntVector();
    this.values = new Vector<Float>();
  }
View Full Code Here

   *          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

        fillCASJNI(casSerializerIn.heapArray, casSerializerIn.fsIndex, casSerializerIn.stringTable,
                casSerializerIn.byteHeapArray, casSerializerIn.shortHeapArray,
                casSerializerIn.longHeapArray);
      }

      IntVector resultSpecTypes = new IntVector();
      IntVector resultSpecFeatures = new IntVector();
      if (rs != null) {

        serializeResultSpecification(rs, (CASImpl) cas, resultSpecTypes, resultSpecFeatures);
      }

      processJNI(isTCas, sofaName, resultSpecTypes.toArray(), resultSpecFeatures.toArray());

      // call hasNext() to see if this returns segments
      // if there are no segments this will get the
      // CAS data.
      if (hasNext()) {
View Full Code Here

TOP

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

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.