zoukankan      html  css  js  c++  java
  • WebSiteInfo

    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();
    }

    }

  • 相关阅读:
    python基础练习5-9
    python安装
    python虚拟环境
    python基础语法--逻辑实现
    python基础语法
    IDE(vscode)
    pycharm使用
    复习
    环境搭建+python基础
    ASP.NET 5行代码搞二维码
  • 原文地址:https://www.cnblogs.com/huiandong/p/9194711.html
Copyright © 2011-2022 走看看