@Override public boolean areValuesEqual(Object a, Object b) { if (a == b) { return true; } else if (a == null || b == null) { return false; } return valueType.compare(a, b) == 0; }
@Override public int compare(K k1, K k2) { return keyType.compare(k1, k2); } }
@Override public boolean areValuesEqual(Object a, Object b) { if (a == b) { return true; } else if (a == null || b == null) { return false; } return valueType.compare(a, b) == 0; }
@Override public int compare(Object aObj, Object bObj) { if (aObj == bObj) { return 0; } VersionedValue a = (VersionedValue) aObj; VersionedValue b = (VersionedValue) bObj; long comp = a.vertion - b.vertion; if (comp == 0) { return valueType.compare(a.value, b.value); } return Long.signum(comp); }
StorageDataType keyType = map.getKeyType(); while (low <= high) { int compare = keyType.compare(key, k[x]); if (compare > 0) { low = x + 1;
@SuppressWarnings("unchecked") @Override public int compare(Object aObj, Object bObj) { if (aObj == bObj) { return 0; } StorageDataType ta = getType(aObj); StorageDataType tb = getType(bObj); if (ta != this || tb != this) { if (ta == tb) { return ta.compare(aObj, bObj); } } // TODO ensure comparable type (both may be comparable but not // with each other) if (aObj instanceof Comparable) { if (aObj.getClass().isAssignableFrom(bObj.getClass())) { return ((Comparable<Object>) aObj).compareTo(bObj); } } if (bObj instanceof Comparable) { if (bObj.getClass().isAssignableFrom(aObj.getClass())) { return -((Comparable<Object>) bObj).compareTo(aObj); } } byte[] a = serialize(aObj); byte[] b = serialize(bObj); return ObjectDataType.compareNotNull(a, b); }
@Override public int compare(Object aObj, Object bObj) { if (aObj == bObj) { return 0; } TransactionalValue a = (TransactionalValue) aObj; TransactionalValue b = (TransactionalValue) bObj; long comp = a.getTid() - b.getTid(); if (comp == 0) { comp = a.getLogId() - b.getLogId(); if (comp == 0) return valueType.compare(a.value, b.value); } return Long.signum(comp); }
if (to != null) { Object lastKey = p.getLastKey(); if (keyType.compare(lastKey, to) >= 0) { needsCompare = true; int keyIndex = index - 1; Object k = p.getKey(keyIndex < 0 ? 0 : keyIndex); if (needsCompare && keyType.compare(k, to) > 0) { return; if (from == null || keyType.compare(from, k) < 0) { getPageKey(map, random, pageKeys, p, 0, k); if ((from != null && keyType.compare(from, k) >= 0) // || keyType.compare(to, k) >= 0) { getPageKey(map, random, pageKeys, p, 1, k);
protected K getFirstLast(boolean first) { Object k, k1, k2; try { if (first) k1 = buffer.firstKey(); else k1 = buffer.lastKey(); } catch (NoSuchElementException e) { k1 = null; } if (first) k2 = map.firstKey(); else k2 = map.lastKey(); if (k1 == null) k = k2; else if (k2 == null) k = k1; else { if (first) k = getKeyType().compare(k1, k2) < 0 ? k1 : k2; else k = getKeyType().compare(k1, k2) < 0 ? k2 : k1; } return (K) k; }
int result = keyType.compare(bufferIteratorEntry.getKey(), mapCursorKey); if (result <= 0) { key = (K) bufferIteratorEntry.getKey();
@Deprecated public void transferToOld(WritableByteChannel target, K firstKey, K lastKey) throws IOException { if (firstKey == null) firstKey = firstKey(); else firstKey = ceilingKey(firstKey); if (firstKey == null) return; if (lastKey == null) lastKey = lastKey(); else lastKey = floorKey(lastKey); if (keyType.compare(firstKey, lastKey) > 0) return; BTreePage p = root; if (p.getTotalCount() > 0) { p.transferTo(target, firstKey, lastKey); } }