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

📄 boardscomparator.java

📁 天乙社区6.0是一套基于JAVA技术的网络虚拟社区
💻 JAVA
字号:
package com.laoer.bbscs.sys;

import java.util.Comparator;
import com.laoer.bbscs.bean.*;

/**
 * <p>Title: TianYi BBS</p>
 * <p>Description: TianYi BBS System</p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: LAOER.COM/TIANYISOFT.NET</p>
 * @author laoer
 * @version 6.0
 */

public class BoardsComparator
    implements Comparator {

  public BoardsComparator() {
  }

  /**
   * Compares its two arguments for order.
   *
   * @param o1 the first object to be compared.
   * @param o2 the second object to be compared.
   * @return a negative integer, zero, or a positive integer as the first
   *   argument is less than, equal to, or greater than the second.
   * @todo Implement this java.util.Comparator method
   */
  public int compare(Object o1, Object o2) {
    int num1 = ( (Boards) o1).getMainPostNum();
    int num2 = ( (Boards) o2).getMainPostNum();
    return num2 - num1;
  }

  /**
   * Indicates whether some other object is &quot;equal to&quot; this Comparator.
   *
   * @param obj the reference object with which to compare.
   * @return <code>true</code> only if the specified object is also a comparator
   *   and it imposes the same ordering as this comparator.
   * @todo Implement this java.util.Comparator method
   */
  public boolean equals(Object obj) {
    return this.equals(obj);
  }

}

⌨️ 快捷键说明

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