void setNewValueInNewNode(int newNode, List<String> stringValues, int i) { float value = Float.parseFloat(stringValues.get(i)); cas.setFeatureValueNoIndexCorruptionCheck(newNode, floatHeadFeat, CASImpl.float2int(value)); } }
@Override public final void ll_setFloatValue(int fsRef, int featureCode, float value) { setFeatureValue(fsRef, featureCode, float2int(value)); }
public int createFloatList(List<String> stringValues) { int first = cas.ll_createFS(eFloatListType); ListIterator<String> iter = stringValues.listIterator(stringValues.size()); while (iter.hasPrevious()) { float value = Float.parseFloat(iter.previous()); int node = cas.ll_createFS(neFloatListType); cas.setFeatureValueNotJournaled(node, floatHeadFeat, CASImpl.float2int(value)); cas.setFeatureValueNotJournaled(node, floatTailFeat, first); first = node; } return first; }
/** * @see org.apache.uima.cas.FloatArrayFS#copyFromArray(String[], int, int, int) */ public void copyFromArray(String[] src, int srcOffset, int destOffset, int length) { casImpl.checkArrayBounds(addr, destOffset, length); final int[] heap = casImpl.getHeap().heap; destOffset += casImpl.getArrayStartAddress(this.addr); for (int i = 0; i < length; i++) { heap[i + destOffset] = CASImpl.float2int(Float.parseFloat(src[i + srcOffset])); } } }
@Override public void ll_setFloatArrayValue(int fsRef, int position, float value) { final int pos = getArrayStartAddress(fsRef) + position; this.getHeap().heap[pos] = float2int(value); if (this.svd.trackingMark != null) { this.logFSUpdate(fsRef, pos,ModifiedHeap.FSHEAP, 1); } }
/** * @see org.apache.uima.cas.FloatArrayFS#copyFromArray(float[], int, int, int) */ public void copyFromArray(float[] src, int srcOffset, int destOffset, int length) { casImpl.checkArrayBounds(addr, destOffset, length); final int[] heap = this.casImpl.getHeap().heap; destOffset += this.casImpl.getArrayStartAddress(this.addr); for (int i = 0; i < length; i++) { heap[i + destOffset] = CASImpl.float2int(src[i + srcOffset]); } }
void setArrayValueFromString(final int addr, final int index, final String value) { int arrayType = this.getHeap().heap[addr]; if (arrayType == TypeSystemImpl.intArrayTypeCode) { setArrayValue(addr, index, Integer.parseInt(value)); } else if (arrayType == TypeSystemImpl.floatArrayTypeCode) { setArrayValue(addr, index, CASImpl.float2int(Float.parseFloat(value))); } else if (arrayType == TypeSystemImpl.stringArrayTypeCode) { setArrayValue(addr, index, addString(value)); } else if (arrayType == TypeSystemImpl.booleanArrayTypeCode) { ll_setBooleanArrayValue(addr, index, Boolean.valueOf(value).booleanValue()); } else if (arrayType == TypeSystemImpl.byteArrayTypeCode) { ll_setByteArrayValue(addr, index, Byte.parseByte(value)); } else if (arrayType == TypeSystemImpl.shortArrayTypeCode) { ll_setShortArrayValue(addr, index, Short.parseShort(value)); } else if (arrayType == TypeSystemImpl.longArrayTypeCode) { ll_setLongArrayValue(addr, index, Long.parseLong(value)); } else if (arrayType == TypeSystemImpl.doubleArrayTypeCode) { ll_setDoubleArrayValue(addr, index, Double.parseDouble(value)); } else if (arrayType == TypeSystemImpl.fsArrayTypeCode) { setArrayValue(addr, index, Integer.parseInt(value)); } }
makeNodes(arrayNodes, i -> new FSNode(this.fSTreeModel, nc, null, CASImpl.float2int(a[i]), i)); break; case Slot_Short: children.add(new FSNode(this.fSTreeModel, nc, null, fs.getShortValue(f), f)); break; case Slot_Int: children.add(new FSNode(this.fSTreeModel, nc, null, fs.getIntValue(f), f)); break; case Slot_Float: children.add(new FSNode(this.fSTreeModel, nc, null, CASImpl.float2int(fs.getFloatValue(f)), f)); break; case Slot_LongRef: children.add(new FSNode(this.fSTreeModel, nc, null, fs.getLongValue(f), f)); break; case Slot_DoubleRef:children.add(new FSNode(this.fSTreeModel, nc, null, CASImpl.double2long(fs.getDoubleValue(f)), f)); break;