long firstNum;
long secondNum;
。。。。
。。。。
。。。。
public int compareTo(MyNewKey anotherKey) {
long min = firstNum - anotherKey.firstNum;
if (min != 0) {
// 说明第一列不相等,则返回两数之间小的数
return (int) min;
} else {
return (int) (secondNum - anotherKey.secondNum);
}
}
mapreducer 自定义排序的 compreTO方法怎么理解???不懂
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-