public int ll_createDocumentAnnotation(int length) { final int fsRef = ll_createDocumentAnnotationNoIndex(0, length); ll_getIndexRepository().ll_addFS(fsRef); return fsRef; }
/** * * @return the fs addr of the document annotation found via the index, or 0 if not there */ public int ll_getDocumentAnnotation() { if (this == this.svd.baseCAS) { // base CAS has no document return 0; } LowLevelIterator it = ll_getIndexRepository(). ll_getIndex(CAS.STD_ANNOTATION_INDEX, this.svd.casMetadata.ts.docType.getCode()). ll_iterator(); if (it.isValid()) { return it.ll_get(); } return 0; }
private JCasImpl(CASImpl cas) throws CASException { // * A new instance of JCas exists for each CAS // * At this point, some but not necessarily all of the Types have been // loaded // * the typeArray needs to be big enough to hold all the types // * that will be loaded. this.casImpl = cas; this.isUsedCache = cas.doUseJcasCache(); if (casImpl != casImpl.getBaseCAS()) { sharedView = ((JCasImpl) casImpl.getBaseCAS().getJCas()).sharedView; sharedView.errorSet.clear(); } else { sharedView = new JCasSharedView(cas, this.isUsedCache); } this.ll_IndexRepository = casImpl.ll_getIndexRepository(); this.jfsIndexRepository = new JFSIndexRepositoryImpl(this, cas.getIndexRepository()); // * acquire the lock for this thread that is the same lock // * used in the getNextIndexIncr operation. This will block // * any other (meaning on another thread) // * loading of the JCas Type classes until this thread's loading // * completes. synchronized (JCasImpl.class) { ClassLoader cl = cas.getJCasClassLoader(); instantiateJCas_Types(cl); } // end of synchronized block }
tgtCasViewImpl.ll_getIndexRepository().ll_addFS(copyOfFs);