/** {@inheritDoc} */ @Override public Value value(GridKernalContext ctx) { return ValueByte.get(x); }
@Override public Value modulus(Value v) { ValueByte other = (ValueByte) v; if (other.value == 0) { throw DbException.get(ErrorCode.DIVISION_BY_ZERO_1, getSQL()); } return ValueByte.get((byte) (value % other.value)); }
@Override public Value divide(Value v) { ValueByte other = (ValueByte) v; if (other.value == 0) { throw DbException.get(ErrorCode.DIVISION_BY_ZERO_1, getSQL()); } return ValueByte.get((byte) (value / other.value)); }
private static ValueByte checkRange(int x) { if (x < Byte.MIN_VALUE || x > Byte.MAX_VALUE) { throw DbException.get(ErrorCode.NUMERIC_VALUE_OUT_OF_RANGE_1, Integer.toString(x)); } return ValueByte.get((byte) x); }
@Override public Value divide(Value v) { ValueByte other = (ValueByte) v; if (other.value == 0) { throw DbException.get(ErrorCode.DIVISION_BY_ZERO_1, getSQL()); } return ValueByte.get((byte) (value / other.value)); }
@Override public Value modulus(Value v) { ValueByte other = (ValueByte) v; if (other.value == 0) { throw DbException.get(ErrorCode.DIVISION_BY_ZERO_1, getSQL()); } return ValueByte.get((byte) (value % other.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 updateByte(int columnIndex, byte x) throws SQLException { try { if (isDebugEnabled()) { debugCode("updateByte("+columnIndex+", "+x+");"); } update(columnIndex, ValueByte.get(x)); } catch (Exception e) { throw logAndConvert(e); } }
@Override public Value divide(Value v) { ValueByte other = (ValueByte) v; if (other.value == 0) { throw DbException.get(ErrorCode.DIVISION_BY_ZERO_1, getSQL()); } return ValueByte.get((byte) (value / other.value)); }
/** * 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 setByte(int parameterIndex, byte x) throws SQLException { try { if (isDebugEnabled()) { debugCode("setByte("+parameterIndex+", "+x+");"); } setParameter(parameterIndex, ValueByte.get(x)); } catch (Exception e) { throw logAndConvert(e); } }
public Value divide(Value v) throws SQLException { ValueByte other = (ValueByte) v; if (other.value == 0) { throw Message.getSQLException(ErrorCode.DIVISION_BY_ZERO_1, getSQL()); } return ValueByte.get((byte) (value / other.value)); }
/** * 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 updateByte(String columnLabel, byte x) throws SQLException { try { if (isDebugEnabled()) { debugCode("updateByte("+columnLabel+", "+x+");"); } update(columnLabel, ValueByte.get(x)); } catch (Exception e) { throw logAndConvert(e); } }
byte value = rs.getByte(columnIndex); v = rs.wasNull() ? (Value) ValueNull.INSTANCE : ValueByte.get(value); break;
return ValueBoolean.get((Boolean)obj); case Value.BYTE: return ValueByte.get((Byte)obj); case Value.SHORT: return ValueShort.get((Short)obj);
return ValueBoolean.get(((Boolean) x).booleanValue()); } else if (x instanceof Byte) { return ValueByte.get(((Byte) x).byteValue()); } else if (x instanceof Short) { return ValueShort.get(((Short) x).shortValue());
return ValueByte.get(PageUtils.getByte(pageAddr, off + 1));
return ValueLong.get(readVarLong(buff)); case Value.BYTE: return ValueByte.get(buff.get()); case Value.SHORT: return ValueShort.get(buff.getShort());
public Value add(Value v) throws SQLException { ValueByte other = (ValueByte) v; if (SysProperties.OVERFLOW_EXCEPTIONS) { return checkRange(value + other.value); } return ValueByte.get((byte) (value + other.value)); }
private static ValueByte checkRange(int x) { if (x < Byte.MIN_VALUE || x > Byte.MAX_VALUE) { throw DbException.get(ErrorCode.NUMERIC_VALUE_OUT_OF_RANGE_1, Integer.toString(x)); } return ValueByte.get((byte) x); }
private static ValueByte checkRange(int x) { if (x < Byte.MIN_VALUE || x > Byte.MAX_VALUE) { throw DbException.get(ErrorCode.NUMERIC_VALUE_OUT_OF_RANGE_1, Integer.toString(x)); } return ValueByte.get((byte) x); }