@Override public final void ll_setStringValue(int fsRef, int featureCode, String value, boolean doTypeChecks) { if (doTypeChecks) { checkNonArrayConditions(fsRef, TypeSystemImpl.stringTypeCode, featureCode); } ll_setStringValue(fsRef, featureCode, value); }
public void addSofa(FeatureStructure sofa, String sofaName, String mimeType) { if (this.svd.sofaNameSet.contains(sofaName)) { CASRuntimeException e = new CASRuntimeException(CASRuntimeException.SOFANAME_ALREADY_EXISTS, new String[] { sofaName }); throw e; } final int llsofa = ll_getFSRef(sofa); if (0 == ll_getIntValue(llsofa, TypeSystemImpl.sofaNumFeatCode)) { ll_setIntValue(llsofa, TypeSystemImpl.sofaNumFeatCode, ++this.svd.viewCount); } ll_setStringValue(llsofa, TypeSystemImpl.sofaIdFeatCode, sofaName); ll_setStringValue(llsofa, TypeSystemImpl.sofaMimeFeatCode, mimeType); this.getBaseIndexRepository().addFS(sofa); this.svd.sofaNameSet.add(sofaName); }
public int ll_createDocumentAnnotationNoIndex(int begin, int end) { final TypeSystemImpl ts = this.svd.casMetadata.ts; int fsRef = ll_createAnnotation(ts.docType.getCode(), begin, end); ll_setStringValue(fsRef, ts.langFeat.getCode(), CAS.DEFAULT_LANGUAGE_NAME); return fsRef; }
@Override public void setSofaDataArray(FeatureStructure array, String mime) throws CASRuntimeException { if (this == this.svd.baseCAS) { CASRuntimeException e = new CASRuntimeException(CASRuntimeException.INVALID_BASE_CAS_METHOD, new String[] { "setSofaDataArray(FeatureStructure, mime)" }); throw e; } if (!mySofaIsValid()) { this.createInitialSofa(null); } // try to put the document into the SofaString ... // ... will fail if previously set getSofa(this.mySofaRef).setLocalSofaData(array); ll_setStringValue(this.mySofaRef, TypeSystemImpl.sofaMimeFeatCode, mime); }
@Override public void setSofaDataString(String text, String mime) throws CASRuntimeException { if (this == this.svd.baseCAS) { CASRuntimeException e = new CASRuntimeException(CASRuntimeException.INVALID_BASE_CAS_METHOD, new String[] { "setDocumentText(String)" }); throw e; } if (!mySofaIsValid()) { this.createInitialSofa(null); } // try to put the document into the SofaString ... // ... will fail if previously set getSofa(this.mySofaRef).setLocalSofaData(text); ll_setStringValue(this.mySofaRef, TypeSystemImpl.sofaMimeFeatCode, mime); }
@Override public void setSofaDataURI(String uri, String mime) throws CASRuntimeException { if (this == this.svd.baseCAS) { CASRuntimeException e = new CASRuntimeException(CASRuntimeException.INVALID_BASE_CAS_METHOD, new String[] { "setSofaDataURI(String, String)" }); throw e; } if (!mySofaIsValid()) { this.createInitialSofa(null); } // try to put the document into the SofaString ... // ... will fail if previously set getSofa(this.mySofaRef).setRemoteSofaURI(uri); ll_setStringValue(this.mySofaRef, TypeSystemImpl.sofaMimeFeatCode, mime); }
void setDocTextFromDeserializtion(String text) { if (mySofaIsValid()) { final int SofaStringCode = ll_getTypeSystem().ll_getCodeForFeature( this.getTypeSystem().getFeatureByFullName(CAS.FEATURE_FULL_NAME_SOFASTRING)); ll_setStringValue(this.getSofaRef(), SofaStringCode, text); } }
private static void forceSetFeatureValue(FeatureStructure aFS, String aFeatureName, String aValue) { CASImpl casImpl = (CASImpl) aFS.getCAS().getLowLevelCAS(); TypeSystemImpl ts = (TypeSystemImpl) aFS.getCAS().getTypeSystem(); Feature feat = aFS.getType().getFeatureByBaseName(aFeatureName); int featCode = ((FeatureImpl) feat).getCode(); int thisType = ((TypeImpl) aFS.getType()).getCode(); if (!ts.isApprop(thisType, featCode)) { throw new IllegalArgumentException("Feature structure does not have that feature"); } if (!ts.subsumes(ts.getType(CAS.TYPE_NAME_STRING), feat.getRange())) { throw new IllegalArgumentException("Not a string feature!"); } casImpl.ll_setStringValue(casImpl.ll_getFSRef(aFS), featCode, aValue); }
private static void forceSetFeatureValue(FeatureStructure aFS, String aFeatureName, String aValue) { CASImpl casImpl = (CASImpl) aFS.getCAS().getLowLevelCAS(); TypeSystemImpl ts = (TypeSystemImpl) aFS.getCAS().getTypeSystem(); Feature feat = aFS.getType().getFeatureByBaseName(aFeatureName); int featCode = ((FeatureImpl) feat).getCode(); int thisType = ((TypeImpl) aFS.getType()).getCode(); if (!ts.isApprop(thisType, featCode)) { throw new IllegalArgumentException("Feature structure does not have that feature"); } if (!ts.subsumes(ts.getType(CAS.TYPE_NAME_STRING), feat.getRange())) { throw new IllegalArgumentException("Not a string feature!"); } casImpl.ll_setStringValue(casImpl.ll_getFSRef(aFS), featCode, aValue); }
case FRC_STRING: tgtCasViewImpl.ll_setStringValue(tgtFS, tgtFeatCode, srcCasViewImpl.ll_getStringValueFeatOffset(srcFS, srcFeatOffset)); break; case FRC_INT_LIKE: