@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 void write(DataBuffer buff, Object obj) { Timestamp t = (Timestamp) obj; writeValue(buff, ValueTimestamp.get(t)); }
@Override public void writeValue(DataBuffer buff, Value v) { BigDecimal x = v.getBigDecimal(); write0(buff, x); }
@Override public void write(DataBuffer buff, Object obj) { Time t = (Time) obj; writeValue(buff, ValueTime.get(t)); }
/** * Get or create a date value for the given date. * * @param dateValue the date value * @param nanos the nanoseconds * @return the value */ public static ValueTimestamp fromDateValueAndNanos(long dateValue, long nanos) { return (ValueTimestamp) Value.cache(new ValueTimestamp(dateValue, nanos)); }
/** * 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)); }