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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? bitset.java

?? java源代碼 請(qǐng)看看啊 提點(diǎn)寶貴的意見
?? JAVA
?? 第 1 頁 / 共 3 頁
字號(hào):
/* * @(#)BitSet.java	1.55 03/01/23 * * Copyright 2003 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */package java.util;import java.io.*;/** * This class implements a vector of bits that grows as needed. Each  * component of the bit set has a <code>boolean</code> value. The  * bits of a <code>BitSet</code> are indexed by nonnegative integers.  * Individual indexed bits can be examined, set, or cleared. One  * <code>BitSet</code> may be used to modify the contents of another  * <code>BitSet</code> through logical AND, logical inclusive OR, and  * logical exclusive OR operations. * <p> * By default, all bits in the set initially have the value  * <code>false</code>.  * <p> * Every bit set has a current size, which is the number of bits  * of space currently in use by the bit set. Note that the size is * related to the implementation of a bit set, so it may change with * implementation. The length of a bit set relates to logical length * of a bit set and is defined independently of implementation. * <p> * Unless otherwise noted, passing a null parameter to any of the * methods in a <code>BitSet</code> will result in a * <code>NullPointerException</code>. * * A <code>BitSet</code> is not safe for multithreaded use without * external synchronization. * * @author  Arthur van Hoff * @author  Michael McCloskey * @version 1.55, 01/23/03 * @since   JDK1.0 */public class BitSet implements Cloneable, java.io.Serializable {    /*     * BitSets are packed into arrays of "units."  Currently a unit is a long,     * which consists of 64 bits, requiring 6 address bits.  The choice of unit     * is determined purely by performance concerns.     */    private final static int ADDRESS_BITS_PER_UNIT = 6;    private final static int BITS_PER_UNIT = 1 << ADDRESS_BITS_PER_UNIT;    private final static int BIT_INDEX_MASK = BITS_PER_UNIT - 1;    /* Used to shift left or right for a partial word mask */    private static final long WORD_MASK = 0xffffffffffffffffL;    /**     * The bits in this BitSet.  The ith bit is stored in bits[i/64] at     * bit position i % 64 (where bit position 0 refers to the least     * significant bit and 63 refers to the most significant bit).     * INVARIANT: The words in bits[] above unitInUse-1 are zero.     *     * @serial     */    private long bits[];  // this should be called unit[]    /**     * The number of units in the logical size of this BitSet.     * INVARIANT: unitsInUse is nonnegative.     * INVARIANT: bits[unitsInUse-1] is nonzero unless unitsInUse is zero.     */    private transient int unitsInUse = 0;    /* use serialVersionUID from JDK 1.0.2 for interoperability */    private static final long serialVersionUID = 7997698588986878753L;    /**     * Given a bit index return unit index containing it.     */    private static int unitIndex(int bitIndex) {        return bitIndex >> ADDRESS_BITS_PER_UNIT;    }    /**     * Given a bit index, return a unit that masks that bit in its unit.     */    private static long bit(int bitIndex) {        return 1L << (bitIndex & BIT_INDEX_MASK);    }    /**     * Set the field unitsInUse with the logical size in units of the bit     * set.  WARNING:This function assumes that the number of units actually     * in use is less than or equal to the current value of unitsInUse!     */    private void recalculateUnitsInUse() {        // Traverse the bitset until a used unit is found        int i;        for (i = unitsInUse-1; i >= 0; i--)	    if(bits[i] != 0)		break;        unitsInUse = i+1; // The new logical size    }    /**     * Creates a new bit set. All bits are initially <code>false</code>.     */    public BitSet() {	this(BITS_PER_UNIT);    }    /**     * Creates a bit set whose initial size is large enough to explicitly     * represent bits with indices in the range <code>0</code> through     * <code>nbits-1</code>. All bits are initially <code>false</code>.      *     * @param     nbits   the initial size of the bit set.     * @exception NegativeArraySizeException if the specified initial size     *               is negative.     */    public BitSet(int nbits) {	// nbits can't be negative; size 0 is OK	if (nbits < 0)	    throw new NegativeArraySizeException("nbits < 0: " + nbits);	bits = new long[(unitIndex(nbits-1) + 1)];    }    /**     * Ensures that the BitSet can hold enough units.     * @param	unitsRequired the minimum acceptable number of units.     */    private void ensureCapacity(int unitsRequired) {	if (bits.length < unitsRequired) {	    // Allocate larger of doubled size or required size	    int request = Math.max(2 * bits.length, unitsRequired);	    long newBits[] = new long[request];	    System.arraycopy(bits, 0, newBits, 0, unitsInUse);	    bits = newBits;	}    }    /**     * Sets the bit at the specified index to to the complement of its     * current value.     *      * @param   bitIndex the index of the bit to flip.     * @exception IndexOutOfBoundsException if the specified index is negative.     * @since   1.4     */    public void flip(int bitIndex) {	if (bitIndex < 0)	    throw new IndexOutOfBoundsException("bitIndex < 0: " + bitIndex);        	int unitIndex = unitIndex(bitIndex);        int unitsRequired = unitIndex+1;        if (unitsInUse < unitsRequired) {            ensureCapacity(unitsRequired);            bits[unitIndex] ^= bit(bitIndex);            unitsInUse = unitsRequired;        } else {            bits[unitIndex] ^= bit(bitIndex);            if (bits[unitsInUse-1] == 0)                recalculateUnitsInUse();        }    }    /**     * Sets each bit from the specified fromIndex(inclusive) to the     * specified toIndex(exclusive) to the complement of its current     * value.     *      * @param     fromIndex   index of the first bit to flip.     * @param     toIndex index after the last bit to flip.     * @exception IndexOutOfBoundsException if <tt>fromIndex</tt> is negative,     *            or <tt>toIndex</tt> is negative, or <tt>fromIndex</tt> is     *            larger than <tt>toIndex</tt>.     * @since   1.4     */    public void flip(int fromIndex, int toIndex) {	if (fromIndex < 0)	    throw new IndexOutOfBoundsException("fromIndex < 0: " + fromIndex);        if (toIndex < 0)	    throw new IndexOutOfBoundsException("toIndex < 0: " + toIndex);        if (fromIndex > toIndex)	    throw new IndexOutOfBoundsException("fromIndex: " + fromIndex +                                                " > toIndex: " + toIndex);                // Increase capacity if necessary        int endUnitIndex = unitIndex(toIndex);        int unitsRequired = endUnitIndex + 1;        if (unitsInUse < unitsRequired) {            ensureCapacity(unitsRequired);            unitsInUse = unitsRequired;        }        int startUnitIndex = unitIndex(fromIndex);        long bitMask = 0;        if (startUnitIndex == endUnitIndex) {            // Case 1: One word            bitMask = (1L << (toIndex & BIT_INDEX_MASK)) -                      (1L << (fromIndex & BIT_INDEX_MASK));            bits[startUnitIndex] ^= bitMask;            if (bits[unitsInUse-1] == 0)                recalculateUnitsInUse();            return;        }                // Case 2: Multiple words        // Handle first word        bitMask = bitsLeftOf(fromIndex & BIT_INDEX_MASK);        bits[startUnitIndex] ^= bitMask;        // Handle intermediate words, if any        if (endUnitIndex - startUnitIndex > 1) {            for(int i=startUnitIndex+1; i<endUnitIndex; i++)                bits[i] ^= WORD_MASK;        }        // Handle last word        bitMask = bitsRightOf(toIndex & BIT_INDEX_MASK);        bits[endUnitIndex] ^= bitMask;        // Check to see if we reduced size        if (bits[unitsInUse-1] == 0)            recalculateUnitsInUse();    }    /**     * Returns a long that has all bits that are less significant     * than the specified index set to 1. All other bits are 0.     */    private static long bitsRightOf(int x) {        return (x==0 ? 0 : WORD_MASK >>> (64-x));    }    /**     * Returns a long that has all the bits that are more significant     * than or equal to the specified index set to 1. All other bits are 0.     */    private static long bitsLeftOf(int x) {        return WORD_MASK << x;    }    /**     * Sets the bit at the specified index to <code>true</code>.     *     * @param     bitIndex   a bit index.     * @exception IndexOutOfBoundsException if the specified index is negative.     * @since     JDK1.0     */    public void set(int bitIndex) {	if (bitIndex < 0)	    throw new IndexOutOfBoundsException("bitIndex < 0: " + bitIndex);        int unitIndex = unitIndex(bitIndex);        int unitsRequired = unitIndex + 1;        if (unitsInUse < unitsRequired) {            ensureCapacity(unitsRequired);            bits[unitIndex] |= bit(bitIndex);            unitsInUse = unitsRequired;        } else {            bits[unitIndex] |= bit(bitIndex);        }                }    /**     * Sets the bit at the specified index to the specified value.     *     * @param     bitIndex   a bit index.     * @param     value a boolean value to set.     * @exception IndexOutOfBoundsException if the specified index is negative.     * @since     1.4     */    public void set(int bitIndex, boolean value) {        if (value)            set(bitIndex);        else            clear(bitIndex);    }    /**     * Sets the bits from the specified fromIndex(inclusive) to the     * specified toIndex(exclusive) to <code>true</code>.     *     * @param     fromIndex   index of the first bit to be set.     * @param     toIndex index after the last bit to be set.     * @exception IndexOutOfBoundsException if <tt>fromIndex</tt> is negative,     *            or <tt>toIndex</tt> is negative, or <tt>fromIndex</tt> is     *            larger than <tt>toIndex</tt>.     * @since     1.4     */    public void set(int fromIndex, int toIndex) {	if (fromIndex < 0)	    throw new IndexOutOfBoundsException("fromIndex < 0: " + fromIndex);        if (toIndex < 0)	    throw new IndexOutOfBoundsException("toIndex < 0: " + toIndex);        if (fromIndex > toIndex)	    throw new IndexOutOfBoundsException("fromIndex: " + fromIndex +                                                " > toIndex: " + toIndex);        // Increase capacity if necessary        int endUnitIndex = unitIndex(toIndex);        int unitsRequired = endUnitIndex + 1;        if (unitsInUse < unitsRequired) {            ensureCapacity(unitsRequired);            unitsInUse = unitsRequired;        }        int startUnitIndex = unitIndex(fromIndex);        long bitMask = 0;        if (startUnitIndex == endUnitIndex) {            // Case 1: One word            bitMask = (1L << (toIndex & BIT_INDEX_MASK)) -                      (1L << (fromIndex & BIT_INDEX_MASK));            bits[startUnitIndex] |= bitMask;            return;        }                // Case 2: Multiple words        // Handle first word        bitMask = bitsLeftOf(fromIndex & BIT_INDEX_MASK);        bits[startUnitIndex] |= bitMask;        // Handle intermediate words, if any        if (endUnitIndex - startUnitIndex > 1) {            for(int i=startUnitIndex+1; i<endUnitIndex; i++)                bits[i] |= WORD_MASK;        }        // Handle last word        bitMask = bitsRightOf(toIndex & BIT_INDEX_MASK);        bits[endUnitIndex] |= bitMask;    }    /**     * Sets the bits from the specified fromIndex(inclusive) to the     * specified toIndex(exclusive) to the specified value.     *     * @param     fromIndex   index of the first bit to be set.     * @param     toIndex index after the last bit to be set     * @param     value value to set the selected bits to     * @exception IndexOutOfBoundsException if <tt>fromIndex</tt> is negative,     *            or <tt>toIndex</tt> is negative, or <tt>fromIndex</tt> is     *            larger than <tt>toIndex</tt>.     * @since     1.4

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久综合色之久久综合| 国产一区二区三区免费在线观看| 国产精品国产三级国产普通话99 | 国产精品入口麻豆原神| 久久精品在线免费观看| 国产亚洲女人久久久久毛片| 国产欧美精品日韩区二区麻豆天美 | 日韩一级片在线播放| 在线精品视频小说1| 欧美丝袜自拍制服另类| 欧美日本在线看| 91麻豆精品国产91久久久资源速度| 欧美日本不卡视频| 精品免费视频一区二区| 久久久亚洲国产美女国产盗摄| 国产欧美日韩视频在线观看| 国产精品欧美久久久久一区二区| 1000精品久久久久久久久| 亚洲青青青在线视频| 亚洲成av人片| 极品少妇xxxx偷拍精品少妇| 国产精品18久久久久久久久久久久| 国产精一区二区三区| 97久久精品人人爽人人爽蜜臀| 91性感美女视频| 欧美日韩一级二级三级| 日韩欧美不卡在线观看视频| 日本一区二区高清| 伊人色综合久久天天人手人婷| 午夜久久电影网| 国产原创一区二区| 99久久精品国产导航| 欧美高清一级片在线| 久久尤物电影视频在线观看| 亚洲男人的天堂一区二区| 日韩国产在线一| 国产精品一品二品| 欧美亚洲禁片免费| ww亚洲ww在线观看国产| 亚洲视频一区在线| 免费视频一区二区| 成人av在线影院| 欧美狂野另类xxxxoooo| 欧美激情综合五月色丁香小说| 亚洲综合激情另类小说区| 久久成人久久爱| 色婷婷亚洲精品| 精品成人一区二区三区四区| 亚洲色图一区二区| 开心九九激情九九欧美日韩精美视频电影 | 国产亚洲一区字幕| 亚洲高清免费观看| 国产精品99久久久久久有的能看 | 欧美中文字幕一区| 久久精品人人做人人综合| 一区二区三区色| 狠狠狠色丁香婷婷综合久久五月| 一本色道亚洲精品aⅴ| 日韩免费电影网站| 综合色天天鬼久久鬼色| 日韩av中文字幕一区二区三区| 成人97人人超碰人人99| 日韩视频永久免费| 亚洲一区二区综合| 成人av动漫在线| 欧美大片国产精品| 亚洲综合色噜噜狠狠| 成人免费黄色大片| 欧美大片免费久久精品三p | 99热精品国产| 久久这里只有精品6| 日韩电影在线免费| 在线观看区一区二| 欧美国产日产图区| 激情综合色综合久久综合| 欧美性极品少妇| 成人免费在线视频| 国产不卡视频在线播放| 日韩精品综合一本久道在线视频| 亚洲一区二区三区精品在线| 成人在线视频一区| 久久天堂av综合合色蜜桃网| 日韩电影免费在线看| 欧美午夜一区二区三区 | 成人中文字幕合集| 久久免费电影网| 久草这里只有精品视频| 欧美一级夜夜爽| 午夜精品一区二区三区电影天堂| 在线精品视频小说1| 亚洲精品一二三四区| aa级大片欧美| 欧美经典三级视频一区二区三区| 国产一区二区三区四区五区入口| 日韩欧美综合一区| 日韩高清一区在线| 91精品久久久久久蜜臀| 午夜在线电影亚洲一区| 在线精品视频免费播放| 一区二区三区四区中文字幕| 不卡的av电影| 亚洲欧洲日韩av| 99久久伊人网影院| 亚洲三级在线播放| 97精品视频在线观看自产线路二| 中文字幕av在线一区二区三区| 国产黄色成人av| 久久免费视频一区| 国产成人丝袜美腿| 中文字幕亚洲视频| 色先锋久久av资源部| 亚洲综合在线视频| 欧美日韩视频在线一区二区| 亚洲线精品一区二区三区| 欧美三级韩国三级日本一级| 午夜精品久久久久久久99樱桃| 欧美日韩激情在线| 91精品在线免费观看| 三级欧美韩日大片在线看| 91精品国产综合久久国产大片| 蜜桃久久av一区| 久久久五月婷婷| 不卡在线视频中文字幕| 亚洲精品国产品国语在线app| 欧美日韩三级在线| 乱一区二区av| 国产精品毛片大码女人| 91国在线观看| 日韩av在线播放中文字幕| 欧美成人r级一区二区三区| 国产一区二区不卡老阿姨| 国产精品不卡在线| 欧美日韩国产一级片| 经典三级在线一区| 亚洲欧洲日韩一区二区三区| 精品视频一区二区不卡| 久久国产精品99久久人人澡| 欧美极品少妇xxxxⅹ高跟鞋| 欧美午夜免费电影| 精品一区二区三区蜜桃| 国产精品久久久久久久久晋中| 欧美影院午夜播放| 激情欧美一区二区三区在线观看| 中文字幕免费观看一区| 欧美专区在线观看一区| 国内精品伊人久久久久av一坑| 中文字幕在线观看一区| 91精品欧美一区二区三区综合在| 国产成人av电影在线| 亚洲一区二区三区不卡国产欧美| 精品福利二区三区| 色婷婷久久久亚洲一区二区三区| 久久成人18免费观看| 亚洲欧美国产77777| 精品国产成人在线影院| 99re这里只有精品6| 麻豆中文一区二区| 亚洲品质自拍视频网站| 久久夜色精品一区| 欧美视频在线观看一区二区| 国产成+人+日韩+欧美+亚洲| 无码av中文一区二区三区桃花岛| 国产女同性恋一区二区| 欧美一区二区三区精品| 色老汉av一区二区三区| 国产精品一区一区| 日韩高清欧美激情| 亚洲精品国产成人久久av盗摄| 久久综合九色综合97_久久久| 欧美日韩一二三区| eeuss鲁片一区二区三区| 狠狠色丁香久久婷婷综合丁香| 亚洲成人动漫av| 亚洲同性同志一二三专区| 久久久久久久久久看片| 欧美放荡的少妇| 色播五月激情综合网| 国产精品一区免费视频| 美腿丝袜一区二区三区| 亚洲电影中文字幕在线观看| 中文字幕亚洲成人| 国产欧美视频一区二区三区| 精品理论电影在线观看 | 亚洲3atv精品一区二区三区| 国产精品久久久久永久免费观看| 337p日本欧洲亚洲大胆精品| 欧美一二三在线| 欧美日韩1234| 欧美日韩一级二级| 欧美午夜精品免费| 欧洲精品一区二区| 99久久精品国产毛片| 成人国产精品免费网站| 成人性生交大片免费看在线播放| 久久精品久久综合| 美女一区二区久久| 日本中文在线一区| 秋霞国产午夜精品免费视频| 香港成人在线视频| 天天综合日日夜夜精品|