亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cachesizes.java

?? 這是學習Java必須讀懂兩套源代碼
?? JAVA
字號:
/**
 * $RCSfile: CacheSizes.java,v $
 * $Revision: 1.2 $
 * $Date: 2000/12/21 03:21:38 $
 *
 * Copyright (C) 2000 CoolServlets.com. All rights reserved.
 *
 * ===================================================================
 * The Apache Software License, Version 1.1
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by
 *        CoolServlets.com (http://www.Yasna.com)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "Jive" and "CoolServlets.com" must not be used to
 *    endorse or promote products derived from this software without
 *    prior written permission. For written permission, please
 *    contact webmaster@Yasna.com.
 *
 * 5. Products derived from this software may not be called "Jive",
 *    nor may "Jive" appear in their name, without prior written
 *    permission of CoolServlets.com.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL COOLSERVLETS.COM OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of CoolServlets.com. For more information
 * on CoolServlets.com, please see <http://www.Yasna.com>.
 */

package com.Yasna.util;

import java.util.*;

/**
 * Utility class for determining the sizes in bytes of commonly used objects.
 * Classes implementing the Cacheable interface should use this class to
 * determine their size.
 */
public class CacheSizes {

    /**
     * Returns the size in bytes of a basic Object. This method should only
     * be used for actual Object objects and not classes that extend Object.
     *
     * @return the size of an Object.
     */
    public static int sizeOfObject() {
        return 4;
    }

    /**
     * Returns the size in bytes of a String.
     *
     * @param string the String to determine the size of.
     * @return the size of a String.
     */
    public static int sizeOfString(String string) {
        if (string == null) {
            return 0;
        }
        return 4 + string.length()*2;
    }

    /**
     * Returns the size in bytes of a primitive int.
     *
     * @return the size of a primitive int.
     */
    public static int sizeOfInt() {
        return 4;
    }

    /**
     * Returns the size in bytes of a primitive char.
     *
     * @return the size of a primitive char.
     */
    public static int sizeOfChar() {
        return 2;
    }

    /**
     * Returns the size in bytes of a primitive boolean.
     *
     * @return the size of a primitive boolean.
     */
    public static int sizeOfBoolean() {
        return 1;
    }

    /**
     * Returns the size in bytes of a primitive long.
     *
     * @return the size of a primitive long.
     */
    public static int sizeOfLong() {
        return 8;
    }

    /**
     * Returns the size in bytes of a primitive double.
     *
     * @return the size of a primitive double.
     */
    public static int sizeOfDouble() {
        return 8;
    }

    /**
     * Returns the size in bytes of a Date.
     *
     * @return the size of a Date.
     */
    public static int sizeOfDate() {
        return 12;
    }

    /**
     * Returns the size in bytes of a Properties object. All properties and
     * property names must be Strings.
     *
     * @param properties the Properties object to determine the size of.
     * @return the size of a Properties object.
     */
    public static int sizeOfProperties(Properties properties) {
        if (properties == null) {
            return 0;
        }
        //Base properties object
        int size = 36;
        //Add in size of each property
        Enumeration enum = properties.elements();
        while(enum.hasMoreElements()) {
            String prop = (String)enum.nextElement();
            size += sizeOfString(prop);
        }
        //Add in property names
        enum = properties.propertyNames();
        while(enum.hasMoreElements()) {
            String prop = (String)enum.nextElement();
            size += sizeOfString(prop);
        }
        return size;
    }

    /**
     * Returns the size in bytes of a Map object. All keys and
     * values <b>must be Strings</b>.
     *
     * @param map the Map object to determine the size of.
     * @return the size of the Map object.
     */
    public static int sizeOfMap(Map map) {
        if (map == null) {
            return 0;
        }
        //Base map object -- should be something around this size.
        int size = 36;
        //Add in size of each value
        Iterator iter = map.values().iterator();
        while(iter.hasNext()) {
            String value = (String)iter.next();
            size += sizeOfString(value);
        }
        //Add in each key
        iter = map.keySet().iterator();
        while(iter.hasNext()) {
            String key = (String)iter.next();
            size += sizeOfString(key);
        }
        return size;
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99热这里都是精品| 91精品久久久久久久久99蜜臂| 国产肉丝袜一区二区| 国产精品一区二区x88av| 国产午夜亚洲精品午夜鲁丝片| 国产综合色视频| 国产日产亚洲精品系列| 91亚洲国产成人精品一区二三| 综合欧美亚洲日本| 欧美日韩精品福利| 欧美日韩一区中文字幕| 欧美日韩国产综合草草| 欧美精品一二三区| 国产三级三级三级精品8ⅰ区| 国产精品免费视频一区| 一区二区日韩av| 国产一区二区三区蝌蚪| 色欧美日韩亚洲| 中国色在线观看另类| 久久网这里都是精品| 亚洲欧美乱综合| 日韩欧美一级特黄在线播放| 国产精品资源在线看| 国产精品污网站| 亚洲制服欧美中文字幕中文字幕| 图片区小说区国产精品视频| 成人激情免费视频| 精品国产一二三区| 三级影片在线观看欧美日韩一区二区| 免费高清成人在线| 欧美日韩成人在线一区| 中文字幕一区二区三区av| 美女mm1313爽爽久久久蜜臀| 欧美主播一区二区三区| 不卡的av电影| 国产一区二区h| 欧美电影免费观看高清完整版在线 | 国内精品伊人久久久久av影院| 久久蜜臀精品av| 26uuu欧美| 国产一区三区三区| 日韩一区在线免费观看| 欧美电影免费观看高清完整版在| 欧美最新大片在线看| 国产日韩欧美亚洲| 欧美一区二区三区四区久久| 成人免费视频一区| 国产一区二区伦理片| 日韩精品一级中文字幕精品视频免费观看 | 色哟哟欧美精品| 国产欧美日韩另类一区| 黄网站免费久久| 欧美日韩国产欧美日美国产精品| 亚洲一区二区不卡免费| 欧美日韩国产美| 美女网站在线免费欧美精品| 久久精品一级爱片| 中文字幕的久久| 日本中文字幕一区| 精品日韩在线一区| 欧美一级黄色大片| 欧美视频第二页| 在线观看网站黄不卡| 91免费看片在线观看| 国产99精品国产| 国产福利精品导航| 狠狠色丁香婷婷综合| 久久国产夜色精品鲁鲁99| 首页亚洲欧美制服丝腿| 亚洲成a人片综合在线| 亚洲国产中文字幕| 亚洲一区二区三区四区在线免费观看 | 精品久久久久久最新网址| 国产精品一区不卡| 五月婷婷久久综合| 国产精品乱人伦| 精品福利一二区| 欧美午夜免费电影| 成人永久免费视频| 美女精品自拍一二三四| 亚洲美女在线国产| 亚瑟在线精品视频| 欧美激情综合五月色丁香| 久久亚洲精精品中文字幕早川悠里| 欧美精选午夜久久久乱码6080| 欧美性一区二区| 7777精品伊人久久久大香线蕉| 成+人+亚洲+综合天堂| 一本大道av一区二区在线播放| 狠狠色丁香久久婷婷综合丁香| 秋霞国产午夜精品免费视频| 亚洲黄色尤物视频| 日韩影院精彩在线| 日日夜夜精品视频天天综合网| 一级中文字幕一区二区| 亚洲人成网站影音先锋播放| 国产精品日日摸夜夜摸av| 久久先锋影音av| 国产日韩欧美在线一区| 欧美韩国一区二区| 亚洲欧美日韩国产手机在线| 亚洲欧美日韩久久| 图片区日韩欧美亚洲| 国产自产v一区二区三区c| 国产成人一区二区精品非洲| 欧美一级一区二区| 国产视频一区不卡| 人人狠狠综合久久亚洲| 亚洲欧美在线视频观看| 国产精品婷婷午夜在线观看| 国产精品久久久久久亚洲毛片| 国产日韩一级二级三级| 日韩在线一区二区| 精品久久久网站| 99精品欧美一区二区三区综合在线| 国产欧美日韩亚州综合 | 国产成+人+日韩+欧美+亚洲| 色综合天天天天做夜夜夜夜做| 欧美日韩一区二区三区四区 | 国产精品国产自产拍高清av| 亚洲综合激情另类小说区| 日本aⅴ亚洲精品中文乱码| 奇米影视一区二区三区| 成人一道本在线| 欧美一级理论片| 亚洲少妇30p| 国产盗摄精品一区二区三区在线| 精品国产91亚洲一区二区三区婷婷 | 专区另类欧美日韩| 日本欧美久久久久免费播放网| 成人免费毛片app| 91麻豆精品国产| 国产精品久久久久久久久图文区| 免费久久99精品国产| 一本大道久久a久久精二百| 精品动漫一区二区三区在线观看| 亚洲女同女同女同女同女同69| 国产一区视频网站| 欧美一级欧美三级在线观看| 亚洲视频图片小说| 国产大片一区二区| 日韩午夜激情av| 一区二区三区蜜桃网| 丁香六月综合激情| 精品福利在线导航| 欧美日韩国产系列| 日韩精彩视频在线观看| 欧美色视频一区| 午夜国产精品一区| 欧美三级欧美一级| 亚洲午夜一二三区视频| 在线精品国精品国产尤物884a| 中文字幕色av一区二区三区| 国产剧情av麻豆香蕉精品| 国产欧美一区二区三区鸳鸯浴 | 国产亚洲一区字幕| 久久综合久久综合久久| 一区二区三区在线高清| 丁香啪啪综合成人亚洲小说 | 国产成人精品影视| 国产欧美日韩精品a在线观看| 韩国精品一区二区| 国产亚洲一区二区在线观看| 成人app网站| 亚洲一区二区影院| 日韩视频在线一区二区| 国模娜娜一区二区三区| 亚洲欧美日韩在线| 51午夜精品国产| 国产精品18久久久| 亚洲综合免费观看高清完整版在线 | 天天综合日日夜夜精品| 欧美一区日本一区韩国一区| 久久久精品tv| 91精品久久久久久蜜臀| 国产一区欧美二区| 国产精品每日更新| 在线免费av一区| 成人在线综合网站| 岛国精品一区二区| 欧美一区2区视频在线观看| 亚洲免费伊人电影| 国产精品中文欧美| 欧美亚洲尤物久久| 国产精品国产三级国产aⅴ无密码| 国产一区91精品张津瑜| 国产精品久久国产精麻豆99网站| gogo大胆日本视频一区| 亚洲男人天堂av| 在线综合亚洲欧美在线视频| 亚洲精品自拍动漫在线| 99国产欧美另类久久久精品| 亚洲欧美日韩中文字幕一区二区三区| www.欧美亚洲| 亚洲a一区二区| 久久久久久久av麻豆果冻| 国产精品久久久久永久免费观看| 久久网站最新地址| 欧美r级在线观看| 精品电影一区二区|