@Test public void test() { LongFixedSizeRangeFieldPartitioner partitioner = new LongFixedSizeRangeFieldPartitioner("position", 10); Assert.assertEquals(0, partitioner.apply(0L).longValue()); Assert.assertEquals(0, partitioner.apply(9L).longValue()); Assert.assertEquals(10, partitioner.apply(10L).longValue()); Assert.assertEquals(10, partitioner.apply(11L).longValue()); Assert.assertEquals(-10, partitioner.apply(-1L).longValue()); Assert.assertEquals(-10, partitioner.apply(-9L).longValue()); Assert.assertEquals(-10, partitioner.apply(-10L).longValue()); Assert.assertEquals(-20, partitioner.apply(-11L).longValue()); }
@Override public Long apply(Long value) { return Math.round(Math.floor(value / ((double) size))) * size; }
LongFixedSizeRangeFieldPartitioner extends FieldPartitioner<Long, Long> { @Override public Long apply(Long value) { return Math.round(Math.floor(value / ((double) size))) * size; } }
LongFixedSizeRangeFieldPartitioner extends FieldPartitioner<Long, Long> { @Override public Long apply(Long value) { return Math.round(Math.floor(value / ((double) size))) * size; } LongFixedSizeRangeFieldPartitioner(String sourceName, long size);  LongFixedSizeRangeFieldPartitioner(String sourceName, @Nullable String name,
      long size); }
LongFixedSizeRangeFieldPartitioner extends FieldPartitioner<Long, Long> { @Override public Long apply(Long value) { return Math.round(Math.floor(value / ((double) size))) * size; } LongFixedSizeRangeFieldPartitioner(String sourceName, long size);  LongFixedSizeRangeFieldPartitioner(String sourceName, @Nullable String name,
      long size); @Override Long apply(Long value); @Override Predicate<Long> project(Predicate<Long> predicate); @Override Predicate<Long> projectStrict(Predicate<Long> predicate); long getSize(); @Override @edu.umd.cs.findbugs.annotations.SuppressWarnings( value="NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION", justification="Default annotation is not correct for equals") boolean equals(@Nullable Object o); @Override int compare(Long o1, Long o2); @Override int hashCode(); @Override String toString(); }
LongFixedSizeRangeFieldPartitioner extends FieldPartitioner<Long, Long> { @Override public Long apply(Long value) { return Math.round(Math.floor(value / ((double) size))) * size; } LongFixedSizeRangeFieldPartitioner(String sourceName, long size);  LongFixedSizeRangeFieldPartitioner(String sourceName, @Nullable String name,
      long size); @Override Long apply(Long value); @Override Predicate<Long> project(Predicate<Long> predicate); @Override Predicate<Long> projectStrict(Predicate<Long> predicate); long getSize(); @Override @edu.umd.cs.findbugs.annotations.SuppressWarnings( value="NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION", justification="Default annotation is not correct for equals") boolean equals(@Nullable Object o); @Override int compare(Long o1, Long o2); @Override int hashCode(); @Override String toString();  }