Package org.apache.uima.internal.util

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


  // [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

  // [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

        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

        //new Sofas start at 2
        this.nextSofaNum = 2;
      } else {
        this.nextSofaNum = ((CASImpl)this.casBeingFilled).getBaseSofaCount() + 1;
      }
      this.deserializedFsAddrs = new IntVector();
      this.fsListNodesFromMultivaluedProperties = new IntVector();
      this.buffer = new StringBuffer();
      this.indexRepositories = new ArrayList<FSIndexRepository>();
      this.views = new ArrayList<CAS>();
      indexRepositories.add(this.casBeingFilled.getBaseIndexRepository());
      // There should always be another index for the Initial View
View Full Code Here

        if (attrName.equals(ID_ATTR_NAME)) {
          try {
            id = Integer.parseInt(attrValue);
            newFS = this.isNewFS(id);
            if (sofaTypeCode != typeCode && !newFS) {
              this.featsSeen = new IntVector(attrs.getLength());
            } else {
              this.featsSeen = null;
            }
          } catch (NumberFormatException e) {
            throw createException(XCASParsingException.ILLEGAL_ID, attrValue);
View Full Code Here

          // We need this so we can go back through later and reset the addresses of the
          // "head" features of these lists nodes (but not reset the tail features).
          // It also adds a mapping between the nodes and the encompassing FS in order
          // to properly serialize in delta xmi format.
          int listFS = casBeingFilled.getFeatureValue(addr, featCode);
          IntVector fslistnodes = new IntVector();
          if (listFS == 0) {
            listFS = listUtils.createFsList(featVals, fslistnodes);
            casBeingFilled.setFeatureValue(addr, featCode, listFS);
          } else {
          listUtils.updateFsList(listFS, featVals, fslistnodes);
          }
          //add to multivaluedproperties fs list.
          for (int i=0; i < fslistnodes.size();  i++) {
            fsListNodesFromMultivaluedProperties.add(fslistnodes.get(i));
          }
          //add to nonshared fs to encompassing FS map.
          if (!ts.ll_getFeatureForCode(featCode).isMultipleReferencesAllowed()) {
          for (int i=0; i < fslistnodes.size(); i++) {
            addNonsharedFSToEncompassingFSMapping(fslistnodes.get(i), addr);
          }
          }
          break;
        }
        default: {
View Full Code Here

      this.ch = ch;
      this.eh = eh;
      this.cas = cas;
      this.visited = new IntRedBlackTree();
      this.queue = new IntStack();
      this.indexedFSs = new IntVector();
      // this.sofaTypeCode = cas.getTypeSystemImpl().getTypeCode(CAS.TYPE_NAME_SOFA);
      // this.annotationTypeCode = cas.getTypeSystemImpl().getTypeCode(CAS.TYPE_NAME_ANNOTATION);
      this.listUtils = new ListUtils(cas, logger, eh);
      this.arrayAndListFSs = new IntRedBlackTree();
      this.sharedData = sharedData;
View Full Code Here

      byteHeapObj   = cas.getByteHeap();

//      deserIn.readInt();    // reserved to record additional version info  // already read before calling
      final int nbrEntries = deserIn.readInt()// number of compressed streams
     
      IntVector idxAndLen = new IntVector(nbrEntries * 3);
     
      for (int i = 0; i < nbrEntries; i++) {
        idxAndLen.add(deserIn.readUnsignedByte())// slot ordinal number
        idxAndLen.add(deserIn.readInt());           // compressed size, bytes
        idxAndLen.add(deserIn.readInt());           // decompressed size, bytes (not currently used)
      }
     
      for (int i = 0; i < idxAndLen.size();) {
        setupReadStream(idxAndLen.get(i++), idxAndLen.get(i++), idxAndLen.get(i++));
      }

      arrayLength_dis = dataInputs[arrayLength_i];
      heapRef_dis = dataInputs[heapRef_i];
      int_dis = dataInputs[int_i];
View Full Code Here

      }

      if (CHANGE_FS_REFS_TO_SEQUENTIAL && (heapStart > 1)) {
        initFsStartIndexes(fsStartIndexes, heap, 1, heapStart, null);
      }
      fixupsNeeded = new IntVector(Math.max(16, heap.length / 10));

      /***************************
       * walk main heap
       ***************************/

 
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.