cacheablelongarray.java

来自「Jive(J道版) Jive(J道版)是在Jive 2.1版本基础上改编而成」· Java 代码 · 共 47 行

JAVA
47
字号
/**
 * $RCSfile: CacheableLongArray.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 long[] values so they can be treated as cacheable objects.
 */
public class CacheableLongArray implements Cacheable {

    /**
     * Wrapped long object.
     */
    private long[] longArray;

    /**
     * Creates a new CacheableLong.
     *
     * @param string the Long object to wrap.
     */
    public CacheableLongArray(long[] longArray) {
        this.longArray = longArray;
    }

    /**
     * Returns the long [] wrapped by the CacheableLongArray object.
     *
     * @return the long [] object.
     */
    public long[] getLongArray() {
        return longArray;
    }

    //FROM THE CACHEABLE INTERFACE//

    public int getSize() {
        return CacheSizes.sizeOfObject() + CacheSizes.sizeOfLong() * longArray.length;
    }
}

⌨️ 快捷键说明

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