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

📄 interval.java

📁 数据挖掘中的Aprior算法java实现
💻 JAVA
字号:
package datamining;

import java.util.*;

/**
 * Class for implementing an interval for non-derivable itemset.
 *
 * @author	Michael Holler
 */
public class Interval {
	
  private int lower;
  private int upper;

  /**
   * Constructor for creating a Interval object.
   */
  public Interval() {
    this.lower = 0;
    this.upper = 0;
  }
  
  /**
   * Constructor for creating a Interval object.
   * Sets the lower and upper bounds as parameter. 
   *
   * @param	lower	the lower bound of the interval 
   * @param	upper	the upper bound of the interval 
   */
  public Interval(int lower, int upper) {
    this.lower = lower;
    this.upper = upper;
  }

  /**
   * Increases the lower bound if the parameter is great than 
   * the current lower bound.
   *
   * @param	low	the wannabe lower bound
   * @return		true, if the parameter is greater than the 
   * 			current lower bound, else false
   */ 
  public boolean setLower(int low) {
    if (this.lower < low) {
      this.lower = low;
      return true;
    } else {
      return false;
    }
  }

  /**
   * Gets the lower bound of the interval.
   *
   * @return		the lower bound
   */
  public int lowerBound() {
    return this.lower;
  }

  /**
   * Decreases the upper bound if the parameter is great than 
   * the current lower bound.
   *
   * @param	high	the wannabe upper bound
   * @return		true, if the parameter is greater than the 
   * 			current lower bound, else false
   */ 
  public boolean setUpper(int high) {
    if (high < this.upper) {
      this.upper = high;
      return true;
    } else {
      return false;
    }
  }

  /**
   * Gets the upper bound of the interval.
   *
   * @return		the upper bound
   */
  public int upperBound() {
    return this.upper;
  }

}

⌨️ 快捷键说明

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