Ranking.java
Upload User: gdxydsw
Upload Date: 2019-01-29
Package Size: 16721k
Code Size: 3k
Category:

Java Develop

Development Platform:

Java

  1. /*
  2.  * Copyright (c) JForum Team
  3.  * All rights reserved.
  4.  * Redistribution and use in source and binary forms, 
  5.  * with or without modification, are permitted provided 
  6.  * that the following conditions are met:
  7.  * 1) Redistributions of source code must retain the above 
  8.  * copyright notice, this list of conditions and the 
  9.  * following  disclaimer.
  10.  * 2)  Redistributions in binary form must reproduce the 
  11.  * above copyright notice, this list of conditions and 
  12.  * the following disclaimer in the documentation and/or 
  13.  * other materials provided with the distribution.
  14.  * 3) Neither the name of "Rafael Steil" nor 
  15.  * the names of its contributors may be used to endorse 
  16.  * or promote products derived from this software without 
  17.  * specific prior written permission.
  18.  * 
  19.  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT 
  20.  * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
  21.  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 
  22.  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
  23.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
  24.  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 
  25.  * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 
  26.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
  27.  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
  28.  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
  29.  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 
  30.  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
  31.  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 
  32.  * IN CONTRACT, STRICT LIABILITY, OR TORT 
  33.  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
  34.  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 
  35.  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
  36.  * 
  37.  * This file creating date: Feb 17, 2003 / 10:45:42 PM
  38.  * The JForum Project 
  39.  * http://www.jforum.net
  40.  */
  41. package net.jforum.entities;
  42. import java.io.Serializable;
  43. /**
  44.  * Represents an user ranking in the System.
  45.  * An user ranking is just a given "status" which some user have
  46.  * basead on the number of messages posted by them.  
  47.  *  
  48.  * @author Rafael Steil
  49.  * @version $Id: Ranking.java,v 1.8 2006/12/02 03:19:55 rafaelsteil Exp $
  50.  */
  51. public class Ranking implements Serializable
  52. {
  53. private int id;
  54. private String title;
  55. private boolean special;
  56. private String image;
  57. private int min;
  58. public Ranking() {}
  59. /**
  60.  * @return int
  61.  */
  62. public int getId() {
  63. return this.id;
  64. }
  65. /**
  66.  * @return String
  67.  */
  68. public String getImage() {
  69. return this.image;
  70. }
  71. /**
  72.  * @return String
  73.  */
  74. public boolean isSpecial() {
  75. return this.special;
  76. }
  77. /**
  78.  * @return String
  79.  */
  80. public String getTitle() 
  81. {
  82. return (this.title == null ? "" : this.title);
  83. }
  84. /**
  85.  * Sets the id.
  86.  * @param id The id to set
  87.  */
  88. public void setId(int id) {
  89. this.id = id;
  90. }
  91. /**
  92.  * Sets the image.
  93.  * @param image The image to set
  94.  */
  95. public void setImage(String image) {
  96. this.image = image;
  97. }
  98. /**
  99.  * Sets the special.
  100.  * @param special The special to set
  101.  */
  102. public void setSpecial(boolean special) {
  103. this.special = special;
  104. }
  105. /**
  106.  * Sets the title.
  107.  * @param title The title to set
  108.  */
  109. public void setTitle(String title) {
  110. this.title = title;
  111. }
  112. /**
  113.  * @return
  114.  */
  115. public int getMin() {
  116. return this.min;
  117. }
  118. /**
  119.  * @param i
  120.  */
  121. public void setMin(int i) {
  122. this.min = i;
  123. }
  124. public boolean equals(Object o)
  125. {
  126. if (o == this) {
  127. return true;
  128. }
  129. if (!(o instanceof Ranking)) {
  130. return false;
  131. }
  132. return ((Ranking)o).getId() == this.getId();
  133. }
  134. public int hashCode()
  135. {
  136. return this.getId();
  137. }
  138. }