@Override public int getMemory() { if (value == null) { return DataType.getDataType(getType()).memory; } int mem = super.getMemory(); if (javaObject != null) { mem *= 2; } return mem; }
/** * Get the memory used by this object. * * @return the memory used in bytes */ public int getMemory() { return DataType.getDataType(getType()).memory; }
@Override public Value negate() { if (value == Long.MIN_VALUE) { throw getOverflow(); } return ValueLong.get(-value); }
/** * Get or create a short value for the given short. * * @param i the short * @return the value */ public static ValueShort get(short i) { return (ValueShort) Value.cache(new ValueShort(i)); }
@Override public Value add(Value v) { ValueDouble v2 = (ValueDouble) v; return ValueDouble.get(value + v2.value); }
@Override public Value multiply(Value v) { ValueFloat v2 = (ValueFloat) v; return ValueFloat.get(value * v2.value); }
@Override public Object getObject() { if (type == Value.CLOB) { return getReader(); } return getInputStream(); }
@Override public boolean equals(Object other) { if (!(other instanceof ValueDouble)) { return false; } return compareSecure((ValueDouble) other, null) == 0; }
/** * Get or create a array value for the given value array. * Do not clone the data. * * @param list the value array * @return the value */ public static ValueArray get(Value[] list) { return new ValueArray(list); }
/** * Multiply with a value and return the result. * * @param v the value to multiply with * @return the result */ public Value multiply(Value v) { throw throwUnsupportedExceptionForType("*"); }
@Override public Value add(Value v) { ValueInt other = (ValueInt) v; return checkRange((long) value + (long) other.value); }
@Override public Value multiply(Value v) { ValueShort other = (ValueShort) v; return checkRange(value * other.value); }