@Override public int getMemory(Object obj) { return isBigInteger(obj) ? 100 : super.getMemory(obj); }
@Override public int getMemory(Object obj) { return isBigDecimal(obj) ? 150 : super.getMemory(obj); }
@Override public int compare(Object aObj, Object bObj) { if (isBigInteger(aObj) && isBigInteger(bObj)) { BigInteger a = (BigInteger) aObj; BigInteger b = (BigInteger) bObj; return a.compareTo(b); } return super.compare(aObj, bObj); }
@Override public int compare(Object aObj, Object bObj) { if (isBigDecimal(aObj) && isBigDecimal(bObj)) { BigDecimal a = (BigDecimal) aObj; BigDecimal b = (BigDecimal) bObj; return a.compareTo(b); } return super.compare(aObj, bObj); }
@Override public void write(WriteBuffer buff, Object[] obj, int len, boolean key) { for (int i = 0; i < len; i++) { write(buff, obj[i]); } }
@Override public void read(ByteBuffer buff, Object[] obj, int len, boolean key) { for (int i = 0; i < len; i++) { obj[i] = read(buff); } }
@Override public int getMemory(Object obj) { VersionedValue v = (VersionedValue) obj; return valueType.getMemory(v.value) + 8; }
@Override public void write(WriteBuffer buff, Object[] obj, int len, boolean key) { for (int i = 0; i < len; i++) { write(buff, obj[i]); } }
/** * Create a new transaction store. * * @param store the store */ public TransactionStore(MVStore store) { this(store, new ObjectDataType()); }
/** * Compare two keys. * * @param a the first key * @param b the second key * @return -1 if the first key is smaller, 1 if bigger, 0 if equal */ int compare(Object a, Object b) { return keyType.compare(a, b); }
@Override public void read(ByteBuffer buff, Object[] obj, int len, boolean key) { for (int i = 0; i < len; i++) { obj[i] = read(buff); } }
@Override public int compare(Object aObj, Object bObj) { if (aObj == null && bObj == null) { return 0; } else if (aObj == null) { return -1; } else if (bObj == null) { return 1; } return super.compare(aObj, bObj); }
/** * Get the type for the given object. * * @param o the object * @return the type */ AutoDetectDataType getType(Object o) { return base.switchType(o); }
@Override public void read(ByteBuffer buff, Object[] obj, int len, boolean key) { for (int i = 0; i < len; i++) { obj[i] = read(buff); } }
@Override public void write(WriteBuffer buff, Object[] obj, int len, boolean key) { for (int i = 0; i < len; i++) { write(buff, obj[i]); } }
@Override public int getMemory(Object obj) { return last.getMemory(obj); }
@Override public void write(WriteBuffer buff, Object obj) { last.write(buff, obj); }