@Test public void testCompare() { RowColumn rc1 = new RowColumn("a", new Column("b")); RowColumn rc2 = new RowColumn("b"); RowColumn rc3 = new RowColumn("a", new Column("c")); RowColumn rc4 = new RowColumn("a", new Column("c", "d")); Assert.assertEquals(-1, rc1.compareTo(rc2)); Assert.assertEquals(1, rc2.compareTo(rc1)); Assert.assertEquals(-1, rc1.compareTo(rc3)); Assert.assertEquals(-1, rc3.compareTo(rc2)); Assert.assertEquals(0, rc3.compareTo(rc3)); Assert.assertEquals(1, rc2.compareTo(RowColumn.EMPTY)); Assert.assertEquals(-1, rc3.compareTo(rc4)); }
@Override public int compareTo(RowColumn other) { if (this == other) { return 0; } int result = row.compareTo(other.row); if (result == 0) { result = col.compareTo(other.col); } return result; }
RowColumn implements Comparable<RowColumn>, Serializable { @Override public int compareTo(RowColumn other) { if (this == other) { return 0; } int result = row.compareTo(other.row); if (result == 0) { result = col.compareTo(other.col); } return result; } }
RowColumn implements Comparable<RowColumn>, Serializable { @Override public int compareTo(RowColumn other) { if (this == other) { return 0; } int result = row.compareTo(other.row); if (result == 0) { result = col.compareTo(other.col); } return result; } RowColumn();  RowColumn(Bytes row);  RowColumn(CharSequence row);  RowColumn(Bytes row, Column col);  RowColumn(CharSequence row, Column col); }
RowColumn implements Comparable<RowColumn>, Serializable { @Override public int compareTo(RowColumn other) { if (this == other) { return 0; } int result = row.compareTo(other.row); if (result == 0) { result = col.compareTo(other.col); } return result; } RowColumn();  RowColumn(Bytes row);  RowColumn(CharSequence row);  RowColumn(Bytes row, Column col);  RowColumn(CharSequence row, Column col); Bytes getRow(); String getsRow(); Column getColumn(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); RowColumn following(); @Override int compareTo(RowColumn other); }
RowColumn implements Comparable<RowColumn>, Serializable { @Override public int compareTo(RowColumn other) { if (this == other) { return 0; } int result = row.compareTo(other.row); if (result == 0) { result = col.compareTo(other.col); } return result; } RowColumn();  RowColumn(Bytes row);  RowColumn(CharSequence row);  RowColumn(Bytes row, Column col);  RowColumn(CharSequence row, Column col); Bytes getRow(); String getsRow(); Column getColumn(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); RowColumn following(); @Override int compareTo(RowColumn other); static final RowColumn EMPTY; }