/** * @see org.apache.uima.cas.text.AnnotationFS#getBegin() */ public int getBegin() { return this.casImpl.getFeatureValue(addr, TypeSystemImpl.startFeatCode); // return ((CASImpl) this.casImpl).getStartFeat(this.addr); }
/** * @see org.apache.uima.cas.text.AnnotationFS#getEnd() */ public int getEnd() { return this.casImpl.getFeatureValue(addr, TypeSystemImpl.endFeatCode); // return ((CASImpl) this.casImpl).getEndFeat(this.addr); }
public int getSofaFeat(int addr) { return getFeatureValue(addr, TypeSystemImpl.annotSofaFeatCode); }
public float getFloatValue(int addr, int feat) { return Float.intBitsToFloat(getFeatureValue(addr, feat)); }
return 0; int i1 = this.cas.getFeatureValue(addr1, this.startCode); int i2 = this.cas.getFeatureValue(addr2, this.startCode); if (i1 < i2) { return -1; return 1; } else { // Start positions are equal. i1 = this.cas.getFeatureValue(addr1, this.endCode); i2 = this.cas.getFeatureValue(addr2, this.endCode); if (i1 > i2) { return -1;
/** * * @param sofaNum 1 if sofa null, or the sofa Xmi Id * @return the FS Repository associated with the sofa xmiId * @throws XCASParsingException */ private FSIndexRepositoryImpl getIndexRepo(String sofa, int sofaXmiId) throws XCASParsingException { // a view with no Sofa will be added to the 1st, _InitialView, index if (sofa == null) { return (FSIndexRepositoryImpl) indexRepositories.get(1); } // translate sofa's xmi:id into its sofanum int sofaAddr; try { sofaAddr = getFsAddrForXmiId(sofaXmiId); } catch (NoSuchElementException e) { throw createException(XCASParsingException.UNKNOWN_ID, Integer.toString(sofaXmiId)); } int sofaNum = casBeingFilled.getFeatureValue(sofaAddr, sofaNumFeatCode); return (FSIndexRepositoryImpl) indexRepositories.get(sofaNum); }
feat = feats[i]; if (cas.ll_isRefType(ts.range(feats[i]))) { int featVal = cas.getFeatureValue(addr, feat); fsValInfo = fsTree.get(featVal); if (fsValInfo == null) {
featName.equals(CAS.FEATURE_BASE_NAME_SOFAURI) || featName.equals(CAS.FEATURE_BASE_NAME_SOFAARRAY)) { int currVal = casBeingFilled.getFeatureValue(fsAddr, feat.getCode()); if (currVal != 0) return feat.getCode();
private void remapFSListHeads(int addr) throws SAXParseException { final int type = casBeingFilled.getHeapValue(addr); if (!listUtils.isFsListType(type)) return; int[] feats = casBeingFilled.getTypeSystemImpl().ll_getAppropriateFeatures(type); if (feats.length == 0) return; int headFeat = feats[0]; int featVal = casBeingFilled.getFeatureValue(addr, headFeat); if (featVal != CASImpl.NULL) { int fsValAddr = CASImpl.NULL; try { fsValAddr = getFsAddrForXmiId(featVal); } catch (NoSuchElementException e) { if (!lenient) { throw createException(XCASParsingException.UNKNOWN_ID, Integer.toString(featVal)); } else { //this may be a reference to an out-of-typesystem FS this.sharedData.addOutOfTypeSystemAttribute(addr, CAS.FEATURE_BASE_NAME_HEAD, Integer.toString(featVal)); } } casBeingFilled.setFeatureValue(addr, headFeat, fsValAddr); } }
final FeatureImpl sofaNumFeat = (FeatureImpl) sofaType .getFeatureByBaseName(CAS.FEATURE_BASE_NAME_SOFANUM); int sofaNum = cas.getFeatureValue(addr, sofaNumFeat.getCode()); cas.setFeatureValue(addr, sofaNumFeat.getCode(), this.indexMap.get(sofaNum));
int sofaNum = casBeingFilled.getFeatureValue(sofaAddr, sofaNumFeatCode); casBeingFilled.setFeatureValue(addr, featCode, sofaNum); } else { int currFeatVal = casBeingFilled.getFeatureValue(addr, featCode); int casArray = 0; casArray = createByteArray(featVal,-1,currFeatVal);
&& (featureType[feats[i]] == LowLevelCAS.TYPE_CLASS_FS || feat .isMultipleReferencesAllowed())) { int featVal = casBeingFilled.getFeatureValue(addr, feats[i]); if (featVal != CASImpl.NULL ) { int fsValAddr = CASImpl.NULL;
case LowLevelCAS.TYPE_CLASS_FSARRAY: { int casArray = 0; int currVal = casBeingFilled.getFeatureValue(addr, featCode); casArray = createArray(casBeingFilled.getTypeSystemImpl().range(featCode), featVals, -1, currVal); if (currVal != casArray) { int listFS = casBeingFilled.getFeatureValue(addr, featCode); if (listFS == 0) { listFS = listUtils.createIntList(featVals); int listFS = casBeingFilled.getFeatureValue(addr, featCode); if (listFS == 0) { listFS = listUtils.createFloatList(featVals); int listFS = casBeingFilled.getFeatureValue(addr, featCode); if (listFS == 0) { listFS = listUtils.createStringList(featVals); int listFS = casBeingFilled.getFeatureValue(addr, featCode); IntVector fslistnodes = new IntVector(); if (listFS == 0) {
public int getIntValue(Feature feat) { final TypeSystemImpl ts = this.getCASImpl().getTypeSystemImpl(); if (!ts.subsumes(feat.getDomain(), getType())) { // System.out.println( // "Domain: " // + feat.getDomain().getName() // + ", type: " // + getType().getName()); throwUndefinedFeatureExc(feat, getType()); } if (!ts.subsumes(feat.getRange(), ts.getType(CAS.TYPE_NAME_INTEGER))) { throwIllegalRangeExc(feat, ts.getType(CAS.TYPE_NAME_INTEGER)); } final int featCode = ((FeatureImpl) feat).getCode(); return this.getCASImpl().getFeatureValue(this.getAddress(), featCode); }
public FeatureStructure getFeatureValue(Feature feat) throws CASRuntimeException { final TypeSystemImpl ts = this.getCASImpl().getTypeSystemImpl(); // final int featCode = ts.getFeatureCode(feat.getName()); final int featCode = ((FeatureImpl) feat).getCode(); // assert(featCode > 0); if (!ts.isApprop(this.getCASImpl().getHeapValue(this.getAddress()), featCode)) { CASRuntimeException e = new CASRuntimeException(CASRuntimeException.INAPPROP_FEAT, new String[] { feat.getName(), this.getType().getName() }); throw e; } // Check that feature value is not primitive. final int rangeTypeCode = ts.ll_getRangeType(featCode); if (!this.getCASImpl().ll_isRefType(rangeTypeCode)) { CASRuntimeException e = new CASRuntimeException(CASRuntimeException.PRIMITIVE_VAL_FEAT, new String[] { feat.getName() }); throw e; } final int valAddr = this.getCASImpl().getFeatureValue(this.getAddress(), featCode); // assert(valAddr > 0); return this.getCASImpl().createFS(valAddr); }