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

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

?? bitset.java

?? java源代碼 請看看啊 提點(diǎn)寶貴的意見
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/* * @(#)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
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美电影免费观看高清完整版在线| 精品日韩av一区二区| 久久99热99| 亚洲乱码日产精品bd| 久久夜色精品国产欧美乱极品| 91国偷自产一区二区开放时间 | 精品国产免费久久 | 色哟哟国产精品免费观看| 久久精品噜噜噜成人88aⅴ| 亚洲精品乱码久久久久久久久| 精品国产伦一区二区三区观看体验| 欧美日韩综合在线| 97久久久精品综合88久久| 国产精品一二三四五| 日本中文字幕一区二区视频| 亚洲欧美国产三级| 欧美—级在线免费片| 精品免费视频.| 久久精品亚洲麻豆av一区二区 | 中文字幕av资源一区| 日韩亚洲欧美高清| 91精品国产综合久久国产大片| 在线一区二区三区| 91亚洲精品久久久蜜桃| 9色porny自拍视频一区二区| 国产精品一区二区在线看| 极品瑜伽女神91| 免费成人性网站| 日韩一区精品字幕| 日韩中文字幕亚洲一区二区va在线| 亚洲精品国产品国语在线app| 欧美国产综合色视频| 欧美高清一级片在线观看| 久久亚洲捆绑美女| 精品成a人在线观看| 精品99一区二区三区| 久久午夜国产精品| 久久99在线观看| 亚洲国产精品欧美一二99| 亚洲美腿欧美偷拍| 亚洲精品视频在线| 亚洲自拍偷拍图区| 亚洲夂夂婷婷色拍ww47| 亚洲一区二区三区视频在线播放 | 亚洲永久免费av| 亚洲精品第1页| 亚洲图片自拍偷拍| 亚洲成人午夜影院| 日韩精品成人一区二区三区| 蜜臀va亚洲va欧美va天堂 | 激情小说亚洲一区| 国产999精品久久久久久绿帽| 粉嫩av一区二区三区粉嫩| 岛国精品一区二区| 色菇凉天天综合网| 欧美日韩一区在线观看| 亚洲影院在线观看| 国产亚洲综合在线| 国产精品免费网站在线观看| 亚洲天堂成人在线观看| 亚洲综合色婷婷| 视频一区视频二区在线观看| 国产高清成人在线| 高清久久久久久| 91碰在线视频| 欧美一区二区啪啪| 国产精品素人一区二区| 亚洲六月丁香色婷婷综合久久 | 成人一级黄色片| 色偷偷久久人人79超碰人人澡| 91福利国产精品| 日韩欧美123| 中文字幕一区视频| 亚洲成人综合网站| 国产毛片一区二区| 在线观看欧美黄色| 亚洲精品一线二线三线| 亚洲日本va在线观看| 日韩国产欧美在线播放| 国产精品88av| 欧美美女bb生活片| 国产日产精品1区| 亚瑟在线精品视频| 国产aⅴ综合色| 欧美酷刑日本凌虐凌虐| 国产拍揄自揄精品视频麻豆| 五月激情综合色| 成人av资源在线| 欧美一个色资源| 中文字幕一区二区5566日韩| 热久久国产精品| 色一区在线观看| 久久久亚洲午夜电影| 天堂av在线一区| 不卡的av中国片| 欧美草草影院在线视频| 国产精品三级视频| 久久黄色级2电影| 欧美性猛交xxxxxx富婆| 国产农村妇女精品| 美女视频一区二区三区| 欧美日韩亚洲综合| 国产精品电影一区二区| 国产精品一区在线| 欧美岛国在线观看| 午夜国产不卡在线观看视频| 91视频在线看| 中文字幕精品一区二区精品绿巨人 | 欧美一区二区三区视频在线观看 | 1区2区3区欧美| 国产在线不卡视频| 欧美军同video69gay| 亚洲自拍欧美精品| 91免费在线视频观看| 国产精品三级av| 国产一区二区女| 日韩美女天天操| 日韩高清不卡一区| 欧美日韩极品在线观看一区| 一区二区视频在线看| 99精品视频一区二区三区| 亚洲国产精品成人综合色在线婷婷| 国产资源精品在线观看| 日韩午夜中文字幕| 蜜臀av性久久久久蜜臀aⅴ流畅| 欧美日韩免费一区二区三区| 亚洲精品国产一区二区精华液 | 国产精品美日韩| 国产精品一区二区果冻传媒| 日韩欧美一级片| 免费人成在线不卡| 欧美一区欧美二区| 日韩激情中文字幕| 欧美一区二区三区精品| 久久精品国产**网站演员| 精品欧美乱码久久久久久1区2区| 麻豆91精品91久久久的内涵| 日韩欧美综合在线| 韩国av一区二区三区在线观看| 日韩欧美高清一区| 激情图片小说一区| 久久男人中文字幕资源站| 国产精品一区久久久久| 中文字幕精品—区二区四季| 亚洲美女免费视频| 国产免费观看久久| 成人免费的视频| 欧美国产亚洲另类动漫| 暴力调教一区二区三区| 日韩美女精品在线| 在线观看国产日韩| 丝袜美腿亚洲综合| 日韩精品一区二区在线| 国产精品一区二区黑丝| 中文字幕在线观看一区二区| 91在线观看高清| 亚洲一区在线观看免费| 这里只有精品电影| 精品一区二区三区在线播放| 久久婷婷国产综合精品青草| hitomi一区二区三区精品| 亚洲激情网站免费观看| 欧美一区二区视频在线观看2020 | 国产成人小视频| 亚洲色欲色欲www| 欧美蜜桃一区二区三区| 精品一区二区免费看| 中文字幕在线不卡一区二区三区| 色激情天天射综合网| 秋霞av亚洲一区二区三| 国产蜜臀97一区二区三区| 欧洲激情一区二区| 久久国内精品自在自线400部| 国产精品网站一区| 成人高清在线视频| jlzzjlzz欧美大全| 亚洲一区成人在线| 日韩美女在线视频| av在线播放成人| 日本女优在线视频一区二区| 国产精品视频一二| 日韩一区二区三区四区| 99久久99久久精品国产片果冻| 三级一区在线视频先锋| 亚洲国产精品激情在线观看 | 91精品国产综合久久久久| 国产毛片精品视频| 亚洲国产欧美在线| 国产精品久久久久桃色tv| 欧美一级搡bbbb搡bbbb| 国产91丝袜在线播放| 日韩国产欧美视频| 成人欧美一区二区三区| 精品国产一二三区| 欧美日韩亚洲综合在线| 成人免费高清在线| 韩国中文字幕2020精品| 亚洲一区二区三区视频在线播放| 中文字幕第一区二区| 日韩欧美国产不卡|