@Override public final void ll_setRefValue(int fsRef, int featureCode, int value) { // no index check because refs can't be keys setFeatureValueNoIndexCorruptionCheck(fsRef, featureCode, value); }
public void setSofaFeat(int addr, int sofa) { // never an index key setFeatureValueNoIndexCorruptionCheck(addr, TypeSystemImpl.annotSofaFeatCode, sofa); }
void setNewValueInNewNode(int newNode, List<String> stringValues, int i) { int value = Integer.parseInt(stringValues.get(i)); cas.setFeatureValueNoIndexCorruptionCheck(newNode, intHeadFeat, value); } }
void setNewValueInNewNode(int newNode, List<String> stringValues, int i) { float value = Float.parseFloat(stringValues.get(i)); cas.setFeatureValueNoIndexCorruptionCheck(newNode, floatHeadFeat, CASImpl.float2int(value)); } }
void setNewValueInNewNode(int newNode, List<String> stringValues, int i) { String newValue = stringValues.get(i++); cas.setFeatureValueNoIndexCorruptionCheck(newNode, stringHeadFeat, cas.addString(newValue)); } }
void setNewValueInNewNode(int newNode, List<String> stringValues, int i) { int value = Integer.parseInt(stringValues.get(i)); cas.setFeatureValueNoIndexCorruptionCheck(newNode, fsHeadFeat, value); fsAddresses.add(newNode); } }
void setNewValueInExistingNode(int curNode, List<String> stringValues, int i) { String curValue = cas.getStringForCode(cas.getHeapValue(curNode + cas.getFeatureOffset(stringHeadFeat))); String newValue = stringValues.get(i++); if (!curValue.equals(newValue)) { cas.setFeatureValueNoIndexCorruptionCheck(curNode, stringHeadFeat, cas.addString(newValue)); } }
public void updateDocumentAnnotation() { if (!mySofaIsValid() || this == this.svd.baseCAS) { return; } String newDoc = ll_getSofaDataString(this.mySofaRef); if (null != newDoc) { final int docAnnot = ll_getDocumentAnnotation(); if (docAnnot != 0) { boolean wasRemoved = this.removeFromCorruptableIndexAnyViewSetCache(docAnnot, this.getAddbackSingle()); setFeatureValueNoIndexCorruptionCheck(docAnnot, TypeSystemImpl.endFeatCode, newDoc.length()); if (wasRemoved) { this.addbackSingle(docAnnot); } else { this.svd.fsTobeAddedbackSingleInUse = false; } } else { // not in the index (yet) createDocumentAnnotation(newDoc.length()); } } }
int newNode = cas.ll_createFS(neListType); actions.setNewValueInNewNode(newNode, stringValues, i++); cas.setFeatureValueNoIndexCorruptionCheck(newNode, tailFeat, emptyListFs); cas.setFeatureValueNoIndexCorruptionCheck(prevNode, tailFeat, newNode); prevNode = newNode; cas.setFeatureValueNoIndexCorruptionCheck(finalNode, tailFeat, curNode);
private final void setNullValue(int featCode, int rangeType) { if (this.getCASImpl().isIntType(rangeType) || this.getCASImpl().isFloatType(rangeType) || this.getCASImpl().isStringType(rangeType)) { CASRuntimeException e = new CASRuntimeException(CASRuntimeException.PRIMITIVE_VAL_FEAT, new String[] { this.getCASImpl().getTypeSystemImpl().ll_getFeatureForCode(featCode).getName() }); throw e; } // a null fsref is never an index key this.getCASImpl().setFeatureValueNoIndexCorruptionCheck(this.getAddress(), featCode, CASImpl.NULL); }
public void setFeatureValue(Feature feat, FeatureStructure fs) { final int valueAddr = this.getCASImpl().ll_getFSRef(fs); final int featCode = ((FeatureImpl) feat).getCode(); final int rangeType = this.getCASImpl().getTypeSystemImpl().range(featCode); if (valueAddr == CASImpl.NULL) { setNullValue(featCode, rangeType); return; } final int thisType = this.getCASImpl().getHeapValue(this.getAddress()); final int valueType = this.getCASImpl().getHeapValue(valueAddr); if (!this.getCASImpl().getTypeSystemImpl().isApprop(thisType, featCode)) { CASRuntimeException e = new CASRuntimeException(CASRuntimeException.INAPPROP_TYPE, new String[] { feat.getName(), this.getType().getName() }); throw e; } if (!this.getCASImpl().getTypeSystemImpl().subsumes(rangeType, valueType)) { CASRuntimeException e = new CASRuntimeException(CASRuntimeException.INAPPROP_RANGE, new String[] { feat.getName(), feat.getRange().getName(), fs.getType().getName() }); throw e; } // keys are not fsRefs this.getCASImpl().setFeatureValueNoIndexCorruptionCheck(this.getAddress(), featCode, valueAddr); }