@Override public final void ll_setShortValue(int fsRef, int featureCode, short value) { setFeatureValue(fsRef, featureCode, value); }
@Override public final void ll_setByteValue(int fsRef, int featureCode, byte value) { setFeatureValue(fsRef, featureCode, value); }
@Override public final void ll_setIntValue(int fsRef, int featureCode, int value) { setFeatureValue(fsRef, featureCode, value); }
@Override public void ll_setBooleanValue(int fsRef, int featureCode, boolean value) { setFeatureValue(fsRef, featureCode, value ? CASImpl.TRUE : CASImpl.FALSE); }
public void setFeatureValue(int addr, int feat, boolean v) { setFeatureValue(addr, feat, v ? CASImpl.TRUE : CASImpl.FALSE); }
public void setFeatureValue(int addr, int feat, short s) { setFeatureValue(addr, feat, (int) s); }
public void setFeatureValue(int addr, int feat, byte v) { setFeatureValue(addr, feat, (int) v); }
public void setFloatValue(int addr, int feat, float f) { final int floatCode = Float.floatToIntBits(f); setFeatureValue(addr, feat, floatCode); }
@Override public final void ll_setFloatValue(int fsRef, int featureCode, float value) { setFeatureValue(fsRef, featureCode, float2int(value)); }
@Override public void ll_setDoubleValue(int fsRef, int featureCode, double value) { long val = Double.doubleToLongBits(value); final int offset = this.getLongHeap().addLong(val); setFeatureValue(fsRef, featureCode, offset); }
@Override public void ll_setLongValue(int fsRef, int featureCode, long value) { final int offset = this.getLongHeap().addLong(value); setFeatureValue(fsRef, featureCode, offset); }
public void setStringValue(int addr, int feat, String s) { final int stringCode = ((s == null) ? NULL : this.getStringHeap().addString(s)); setFeatureValue(addr, feat, stringCode); }
public void setFeatureValueFromString(int fsref, int feat, String value) { final TypeSystemImpl ts = this.svd.casMetadata.ts; int typeCode = (ts.range(feat)); if (typeCode == TypeSystemImpl.intTypeCode) { this.ll_setIntValue(fsref, feat, Integer.parseInt(value)); } else if (typeCode == TypeSystemImpl.floatTypeCode) { this.setFloatValue(fsref, feat, Float.parseFloat(value)); } else if (ts.subsumes(TypeSystemImpl.stringTypeCode, typeCode)) { this.setStringValue(fsref, feat, value); } else if (typeCode == TypeSystemImpl.booleanTypeCode) { this.setFeatureValue(fsref, feat, Boolean.valueOf(value).booleanValue()); } else if (typeCode == TypeSystemImpl.byteTypeCode) { this.setFeatureValue(fsref, feat, Byte.parseByte(value)); } else if (typeCode == TypeSystemImpl.shortTypeCode) { this.setFeatureValue(fsref, feat, Short.parseShort(value)); } else if (typeCode == TypeSystemImpl.longTypeCode) { this.setFeatureValue(fsref, feat, Long.parseLong(value)); } else if (typeCode == TypeSystemImpl.doubleTypeCode) { this.setFeatureValue(fsref, feat, Double.parseDouble(value)); } else { CASRuntimeException e = new CASRuntimeException(CASRuntimeException.INAPPROP_TYPE, new String[] { ts.ll_getFeatureForCode(feat).getName(), ts.ll_getTypeForCode(typeCode).getName() }); throw e; } }
@Override public final void ll_setStringValue(int fsRef, int featureCode, String value) { if (null != value) { final TypeSystemImpl ts = this.svd.casMetadata.ts; String[] stringSet = ts.ll_getStringSet(ts.ll_getRangeType(featureCode)); if (stringSet != null) { final int rc = Arrays.binarySearch(stringSet, value); if (rc < 0) { // Not a legal value. CASRuntimeException e = new CASRuntimeException(CASRuntimeException.ILLEGAL_STRING_VALUE, new String[] { value, ts.ll_getTypeForCode(ts.ll_getRangeType(featureCode)).getName() }); throw e; } } } final int stringAddr = (value == null) ? NULL : this.getStringHeap().addString(value); setFeatureValue(fsRef, featureCode, stringAddr); }
public void setBooleanValue(Feature feat, boolean b) throws CASRuntimeException { final TypeSystemImpl ts = this.getCASImpl().getTypeSystemImpl(); if (!ts.subsumes(((TypeImpl) feat.getDomain()).getCode(), this.getCASImpl().getHeapValue( this.getAddress()))) { throwUndefinedFeatureExc(feat, getType()); } if (!ts.subsumes(((TypeImpl) feat.getRange()).getCode(), ((TypeImpl) ts .getType(CAS.TYPE_NAME_BOOLEAN)).getCode())) { throwIllegalRangeExc(feat, ts.getType(CAS.TYPE_NAME_BOOLEAN)); } final int featCode = ((FeatureImpl) feat).getCode(); this.getCASImpl().setFeatureValue(this.getAddress(), featCode, b); }
public void setLongValue(Feature feat, long val) throws CASRuntimeException { final TypeSystemImpl ts = this.getCASImpl().getTypeSystemImpl(); if (!ts.subsumes(((TypeImpl) feat.getDomain()).getCode(), this.getCASImpl().getHeapValue( this.getAddress()))) { throwUndefinedFeatureExc(feat, getType()); } if (!ts.subsumes(((TypeImpl) feat.getRange()).getCode(), ((TypeImpl) ts .getType(CAS.TYPE_NAME_LONG)).getCode())) { throwIllegalRangeExc(feat, ts.getType(CAS.TYPE_NAME_LONG)); } final int featCode = ((FeatureImpl) feat).getCode(); this.getCASImpl().setFeatureValue(this.getAddress(), featCode, val); }
public void setDoubleValue(Feature feat, double val) throws CASRuntimeException { final TypeSystemImpl ts = this.getCASImpl().getTypeSystemImpl(); if (!ts.subsumes(((TypeImpl) feat.getDomain()).getCode(), this.getCASImpl().getHeapValue( this.getAddress()))) { throwUndefinedFeatureExc(feat, getType()); } if (!ts.subsumes(((TypeImpl) feat.getRange()).getCode(), ((TypeImpl) ts .getType(CAS.TYPE_NAME_DOUBLE)).getCode())) { throwIllegalRangeExc(feat, ts.getType(CAS.TYPE_NAME_DOUBLE)); } final int featCode = ((FeatureImpl) feat).getCode(); this.getCASImpl().setFeatureValue(this.getAddress(), featCode, val); }
public void setShortValue(Feature feat, short val) throws CASRuntimeException { final TypeSystemImpl ts = this.getCASImpl().getTypeSystemImpl(); if (!ts.subsumes(((TypeImpl) feat.getDomain()).getCode(), this.getCASImpl().getHeapValue( this.getAddress()))) { throwUndefinedFeatureExc(feat, getType()); } if (!ts.subsumes(((TypeImpl) feat.getRange()).getCode(), ((TypeImpl) ts .getType(CAS.TYPE_NAME_SHORT)).getCode())) { throwIllegalRangeExc(feat, ts.getType(CAS.TYPE_NAME_SHORT)); } final int featCode = ((FeatureImpl) feat).getCode(); this.getCASImpl().setFeatureValue(this.getAddress(), featCode, val); }
public void setIntValue(Feature feat, int val) { final TypeSystemImpl ts = this.getCASImpl().getTypeSystemImpl(); if (!ts.subsumes(((TypeImpl) feat.getDomain()).getCode(), this.getCASImpl().getHeapValue( this.getAddress()))) { throwUndefinedFeatureExc(feat, getType()); } if (!ts.subsumes(((TypeImpl) feat.getRange()).getCode(), ((TypeImpl) ts .getType(CAS.TYPE_NAME_INTEGER)).getCode())) { throwIllegalRangeExc(feat, ts.getType(CAS.TYPE_NAME_INTEGER)); } final int featCode = ((FeatureImpl) feat).getCode(); this.getCASImpl().setFeatureValue(this.getAddress(), featCode, val); }
public void setByteValue(Feature feat, byte val) throws CASRuntimeException { final TypeSystemImpl ts = this.getCASImpl().getTypeSystemImpl(); if (!ts.subsumes(((TypeImpl) feat.getDomain()).getCode(), this.getCASImpl().getHeapValue( this.getAddress()))) { throwUndefinedFeatureExc(feat, getType()); } if (!ts.subsumes(((TypeImpl) feat.getRange()).getCode(), ((TypeImpl) ts .getType(CAS.TYPE_NAME_BYTE)).getCode())) { throwIllegalRangeExc(feat, ts.getType(CAS.TYPE_NAME_BYTE)); } final int featCode = ((FeatureImpl) feat).getCode(); this.getCASImpl().setFeatureValue(this.getAddress(), featCode, val); }