首页 > 其他 > 详细

SecondSortKey

时间:2018-06-18 11:36:10      阅读:202      评论:0      收藏:0      [点我收藏+]

package com.bjsxt.spark.others.secondsort;

import java.io.Serializable;

public class SecondSortKey implements Serializable,Comparable<SecondSortKey>{
private static final long serialVersionUID = 1L;
private int first;
private int second;
public int getFirst() {
return first;
}
public void setFirst(int first) {
this.first = first;
}
public int getSecond() {
return second;
}
public void setSecond(int second) {
this.second = second;
}
public SecondSortKey(int first, int second) {
super();
this.first = first;
this.second = second;
}
@Override
public int compareTo(SecondSortKey o1) {
if(getFirst() - o1.getFirst() ==0 ){
return getSecond() - o1.getSecond();
}else{
return getFirst() - o1.getFirst();
}
}
}

SecondSortKey

原文:https://www.cnblogs.com/huiandong/p/9194720.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!