@Test public void compareToTest() { FieldValue v1 = FieldValue.create(10, 5); FieldValue v2 = FieldValue.create(5, 7); FieldValue v3 = FieldValue.create(5, 3); List<FieldValue> fieldValueList = Arrays.asList(v1, v2, v3); Collections.sort(fieldValueList); assertEquals(fieldValueList.get(0), v2); assertEquals(fieldValueList.get(1), v3); assertEquals(fieldValueList.get(2), v1); }
@Override public int compareTo(Record record) { FieldValue fieldValue = (FieldValue) record; if (this.columnID == fieldValue.columnID) { return 0; } return (this.columnID < fieldValue.columnID) ? -1 : 1; }
FieldValue implements Record { @Override public int compareTo(Record record) { FieldValue fieldValue = (FieldValue) record; if (this.columnID == fieldValue.columnID) { return 0; } return (this.columnID < fieldValue.columnID) ? -1 : 1; } }
FieldValue implements Record { @Override public int compareTo(Record record) { FieldValue fieldValue = (FieldValue) record; if (this.columnID == fieldValue.columnID) { return 0; } return (this.columnID < fieldValue.columnID) ? -1 : 1; } private  FieldValue(); }
FieldValue implements Record { @Override public int compareTo(Record record) { FieldValue fieldValue = (FieldValue) record; if (this.columnID == fieldValue.columnID) { return 0; } return (this.columnID < fieldValue.columnID) ? -1 : 1; } private  FieldValue(); static FieldValue create(long columnID, long value); static FieldValue create(String columnKey, long value); long getColumnID(); String getColumnKey(); long getValue(); @Override long shard(long shardWidth); @Override boolean isDefault(); @Override int compareTo(Record record); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
FieldValue implements Record { @Override public int compareTo(Record record) { FieldValue fieldValue = (FieldValue) record; if (this.columnID == fieldValue.columnID) { return 0; } return (this.columnID < fieldValue.columnID) ? -1 : 1; } private  FieldValue(); static FieldValue create(long columnID, long value); static FieldValue create(String columnKey, long value); long getColumnID(); String getColumnKey(); long getValue(); @Override long shard(long shardWidth); @Override boolean isDefault(); @Override int compareTo(Record record); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final FieldValue DEFAULT; }