@Test public void testRightInclusiveContained() { Assert.assertEquals(1, comparator.rightCompare(OCT, OCT_12)); Assert.assertEquals(-1, comparator.rightCompare(OCT_12, OCT)); }
@SuppressWarnings("unchecked") public int rightCompare(Marker m1, Marker m2) { for (FieldPartitioner field : Accessor.getDefault().getFieldPartitioners(strategy)) { Object m1Value = m1.valueFor(field); Object m2Value = m2.valueFor(field); if (m1Value == null) { if (m2Value != null) { return 1; } } else if (m2Value == null) { return -1; } else { int cmp = field.compare(m1Value, m2Value); if (cmp != 0) { return cmp; } } } return 0; }
MarkerComparator implements Comparator<Marker> { @SuppressWarnings("unchecked") public int rightCompare(Marker m1, Marker m2) { for (FieldPartitioner field : Accessor.getDefault().getFieldPartitioners(strategy)) { Object m1Value = m1.valueFor(field); Object m2Value = m2.valueFor(field); if (m1Value == null) { if (m2Value != null) { return 1; } } else if (m2Value == null) { return -1; } else { int cmp = field.compare(m1Value, m2Value); if (cmp != 0) { return cmp; } } } return 0; } }
MarkerComparator implements Comparator<Marker> { @SuppressWarnings("unchecked") public int rightCompare(Marker m1, Marker m2) { for (FieldPartitioner field : Accessor.getDefault().getFieldPartitioners(strategy)) { Object m1Value = m1.valueFor(field); Object m2Value = m2.valueFor(field); if (m1Value == null) { if (m2Value != null) { return 1; } } else if (m2Value == null) { return -1; } else { int cmp = field.compare(m1Value, m2Value); if (cmp != 0) { return cmp; } } } return 0; } MarkerComparator(PartitionStrategy strategy); }
MarkerComparator implements Comparator<Marker> { @SuppressWarnings("unchecked") public int rightCompare(Marker m1, Marker m2) { for (FieldPartitioner field : Accessor.getDefault().getFieldPartitioners(strategy)) { Object m1Value = m1.valueFor(field); Object m2Value = m2.valueFor(field); if (m1Value == null) { if (m2Value != null) { return 1; } } else if (m2Value == null) { return -1; } else { int cmp = field.compare(m1Value, m2Value); if (cmp != 0) { return cmp; } } } return 0; } MarkerComparator(PartitionStrategy strategy); @SuppressWarnings("unchecked") boolean contains(Marker container, Marker test); @Override @SuppressWarnings("unchecked") int compare(Marker m1, Marker m2); @SuppressWarnings("unchecked") int rightCompare(Marker m1, Marker m2); @SuppressWarnings("unchecked") int leftCompare(Marker m1, Marker m2); @Override boolean equals(Object o); @Override int hashCode(); }
MarkerComparator implements Comparator<Marker> { @SuppressWarnings("unchecked") public int rightCompare(Marker m1, Marker m2) { for (FieldPartitioner field : Accessor.getDefault().getFieldPartitioners(strategy)) { Object m1Value = m1.valueFor(field); Object m2Value = m2.valueFor(field); if (m1Value == null) { if (m2Value != null) { return 1; } } else if (m2Value == null) { return -1; } else { int cmp = field.compare(m1Value, m2Value); if (cmp != 0) { return cmp; } } } return 0; } MarkerComparator(PartitionStrategy strategy); @SuppressWarnings("unchecked") boolean contains(Marker container, Marker test); @Override @SuppressWarnings("unchecked") int compare(Marker m1, Marker m2); @SuppressWarnings("unchecked") int rightCompare(Marker m1, Marker m2); @SuppressWarnings("unchecked") int leftCompare(Marker m1, Marker m2); @Override boolean equals(Object o); @Override int hashCode();  }