@Override public Value add(Value v) { ValueFloat v2 = (ValueFloat) v; return ValueFloat.get(value + v2.value); }
@Override public Value modulus(Value v) { ValueFloat other = (ValueFloat) v; if (other.value == 0) { throw DbException.get(ErrorCode.DIVISION_BY_ZERO_1, getSQL()); } return ValueFloat.get(value % other.value); }
@Override public Value multiply(Value v) { ValueFloat v2 = (ValueFloat) v; return ValueFloat.get(value * v2.value); }
@Override public Value divide(Value v) { ValueFloat v2 = (ValueFloat) v; if (v2.value == 0.0) { throw DbException.get(ErrorCode.DIVISION_BY_ZERO_1, getSQL()); } return ValueFloat.get(value / v2.value); }
@Override public Value negate() { return ValueFloat.get(-value); }
@Override public Value subtract(Value v) { ValueFloat v2 = (ValueFloat) v; return ValueFloat.get(value - v2.value); }
/** * Updates a column in the current or insert row. * * @param columnIndex (1,2,...) * @param x the value * @throws SQLException if the result set is closed or not updatable */ @Override public void updateFloat(int columnIndex, float x) throws SQLException { try { if (isDebugEnabled()) { debugCode("updateFloat(" + columnIndex + ", " + x + "f);"); } update(columnIndex, ValueFloat.get(x)); } catch (Exception e) { throw logAndConvert(e); } }
/** * Sets the value of a parameter. * * @param parameterIndex the parameter index (1, 2, ...) * @param x the value * @throws SQLException if this object is closed */ @Override public void setFloat(int parameterIndex, float x) throws SQLException { try { if (isDebugEnabled()) { debugCode("setFloat(" + parameterIndex + ", " + x + "f);"); } setParameter(parameterIndex, ValueFloat.get(x)); } catch (Exception e) { throw logAndConvert(e); } }
/** * Updates a column in the current or insert row. * * @param columnLabel the column label * @param x the value * @throws SQLException if the result set is closed or not updatable */ @Override public void updateFloat(String columnLabel, float x) throws SQLException { try { if (isDebugEnabled()) { debugCode("updateFloat(" + quote(columnLabel) + ", " + x + "f);"); } update(columnLabel, ValueFloat.get(x)); } catch (Exception e) { throw logAndConvert(e); } }
float value = rs.getFloat(columnIndex); v = rs.wasNull() ? (Value) ValueNull.INSTANCE : ValueFloat.get(value); break;
return ValueShort.get(((Short) x).shortValue()); } else if (x instanceof Float) { return ValueFloat.get(((Float) x).floatValue()); } else if (x instanceof Double) { return ValueDouble.get(((Double) x).doubleValue());
switch (getType()) { case BOOLEAN: return ValueFloat.get(getBoolean().booleanValue() ? 1 : 0); case BYTE: return ValueFloat.get(getByte()); case SHORT: return ValueFloat.get(getShort()); case INT: return ValueFloat.get(getInt()); case LONG: return ValueFloat.get(getLong()); case DECIMAL: return ValueFloat.get(getBigDecimal().floatValue()); case DOUBLE: return ValueFloat.get((float) getDouble()); return ValueDouble.get(Double.parseDouble(s.trim())); case FLOAT: return ValueFloat.get(Float.parseFloat(s.trim())); case CLOB: return ValueLobDb.createSmallLob(