码迷,mamicode.com
首页 > 其他好文 > 详细

SecondSortKey

时间:2018-06-18 11:49:33      阅读:147      评论:0      收藏:0      [点我收藏+]

标签:ali   err   ack   zab   class   serial   get   compareto   ide   

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

标签:ali   err   ack   zab   class   serial   get   compareto   ide   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!