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

📄 cacheablestring.java

📁 jive 论坛所有的java源码
💻 JAVA
字号:
/**
 * $RCSfile: CacheableString.java,v $
 * $Revision: 1.1.1.1 $
 * $Date: 2002/09/09 13:51:09 $
 *
 * New Jive  from Jdon.com.
 *
 * This software is the proprietary information of CoolServlets, Inc.
 * Use is subject to license terms.
 */

package com.jivesoftware.util;

/**
 * Wrapper for String objects so they can be treated as Cacheable objects.
 * String is a final class, so it can't be extended.
 */
public class CacheableString implements Cacheable {

    /**
     * Wrapped String object.
     */
    private String string;

    /**
     * Creates a new CacheableString.
     *
     * @param string the String object to wrap.
     */
    public CacheableString(String string) {
        this.string = string;
    }

    /**
     * Returns the String wrapped by the CacheableString object.
     *
     * @return the String object.
     */
    public String getString() {
        return string;
    }

    //FROM THE CACHEABLE INTERFACE//

    public int getSize() {
        return CacheSizes.sizeOfString(string);
    }
}

⌨️ 快捷键说明

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