@Test public void testXXXN() { assertEquals(0, keyRange(10, 20).compareTo(keyRange(9, null))); assertEquals(0, keyRange(10, 20).compareTo(keyRange(10, null))); assertEquals(0, keyRange(10, 20).compareTo(keyRange(11, null))); assertEquals(0, keyRange(10, 20).compareTo(keyRange(19, null))); assertEquals(-1, keyRange(10, 20).compareTo(keyRange(20, null))); assertEquals(-1, keyRange(10, 20).compareTo(keyRange(21, null))); }
@Override public int compareTo(AbstractKey key) { int c = super.compareTo(key); if (c == 0) { MultiRecordKey that = (MultiRecordKey) key; if (this.hi != null && that.lo != null && this.hi.compareTo(that.lo) <= 0) { c = -1; } else if (this.lo != null && that.hi != null && this.lo.compareTo(that.hi) >= 0) { c = 1; } } return c; }
MultiRecordKey extends AbstractKey { @Override public int compareTo(AbstractKey key) { int c = super.compareTo(key); if (c == 0) { MultiRecordKey that = (MultiRecordKey) key; if (this.hi != null && that.lo != null && this.hi.compareTo(that.lo) <= 0) { c = -1; } else if (this.lo != null && that.hi != null && this.lo.compareTo(that.hi) >= 0) { c = 1; } } return c; } }
MultiRecordKey extends AbstractKey { @Override public int compareTo(AbstractKey key) { int c = super.compareTo(key); if (c == 0) { MultiRecordKey that = (MultiRecordKey) key; if (this.hi != null && that.lo != null && this.hi.compareTo(that.lo) <= 0) { c = -1; } else if (this.lo != null && that.hi != null && this.lo.compareTo(that.hi) >= 0) { c = 1; } } return c; } MultiRecordKey(AbstractKey lo, AbstractKey hi); }
MultiRecordKey extends AbstractKey { @Override public int compareTo(AbstractKey key) { int c = super.compareTo(key); if (c == 0) { MultiRecordKey that = (MultiRecordKey) key; if (this.hi != null && that.lo != null && this.hi.compareTo(that.lo) <= 0) { c = -1; } else if (this.lo != null && that.hi != null && this.lo.compareTo(that.hi) >= 0) { c = 1; } } return c; } MultiRecordKey(AbstractKey lo, AbstractKey hi); @Override String toString(); @Override int compareTo(AbstractKey key); @Override void readFrom(ByteBuffer buffer); @Override void writeTo(ByteBuffer buffer); @Override int estimatedSizeBytes(); @Override AbstractKey copy(); AbstractKey lo(); AbstractKey hi(); }
MultiRecordKey extends AbstractKey { @Override public int compareTo(AbstractKey key) { int c = super.compareTo(key); if (c == 0) { MultiRecordKey that = (MultiRecordKey) key; if (this.hi != null && that.lo != null && this.hi.compareTo(that.lo) <= 0) { c = -1; } else if (this.lo != null && that.hi != null && this.lo.compareTo(that.hi) >= 0) { c = 1; } } return c; } MultiRecordKey(AbstractKey lo, AbstractKey hi); @Override String toString(); @Override int compareTo(AbstractKey key); @Override void readFrom(ByteBuffer buffer); @Override void writeTo(ByteBuffer buffer); @Override int estimatedSizeBytes(); @Override AbstractKey copy(); AbstractKey lo(); AbstractKey hi();  }