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

📄 cacheobject.java

📁 天乙代码src_531.rar 天乙代码src_531.rar 天乙代码src_531.rar 天乙代码src_531.rar
💻 JAVA
字号:
package com.laoer.bbscs.util;

/**
 * <p>Title: 天乙社区V5.0</p>
 * <p>Description: BBS-CS天乙社区V5.0</p>
 * <p>Copyright: Copyright (c) 2003</p>
 * <p>Company: laoer.com</p>
 * @author 龚天乙
 * @version 5.0
 */

public class CacheObject {

  /**
   * Underlying object wrapped by the CacheObject.
   */
  public Cacheable object;

  /**
   * The size of the Cacheable object. The size of the Cacheable
   * object is only computed once when it is added to the cache. This makes
   * the assumption that once objects are added to cache, they are mostly
   * read-only and that their size does not change significantly over time.
   */
  public int size;

  /**
   * A reference to the node in the cache order list. We keep the reference
   * here to avoid linear scans of the list. Every time the object is
   * accessed, the node is removed from its current spot in the list and
   * moved to the front.
   */
  public LinkedListNode lastAccessedListNode;

  /**
   * A reference to the node in the age order list. We keep the reference
   * here to avoid linear scans of the list. The reference is used if the
   * object has to be deleted from the list.
   */
  public LinkedListNode ageListNode;

  /**
   * Creates a new cache object wrapper. The size of the Cacheable object
   * must be passed in in order to prevent another possibly expensive
   * lookup by querying the object itself for its size.<p>
   *
   * @param object the underlying Cacheable object to wrap.
   * @param size the size of the Cachable object in bytes.
   */
  public CacheObject(Cacheable object, int size) {
    this.object = object;
    this.size = size;
  }

}

⌨️ 快捷键说明

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