⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 league.java

📁 使用Servlet和JSP进行Web组件开发
💻 JAVA
字号:
package sl314.model;

/**
 * This domain object represents a soccer league.
 * The data attributes are all package-private to allow access to them
 * in the {@link RegisterService} class.
 */
public class League {

  int objectID;
  int year;
  String season;
  String title;

  League(int objectID, int year, String season, String title) {
    this.objectID = objectID;
    this.year = year;
    this.season = season;
    this.title = title;
  }

  public int getYear() {
    return year;
  }
  public String getSeason() {
    return season;
  }
  public String getTitle() {
    return title;
  }

  // League entities are compared by their object IDs
  public boolean equals(Object o) {
    boolean result = false;
    if ( o instanceof League ) {
      League l = (League) o;
      result = (this.objectID == l.objectID);
    }
    return result;
  }

  // You need to override hashCode if you override equals
  public int hashCode() {
    Integer OID = new Integer(objectID);
    return OID.hashCode();
  }

  public String toString() {
    return title;
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -