码迷,mamicode.com
首页 > Web开发 > 详细

WebSiteInfo

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

标签:The   rabl   imp   IV   his   import   class   void   java   

package com.bjsxt.spark.others.pvuv;

import java.io.Serializable;

public class WebSiteInfo implements Serializable, Comparable<WebSiteInfo>{

/**
*
*/
private static final long serialVersionUID = 1L;
private String website;
private String area;
private Integer total;

public WebSiteInfo(String website, String area, Integer total) {
super();
this.website = website;
this.area = area;
this.total = total;
}

public String getWebsite() {
return website;
}

public void setWebsite(String website) {
this.website = website;
}

public String getArea() {
return area;
}

public void setArea(String area) {
this.area = area;
}

public Integer getTotal() {
return total;
}

public void setTotal(Integer total) {
this.total = total;
}

@Override
public int compareTo(WebSiteInfo webSiteInfo) {
if(webSiteInfo.website.hashCode()-this.website.hashCode()==0){
//比第二和第三位
if(webSiteInfo.area.hashCode()-this.area.hashCode()!=0){
//比第三位
if(webSiteInfo.total-this.total!=0){
return webSiteInfo.total-this.total;
}
}
return webSiteInfo.area.hashCode()-this.area.hashCode();
}
return webSiteInfo.website.hashCode()-this.website.hashCode();
}

}

WebSiteInfo

标签:The   rabl   imp   IV   his   import   class   void   java   

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

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