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

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

?? tobjectinthashmap.java

?? 常用機器學習算法,java編寫源代碼,內含常用分類算法,包括說明文檔
?? JAVA
字號:
///////////////////////////////////////////////////////////////////////////////// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.//// This library is free software; you can redistribute it and/or// modify it under the terms of the GNU Lesser General Public// License as published by the Free Software Foundation; either// version 2.1 of the License, or (at your option) any later version.//// This library is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the// GNU General Public License for more details.//// You should have received a copy of the GNU Lesser General Public// License along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.///////////////////////////////////////////////////////////////////////////////package gnu.trove;import java.io.IOException;import java.io.ObjectInputStream;import java.io.ObjectOutputStream;import java.io.Serializable;/** * An open addressed Map implementation for Object keys and int values. * * Created: Sun Nov  4 08:52:45 2001 * * @author Eric D. Friedman * @version $Id: TObjectIntHashMap.java,v 1.1.1.1 2003/07/14 19:36:04 mccallum Exp $ */public class TObjectIntHashMap extends TObjectHash implements Serializable {    /** the values of the map */    protected transient int[] _values;    /**     * Creates a new <code>TObjectIntHashMap</code> instance with the default     * capacity and load factor.     */    public TObjectIntHashMap() {        super();    }    /**     * Creates a new <code>TObjectIntHashMap</code> instance with a prime     * capacity equal to or greater than <tt>initialCapacity</tt> and     * with the default load factor.     *     * @param initialCapacity an <code>int</code> value     */    public TObjectIntHashMap(int initialCapacity) {        super(initialCapacity);    }    /**     * Creates a new <code>TObjectIntHashMap</code> instance with a prime     * capacity equal to or greater than <tt>initialCapacity</tt> and     * with the specified load factor.     *     * @param initialCapacity an <code>int</code> value     * @param loadFactor a <code>float</code> value     */    public TObjectIntHashMap(int initialCapacity, float loadFactor) {        super(initialCapacity, loadFactor);    }    /**     * Creates a new <code>TObjectIntHashMap</code> instance with the default     * capacity and load factor.     * @param strategy used to compute hash codes and to compare keys.     */    public TObjectIntHashMap(TObjectHashingStrategy strategy) {        super(strategy);    }    /**     * Creates a new <code>TObjectIntHashMap</code> instance whose capacity     * is the next highest prime above <tt>initialCapacity + 1</tt>     * unless that value is already prime.     *     * @param initialCapacity an <code>int</code> value     * @param strategy used to compute hash codes and to compare keys.     */    public TObjectIntHashMap(int initialCapacity, TObjectHashingStrategy strategy) {        super(initialCapacity, strategy);    }    /**     * Creates a new <code>TObjectIntHashMap</code> instance with a prime     * value at or near the specified capacity and load factor.     *     * @param initialCapacity used to find a prime capacity for the table.     * @param loadFactor used to calculate the threshold over which     * rehashing takes place.     * @param strategy used to compute hash codes and to compare keys.     */    public TObjectIntHashMap(int initialCapacity, float loadFactor, TObjectHashingStrategy strategy) {        super(initialCapacity, loadFactor, strategy);    }    /**     * @return an iterator over the entries in this map     */    public TObjectIntIterator iterator() {        return new TObjectIntIterator(this);    }    /**     * initializes the hashtable to a prime capacity which is at least     * <tt>initialCapacity + 1</tt>.       *     * @param initialCapacity an <code>int</code> value     * @return the actual capacity chosen     */    protected int setUp(int initialCapacity) {        int capacity;        capacity = super.setUp(initialCapacity);        _values = new int[capacity];        return capacity;    }    /**     * Inserts a key/value pair into the map.     *     * @param key an <code>Object</code> value     * @param value an <code>int</code> value     * @return the previous value associated with <tt>key</tt>,     * or null if none was found.     */    public int put(Object key, int value) {        int previous = (int)0;        int index = insertionIndex(key);        boolean isNewMapping = true;        if (index < 0) {            index = -index -1;            previous = _values[index];            isNewMapping = false;        }        Object oldKey = _set[index];        _set[index] = key;        _values[index] = value;        if (isNewMapping) {            postInsertHook(oldKey == null);        }        return previous;    }    /**     * rehashes the map to the new capacity.     *     * @param newCapacity an <code>int</code> value     */    protected void rehash(int newCapacity) {        int oldCapacity = _set.length;        Object oldKeys[] = _set;        int oldVals[] = _values;        _set = new Object[newCapacity];        _values = new int[newCapacity];        for (int i = oldCapacity; i-- > 0;) {          if(oldKeys[i] != null && oldKeys[i] != REMOVED) {                Object o = oldKeys[i];                int index = insertionIndex(o);                _set[index] = o;                _values[index] = oldVals[i];            }        }    }    /**     * retrieves the value for <tt>key</tt>     *     * @param key an <code>Object</code> value     * @return the value of <tt>key</tt> or -1 if no such mapping exists.     */    public int get(Object key) {        int index = index(key);        return index < 0 ? (int)-1 : _values[index];    }    /**     * Empties the map.     *     */    public void clear() {        super.clear();        Object[] keys = _set;        int[] vals = _values;        for (int i = keys.length; i-- > 0;) {            keys[i] = null;            vals[i] = (int)0;        }    }    /**     * Deletes a key/value pair from the map.     *     * @param key an <code>Object</code> value     * @return an <code>int</code> value     */    public int remove(Object key) {        int prev = (int)0;        int index = index(key);        if (index >= 0) {            prev = _values[index];            removeAt(index);    // clear key,state; adjust size        }        return prev;    }    /**     * Compares this map with another map for equality of their stored     * entries.     *     * @param other an <code>Object</code> value     * @return a <code>boolean</code> value     */    public boolean equals(Object other) {        if (! (other instanceof TObjectIntHashMap)) {            return false;        }        TObjectIntHashMap that = (TObjectIntHashMap)other;        if (that.size() != this.size()) {            return false;        }        return forEachEntry(new EqProcedure(that));    }    private static final class EqProcedure implements TObjectIntProcedure {        private final TObjectIntHashMap _otherMap;        EqProcedure(TObjectIntHashMap otherMap) {            _otherMap = otherMap;        }        public final boolean execute(Object key, int value) {            int index = _otherMap.index(key);            if (index >= 0 && eq(value, _otherMap.get(key))) {                return true;            }            return false;        }        /**         * Compare two ints for equality.         */        private final boolean eq(int v1, int v2) {            return v1 == v2;        }    }    /**     * removes the mapping at <tt>index</tt> from the map.     *     * @param index an <code>int</code> value     */    protected void removeAt(int index) {        super.removeAt(index);  // clear key, state; adjust size        _values[index] = (int)0;    }    /**     * Returns the values of the map.     *     * @return a <code>Collection</code> value     */    public int[] getValues() {        int[] vals = new int[size()];        int[] v = _values;        Object[] keys = _set;        for (int i = v.length, j = 0; i-- > 0;) {          if (keys[i] != null && keys[i] != REMOVED) {            vals[j++] = v[i];          }        }        return vals;    }    /**     * returns the keys of the map.     *     * @return a <code>Set</code> value     */    public Object[] keys() {        Object[] keys = new Object[size()];        Object[] k = _set;        for (int i = k.length, j = 0; i-- > 0;) {          if (k[i] != null && k[i] != REMOVED) {            keys[j++] = k[i];          }        }        return keys;    }    /**     * checks for the presence of <tt>val</tt> in the values of the map.     *     * @param val an <code>int</code> value     * @return a <code>boolean</code> value     */    public boolean containsValue(int val) {        Object[] keys = _set;        int[] vals = _values;        for (int i = vals.length; i-- > 0;) {            if (keys[i] != null && keys[i] != REMOVED && val == vals[i]) {                return true;            }        }        return false;    }    /**     * checks for the present of <tt>key</tt> in the keys of the map.     *     * @param key an <code>Object</code> value     * @return a <code>boolean</code> value     */    public boolean containsKey(Object key) {        return contains(key);    }    /**     * Executes <tt>procedure</tt> for each key in the map.     *     * @param procedure a <code>TObjectProcedure</code> value     * @return false if the loop over the keys terminated because     * the procedure returned false for some key.     */    public boolean forEachKey(TObjectProcedure procedure) {        return forEach(procedure);    }    /**     * Executes <tt>procedure</tt> for each value in the map.     *     * @param procedure a <code>TIntProcedure</code> value     * @return false if the loop over the values terminated because     * the procedure returned false for some value.     */    public boolean forEachValue(TIntProcedure procedure) {        Object[] keys = _set;        int[] values = _values;        for (int i = values.length; i-- > 0;) {            if (keys[i] != null && keys[i] != REMOVED                && ! procedure.execute(values[i])) {                return false;            }        }        return true;    }    /**     * Executes <tt>procedure</tt> for each key/value entry in the     * map.     *     * @param procedure a <code>TOObjectIntProcedure</code> value     * @return false if the loop over the entries terminated because     * the procedure returned false for some entry.     */    public boolean forEachEntry(TObjectIntProcedure procedure) {        Object[] keys = _set;        int[] values = _values;        for (int i = keys.length; i-- > 0;) {            if (keys[i] != null                && keys[i] != REMOVED                && ! procedure.execute(keys[i],values[i])) {                return false;            }        }        return true;    }    /**     * Retains only those entries in the map for which the procedure     * returns a true value.     *     * @param procedure determines which entries to keep     * @return true if the map was modified.     */    public boolean retainEntries(TObjectIntProcedure procedure) {        boolean modified = false;        Object[] keys = _set;        int[] values = _values;        for (int i = keys.length; i-- > 0;) {            if (keys[i] != null                && keys[i] != REMOVED                && ! procedure.execute(keys[i],values[i])) {                removeAt(i);                modified = true;            }        }        return modified;    }    /**     * Transform the values in this map using <tt>function</tt>.     *     * @param function a <code>TIntFunction</code> value     */    public void transformValues(TIntFunction function) {        Object[] keys = _set;        int[] values = _values;        for (int i = values.length; i-- > 0;) {            if (keys[i] != null && keys[i] != REMOVED) {                values[i] = function.execute(values[i]);            }        }    }    /**     * Increments the primitive value mapped to key by 1     *     * @param key the key of the value to increment     * @return true if a mapping was found and modified.     */    public boolean increment(Object key) {        return adjustValue(key, (int)1);    }    /**     * Adjusts the primitive value mapped to key.     *     * @param key the key of the value to increment     * @param amount the amount to adjust the value by.     * @return true if a mapping was found and modified.     */    public boolean adjustValue(Object key, int amount) {        int index = index(key);        if (index < 0) {            return false;        } else {            _values[index] += amount;            return true;        }    }    private void writeObject(ObjectOutputStream stream)        throws IOException {        stream.defaultWriteObject();        // number of entries        stream.writeInt(_size);        SerializationProcedure writeProcedure = new SerializationProcedure(stream);        if (! forEachEntry(writeProcedure)) {            throw writeProcedure.exception;        }    }    private void readObject(ObjectInputStream stream)        throws IOException, ClassNotFoundException {        stream.defaultReadObject();        int size = stream.readInt();        setUp(size);        while (size-- > 0) {            Object key = stream.readObject();            int val = stream.readInt();            put(key, val);        }    }} // TObjectIntHashMap

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91免费国产在线观看| 樱桃视频在线观看一区| 一区二区三区在线播| 青草av.久久免费一区| 一本色道a无线码一区v| 久久亚洲二区三区| 午夜视黄欧洲亚洲| 日本乱人伦aⅴ精品| 国产欧美一区二区精品秋霞影院| 日韩电影一二三区| 91福利国产精品| 亚洲欧洲国产日本综合| 国内欧美视频一区二区| 在线91免费看| 午夜日韩在线电影| 欧美性一二三区| 国产精品国产三级国产三级人妇| 国内精品国产成人| 日韩一卡二卡三卡国产欧美| 亚洲一区二区三区在线| 91亚洲男人天堂| 中文字幕一区二区三区不卡| 处破女av一区二区| 日本一区二区免费在线观看视频 | 国产精品网站在线| 老司机免费视频一区二区三区| 欧美性做爰猛烈叫床潮| 中文字幕亚洲欧美在线不卡| 懂色av中文字幕一区二区三区| 久久久www成人免费毛片麻豆| 激情小说欧美图片| 精品久久五月天| 国产精品白丝av| 国产欧美日韩麻豆91| 国产成人免费在线视频| 久久亚洲综合色一区二区三区 | 日韩美女一区二区三区四区| 麻豆国产精品777777在线| 91精品在线一区二区| 轻轻草成人在线| 日韩免费视频一区| 韩国在线一区二区| 国产亚洲一二三区| 成人中文字幕合集| 亚洲丝袜美腿综合| 欧洲国产伦久久久久久久| 性做久久久久久| 日韩精品一区二区三区四区| 久久99精品久久只有精品| 日韩精品在线一区二区| 国产二区国产一区在线观看| 亚洲色图欧美激情| 欧美性做爰猛烈叫床潮| 久久精品国产精品亚洲红杏| 久久午夜羞羞影院免费观看| 成人理论电影网| 亚洲国产一区视频| 久久亚洲二区三区| 色哟哟日韩精品| 日韩制服丝袜先锋影音| 精品国产人成亚洲区| 成人动漫在线一区| 天天做天天摸天天爽国产一区| 精品理论电影在线| 在线亚洲免费视频| 狠狠色狠狠色合久久伊人| ●精品国产综合乱码久久久久| 欧美探花视频资源| 国产精品一区二区男女羞羞无遮挡| 亚洲三级在线观看| 日韩三级精品电影久久久| 成人免费精品视频| 视频在线观看91| 国产精品美女久久久久久久久| 欧美日韩国产天堂| 成人激情视频网站| 日韩精品乱码免费| 18成人在线视频| 精品国产乱子伦一区| 欧美亚洲一区三区| 国产高清久久久久| 美女爽到高潮91| 亚洲电影欧美电影有声小说| 久久精品男人天堂av| 91麻豆精品国产91久久久资源速度| 成人免费看视频| 狠狠v欧美v日韩v亚洲ⅴ| 一区二区三区美女视频| 欧美国产成人精品| 久久综合狠狠综合| 日韩一卡二卡三卡国产欧美| 欧美亚洲国产一区二区三区va| 成人永久aaa| 狠狠色综合色综合网络| 天天av天天翘天天综合网 | 久久久亚洲高清| 欧美视频三区在线播放| 97精品电影院| 成人av在线影院| 国产一区二区免费在线| 麻豆精品新av中文字幕| 激情综合色丁香一区二区| 日韩精品91亚洲二区在线观看 | 石原莉奈在线亚洲三区| 尤物av一区二区| 亚洲欧美另类图片小说| 国产精品毛片高清在线完整版 | 国产精品理伦片| 国产亚洲精品aa| 久久新电视剧免费观看| 久久久亚洲综合| 久久久国产午夜精品| 欧美精品一区二区三区在线 | 久久精品二区亚洲w码| 日av在线不卡| 美国欧美日韩国产在线播放| 日韩avvvv在线播放| 首页国产丝袜综合| 免费xxxx性欧美18vr| 日本中文一区二区三区| 欧美aaaaa成人免费观看视频| 视频一区二区三区入口| 麻豆成人久久精品二区三区小说| 青青草国产成人av片免费| 麻豆精品在线视频| 激情成人综合网| 成人妖精视频yjsp地址| 成人精品国产一区二区4080| 99精品桃花视频在线观看| 91社区在线播放| 精品视频在线看| 日韩精品一区二区三区三区免费 | 精品一区二区三区在线播放| 激情图区综合网| www.亚洲在线| 欧美私人免费视频| 精品少妇一区二区三区在线播放| 精品国产凹凸成av人导航| 国产精品视频一二三区| 亚洲综合男人的天堂| 裸体在线国模精品偷拍| 福利视频网站一区二区三区| 91麻豆产精品久久久久久 | 蜜臀久久99精品久久久画质超高清| 蜜乳av一区二区| 成人激情开心网| 欧美日本一道本在线视频| 久久久久久免费| 一区二区欧美在线观看| 精彩视频一区二区| 色婷婷综合中文久久一本| 欧美一区二区三区白人| 国产精品乱码一区二三区小蝌蚪| 亚洲国产综合色| 国产风韵犹存在线视精品| 欧美视频一区在线| 中文文精品字幕一区二区| 亚洲无线码一区二区三区| 国产老女人精品毛片久久| 欧美亚洲综合久久| 国产精品伦理在线| 老色鬼精品视频在线观看播放| 99久久久久久99| 亚洲精品在线电影| 亚洲va中文字幕| 欧美一区二区三区在线观看视频| 国产欧美一区二区精品婷婷| 日精品一区二区| 91蝌蚪porny九色| 国产性天天综合网| 久久99在线观看| 欧美日韩综合一区| 亚洲人成7777| 国产91富婆露脸刺激对白| 日韩欧美色综合| 婷婷综合另类小说色区| 91在线一区二区| 国产拍揄自揄精品视频麻豆| 麻豆高清免费国产一区| 欧美三区在线视频| 亚洲人成在线观看一区二区| 国产成人av影院| 精品久久久久久亚洲综合网 | 欧美日韩国产一区| 亚洲乱码中文字幕综合| 成人午夜激情视频| 国产欧美精品一区二区色综合朱莉| 久久国产乱子精品免费女| 欧美日韩精品欧美日韩精品| 亚洲三级小视频| 99热99精品| 中文字幕在线观看一区| 成人免费不卡视频| 日本一区二区免费在线| 成人午夜视频免费看| 国产色产综合产在线视频| 国产盗摄一区二区| 国产日韩欧美麻豆| av一二三不卡影片| 亚洲乱码国产乱码精品精的特点 |