@Override public TOP_Type getType(int i) { testLiveness(); return delegate.getType(i); }
protected List<Annotation> getMiddleScopeContextAnnotations(JCas jCas, Annotation focus) throws AnalysisEngineProcessException { List<Annotation> scopeContextAnnotations = new ArrayList<Annotation>(); FSIterator subiterator = jCas.getAnnotationIndex(contextType).subiterator(focus); while (subiterator.hasNext()) { scopeContextAnnotations.add((Annotation) subiterator.next()); } if (scopeContextAnnotations.size() == 0 && JCasUtil.getType(focus.getClass()) == contextType) scopeContextAnnotations.add(focus); else if (scopeContextAnnotations.size() == 0) { TypeSystem typeSystem = jCas.getTypeSystem(); Type superType = jCas.getType(focusType).casType; Type subType = focus.getType(); if (typeSystem.subsumes(superType, subType)) scopeContextAnnotations.add(focus); } return scopeContextAnnotations; }
protected List<Annotation> getMiddleScopeContextAnnotations(JCas jCas, Annotation focus) throws AnalysisEngineProcessException { List<Annotation> scopeContextAnnotations = new ArrayList<Annotation>(); FSIterator subiterator = jCas.getAnnotationIndex(contextType).subiterator(focus); while (subiterator.hasNext()) { scopeContextAnnotations.add((Annotation) subiterator.next()); } if (scopeContextAnnotations.size() == 0 && JCasUtil.getType(focus.getClass()) == contextType) scopeContextAnnotations.add(focus); else if (scopeContextAnnotations.size() == 0) { TypeSystem typeSystem = jCas.getTypeSystem(); Type superType = jCas.getType(focusType).casType; Type subType = focus.getType(); if (typeSystem.subsumes(superType, subType)) scopeContextAnnotations.add(focus); } return scopeContextAnnotations; }
@Override @Deprecated public TOP_Type getType(TOP instance) { testLiveness(); return delegate.getType(instance); }
/** * Make a new StringArray of given size * @param jcas The JCas * @param length The number of elements in the new array */ public StringArray(JCas jcas, int length) { this( /* addr */jcas.getLowLevelCas().ll_createArray(jcas.getType(typeIndexID).casTypeCode, length, true), /* type */jcas.getType(typeIndexID)); }
/** * Make a new FSArray of given size * @param jcas The JCas * @param length The number of elements in the new array */ public FSArray(JCas jcas, int length) { this( /* addr */jcas.getLowLevelCas().ll_createArray(jcas.getType(typeIndexID).casTypeCode, length), /* type */jcas.getType(typeIndexID)); // at this point we can use the jcasType value, as it is set // can't do this earlier as the very first statement is required by // JAVA to be the super or alternate constructor call jcasType.casImpl.checkArrayPreconditions(length); }
/** * Make a new IntegerArray of given size * @param jcas The JCas * @param length The number of elements in the new array */ public IntegerArray(JCas jcas, int length) { this( /* addr */jcas.getLowLevelCas().ll_createArray(jcas.getType(typeIndexID).casTypeCode, length), /* type */jcas.getType(typeIndexID)); // at this point we can use the jcasType value, as it is set // can't do this earlier as the very first statement is required by // JAVA to be the super or alternate constructor call jcasType.casImpl.checkArrayPreconditions(length); }
/** * Make a new FloatArray of given size * @param jcas the JCas * @param length the size of the array */ public FloatArray(JCas jcas, int length) { this( /* addr */ jcas.getLowLevelCas().ll_createArray(jcas.getType(typeIndexID).casTypeCode, length), /* type */ jcas.getType(typeIndexID)); // at this point we can use the jcasType value, as it is set // can't do this earlier as the very first statement is required by // JAVA to be the super or alternate constructor call jcasType.casImpl.checkArrayPreconditions(length); }
/** * Make a new BooleanArray of given size * @param jcas JCas reference * @param length of array */ public BooleanArray(JCas jcas, int length) { this(jcas.getLowLevelCas().ll_createBooleanArray(length), jcas.getType(typeIndexID)); }
/** * Make a new ShortArray of given size * @param jcas The JCas * @param length The number of elements in the new array */ public ShortArray(JCas jcas, int length) { this(jcas.getLowLevelCas().ll_createShortArray(length), jcas.getType(typeIndexID)); }
/** * Make a new LongArray of given size * @param jcas The JCas * @param length The number of elements in the new array */ public LongArray(JCas jcas, int length) { this(jcas.getLowLevelCas().ll_createLongArray(length), jcas.getType(typeIndexID)); }
/** * Make a new DoubleArray of given size * @param jcas The JCas * @param length the length of the array */ public DoubleArray(JCas jcas, int length) { this(jcas.getLowLevelCas().ll_createDoubleArray(length), jcas.getType(typeIndexID)); }
/** * Make a new ByteArray of given size * @param jcas the JCas * @param length the length of the array in bytes */ public ByteArray(JCas jcas, int length) { this(jcas.getLowLevelCas().ll_createByteArray(length), jcas.getType(typeIndexID)); }
public static void copyFeatureStructuresOfType(int type, JCas sourceView, JCas destinationView) { copyFeatureStructuresOfType(sourceView.getType(type).casType.getName(), sourceView.getCas(), destinationView.getCas()); } }
public TOP(JCas jcas) { CASImpl casImpl = (CASImpl)jcas.getCas(); this.jcasType = jcas.getType(getTypeIndexID()); if (null == jcasType) { CASRuntimeException e = new CASRuntimeException(CASRuntimeException.JCAS_TYPE_NOT_IN_CAS, new String[] { this.getClass().getName() }); throw e; } boolean isSubtypeOfAnnotationBase = casImpl.isSubtypeOfAnnotationBaseType(jcasType.casTypeCode); if (isSubtypeOfAnnotationBase && (casImpl.getBaseCAS() == casImpl)) { throw new CASRuntimeException(CASRuntimeException.DISALLOW_CREATE_ANNOTATION_IN_BASE_CAS, new String[] { this.getClass().getName() }); } this.addr = jcasType.ll_cas.ll_createFS(jcasType.casTypeCode); jcas.putJfsFromCaddr(addr, this); if (casImpl.isSubtypeOfAnnotationBaseType(jcasType.casTypeCode)) { casImpl.setSofaFeat(addr, casImpl.getSofaRef()); } }