コード例 #1
0
  /**
   * Sets maximum allowed size of cache before entry will start getting evicted.
   *
   * @param max Maximum allowed size of cache before entry will start getting evicted.
   */
  @Override
  public void setMaxSize(int max) {
    A.ensure(max > 0, "max > 0");

    this.max = max;
  }
コード例 #2
0
  /**
   * Constructs random eviction policy with maximum size.
   *
   * @param max Maximum allowed size of cache before entry will start getting evicted.
   */
  public RandomEvictionPolicy(int max) {
    A.ensure(max > 0, "max > 0");

    this.max = max;
  }