@Override public FeatureStructure getFeatureStructure(MatchContext context, RutaStream stream) { Integer ref = Integer.valueOf(address); CAS cas = stream.getCas(); if (cas instanceof CASImpl) { CASImpl casImpl = (CASImpl) cas; LowLevelCAS lowLevelCAS = casImpl.getLowLevelCAS(); FeatureStructure fs = lowLevelCAS.ll_getFSForRef(ref); return fs; } return null; }
private void updateExistingArray(int arrayType, List<String> values, int casArray) { for (int i = 0; i < values.size(); i++) { String stringVal = values.get(i); if (casBeingFilled.isStringArrayType(arrayType)) { String currVal = casBeingFilled.getLowLevelCAS().ll_getStringArrayValue(casArray, i); if (currVal != null && currVal.equals(stringVal)) { continue; } } casBeingFilled.setArrayValueFromString(casArray, i, stringVal); } }
public int getSofaRef() { final Feature numFeat = jcasType.casImpl.getTypeSystem().getFeatureByFullName( CAS.FEATURE_FULL_NAME_SOFANUM); return jcasType.casImpl.getLowLevelCAS().ll_getIntValue(super.addr, ((FeatureImpl) numFeat).getCode()); }
public String getSofaMime() { final Feature mimeFeat = this.casImpl.getTypeSystem().getFeatureByFullName( CAS.FEATURE_FULL_NAME_SOFAMIME); return this.casImpl.getLowLevelCAS().ll_getStringValue(super.addr, ((FeatureImpl) mimeFeat).getCode()); }
public String getSofaURI() { final Feature uriFeat = this.casImpl.getTypeSystem().getFeatureByFullName( CAS.FEATURE_FULL_NAME_SOFAURI); return this.casImpl.getLowLevelCAS().ll_getStringValue(super.addr, ((FeatureImpl) uriFeat).getCode()); }
public int getSofaRef() { final Feature numFeat = this.casImpl.getTypeSystem().getFeatureByFullName( CAS.FEATURE_FULL_NAME_SOFANUM); return this.casImpl.getLowLevelCAS().ll_getIntValue(super.addr, ((FeatureImpl) numFeat).getCode()); }
public String getSofaMime() { final Feature mimeFeat = jcasType.casImpl.getTypeSystem().getFeatureByFullName( CAS.FEATURE_FULL_NAME_SOFAMIME); return jcasType.casImpl.getLowLevelCAS().ll_getStringValue(super.addr, ((FeatureImpl) mimeFeat).getCode()); }
public String getSofaURI() { final Feature uriFeat = jcasType.casImpl.getTypeSystem().getFeatureByFullName( CAS.FEATURE_FULL_NAME_SOFAURI); return jcasType.casImpl.getLowLevelCAS().ll_getStringValue(super.addr, ((FeatureImpl) uriFeat).getCode()); }
int casArray = -1; if (addr > 0) { //non-shared preexisting if (values.size() == casBeingFilled.getLowLevelCAS().ll_getArraySize(addr)) { casArray = addr; updateExistingArray(arrayType, values, casArray); } else { //shared preexisting casArray = getFsAddrForXmiId(xmiId); if (values.size() == casBeingFilled.getLowLevelCAS().ll_getArraySize(casArray)) { updateExistingArray(arrayType, values, casArray); } else {
private final void getPrintRefs(PrintReferences printRefs, int ref) { boolean seenBefore = printRefs.addReference(ref); if (seenBefore) { return; } LowLevelCAS llcas = this.getCASImpl().getLowLevelCAS(); LowLevelTypeSystem llts = llcas.ll_getTypeSystem(); final int typeCode; try { typeCode = llcas.ll_getFSRefType(ref, true); } catch (LowLevelException e) { return; // can't find ref, may be invalid or null } int[] feats = llts.ll_getAppropriateFeatures(typeCode); for (int i = 0; i < feats.length; i++) { if (llcas.ll_isRefType(llts.ll_getRangeType(feats[i]))) { int valRef = llcas.ll_getRefValue(ref, feats[i]); if (valRef != LowLevelCAS.NULL_FS_REF) { getPrintRefs(printRefs, valRef); } } } }