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

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

?? tdoubleobjecthashmap.java

?? 常用機器學(xué)習(xí)算法,java編寫源代碼,內(nèi)含常用分類算法,包括說明文檔
?? 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 double keys and Object values. * * Created: Sun Nov  4 08:52:45 2001 * * @author Eric D. Friedman * @version $Id: TDoubleObjectHashMap.java,v 1.1.1.1 2003/07/14 19:36:04 mccallum Exp $ */public class TDoubleObjectHashMap extends TDoubleHash implements Serializable {    /** the values of the map */    protected transient Object[] _values;    /**     * Creates a new <code>TDoubleObjectHashMap</code> instance with the default     * capacity and load factor.     */    public TDoubleObjectHashMap() {        super();    }    /**     * Creates a new <code>TDoubleObjectHashMap</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 TDoubleObjectHashMap(int initialCapacity) {        super(initialCapacity);    }    /**     * Creates a new <code>TDoubleObjectHashMap</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 TDoubleObjectHashMap(int initialCapacity, float loadFactor) {        super(initialCapacity, loadFactor);    }    /**     * Creates a new <code>TDoubleObjectHashMap</code> instance with the default     * capacity and load factor.     * @param strategy used to compute hash codes and to compare keys.     */    public TDoubleObjectHashMap(TDoubleHashingStrategy strategy) {        super(strategy);    }    /**     * Creates a new <code>TDoubleObjectHashMap</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 TDoubleObjectHashMap(int initialCapacity, TDoubleHashingStrategy strategy) {        super(initialCapacity, strategy);    }    /**     * Creates a new <code>TDoubleObjectHashMap</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 TDoubleObjectHashMap(int initialCapacity, float loadFactor, TDoubleHashingStrategy strategy) {        super(initialCapacity, loadFactor, strategy);    }    /**     * @return a deep clone of this collection     */    public Object clone() {      TDoubleObjectHashMap m = (TDoubleObjectHashMap)super.clone();      m._values = (Object[])this._values.clone();      return m;    }    /**     * @return a TDoubleObjectIterator with access to this map's keys and values     */    public TDoubleObjectIterator iterator() {        return new TDoubleObjectIterator(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 Object[capacity];        return capacity;    }    /**     * Inserts a key/value pair into the map.     *     * @param key an <code>double</code> value     * @param value an <code>Object</code> value     * @return the previous value associated with <tt>key</tt>,     * or null if none was found.     */    public Object put(double key, Object value) {        byte previousState;        Object previous = null;        int index = insertionIndex(key);        boolean isNewMapping = true;        if (index < 0) {            index = -index -1;            previous = _values[index];            isNewMapping = false;        }        previousState = _states[index];        _set[index] = key;        _states[index] = FULL;        _values[index] = value;        if (isNewMapping) {            postInsertHook(previousState == FREE);        }        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;        double oldKeys[] = _set;        Object oldVals[] = _values;        byte oldStates[] = _states;        _set = new double[newCapacity];        _values = new Object[newCapacity];        _states = new byte[newCapacity];        for (int i = oldCapacity; i-- > 0;) {            if(oldStates[i] == FULL) {                double o = oldKeys[i];                int index = insertionIndex(o);                _set[index] = o;                _values[index] = oldVals[i];                _states[index] = FULL;            }        }    }    /**     * retrieves the value for <tt>key</tt>     *     * @param key an <code>double</code> value     * @return the value of <tt>key</tt> or null if no such mapping exists.     */    public Object get(double key) {        int index = index(key);        return index < 0 ? null : _values[index];    }    /**     * Empties the map.     *     */    public void clear() {        super.clear();        double[] keys = _set;        Object[] vals = _values;        byte[] states = _states;        for (int i = keys.length; i-- > 0;) {            keys[i] = (double)0;            vals[i] = null;            states[i] = FREE;        }    }    /**     * Deletes a key/value pair from the map.     *     * @param key an <code>double</code> value     * @return an <code>Object</code> value     */    public Object remove(double key) {        Object prev = null;        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 TDoubleObjectHashMap)) {            return false;        }        TDoubleObjectHashMap that = (TDoubleObjectHashMap)other;        if (that.size() != this.size()) {            return false;        }        return forEachEntry(new EqProcedure(that));    }    private static final class EqProcedure implements TDoubleObjectProcedure {        private final TDoubleObjectHashMap _otherMap;        EqProcedure(TDoubleObjectHashMap otherMap) {            _otherMap = otherMap;        }        public final boolean execute(double key, Object value) {            int index = _otherMap.index(key);            if (index >= 0 && eq(value, _otherMap.get(key))) {                return true;            }            return false;        }        /**         * Compare two objects for equality.         */        private final boolean eq(Object o1, Object o2) {            return o1 == o2 || ((o1 != null) && o1.equals(o2));        }    }    /**     * 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] = null;    }    /**     * Returns the values of the map.     *     * @return a <code>Collection</code> value     */    public Object[] getValues() {        Object[] vals = new Object[size()];        Object[] v = _values;        byte[] states = _states;        for (int i = v.length, j = 0; i-- > 0;) {          if (states[i] == FULL) {            vals[j++] = v[i];          }        }        return vals;    }    /**     * returns the keys of the map.     *     * @return a <code>Set</code> value     */    public double[] keys() {        double[] keys = new double[size()];        double[] k = _set;        byte[] states = _states;        for (int i = k.length, j = 0; i-- > 0;) {          if (states[i] == FULL) {            keys[j++] = k[i];          }        }        return keys;    }    /**     * checks for the presence of <tt>val</tt> in the values of the map.     *     * @param val an <code>Object</code> value     * @return a <code>boolean</code> value     */    public boolean containsValue(Object val) {        byte[] states = _states;        Object[] vals = _values;        // special case null values so that we don't have to        // perform null checks before every call to equals()        if (null == val) {            for (int i = vals.length; i-- > 0;) {                if (states[i] == FULL &&                    val == vals[i]) {                    return true;                }            }        } else {            for (int i = vals.length; i-- > 0;) {                if (states[i] == FULL &&                    (val == vals[i] || val.equals(vals[i]))) {                    return true;                }            }        } // end of else        return false;    }    /**     * checks for the present of <tt>key</tt> in the keys of the map.     *     * @param key an <code>double</code> value     * @return a <code>boolean</code> value     */    public boolean containsKey(double key) {        return contains(key);    }    /**     * Executes <tt>procedure</tt> for each key in the map.     *     * @param procedure a <code>TDoubleProcedure</code> value     * @return false if the loop over the keys terminated because     * the procedure returned false for some key.     */    public boolean forEachKey(TDoubleProcedure procedure) {        return forEach(procedure);    }    /**     * Executes <tt>procedure</tt> for each value in the map.     *     * @param procedure a <code>TObjectProcedure</code> value     * @return false if the loop over the values terminated because     * the procedure returned false for some value.     */    public boolean forEachValue(TObjectProcedure procedure) {        byte[] states = _states;        Object[] values = _values;        for (int i = values.length; i-- > 0;) {            if (states[i] == FULL && ! procedure.execute(values[i])) {                return false;            }        }        return true;    }    /**     * Executes <tt>procedure</tt> for each key/value entry in the     * map.     *     * @param procedure a <code>TODoubleObjectProcedure</code> value     * @return false if the loop over the entries terminated because     * the procedure returned false for some entry.     */    public boolean forEachEntry(TDoubleObjectProcedure procedure) {        byte[] states = _states;        double[] keys = _set;        Object[] values = _values;        for (int i = keys.length; i-- > 0;) {            if (states[i] == FULL && ! 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(TDoubleObjectProcedure procedure) {        boolean modified = false;        byte[] states = _states;        double[] keys = _set;        Object[] values = _values;        for (int i = keys.length; i-- > 0;) {            if (states[i] == FULL && ! 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>TObjectFunction</code> value     */    public void transformValues(TObjectFunction function) {        byte[] states = _states;        Object[] values = _values;        for (int i = values.length; i-- > 0;) {            if (states[i] == FULL) {                values[i] = function.execute(values[i]);            }        }    }    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) {            double key = stream.readDouble();            Object val = stream.readObject();            put(key, val);        }    }} // TDoubleObjectHashMap

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲同性同志一二三专区| 欧美α欧美αv大片| 亚洲人成精品久久久久| 91色视频在线| 亚洲美女一区二区三区| 欧美在线999| 日韩中文字幕亚洲一区二区va在线 | 一区二区三区四区在线免费观看| 一本久久a久久精品亚洲| 一区二区三区日韩在线观看| 欧美日韩国产经典色站一区二区三区| 婷婷成人综合网| 欧美xxxx老人做受| 波多野结衣在线aⅴ中文字幕不卡| 亚洲视频一区在线观看| 欧美日韩一区在线观看| 久久不见久久见免费视频7| 久久这里只有精品视频网| av午夜一区麻豆| 成年人网站91| 亚洲gay无套男同| 久久久亚洲高清| 色香蕉久久蜜桃| 蜜臀av一区二区在线免费观看| 久久久久国产免费免费| 91在线小视频| 美国一区二区三区在线播放| 日本一区二区成人在线| 欧美日韩高清影院| 国产成人av一区二区| 亚洲综合丁香婷婷六月香| 337p日本欧洲亚洲大胆精品| 91网址在线看| 国产一区二区在线影院| 亚洲一区二区三区四区不卡| 久久综合狠狠综合| 欧美老年两性高潮| 成人av在线资源网站| 免费欧美日韩国产三级电影| 中文天堂在线一区| 欧美一区二区在线免费播放| 99re在线视频这里只有精品| 蜜臀av性久久久久蜜臀aⅴ四虎 | 国产欧美一区二区精品性| 91在线看国产| 国产精品一卡二卡| 日韩精品每日更新| 亚洲一区在线免费观看| 欧美国产成人精品| 日韩精品在线一区二区| 欧美日韩一区二区电影| 91免费视频网| 国产xxx精品视频大全| 日本视频在线一区| 亚洲精品亚洲人成人网| 国产精品久久久久四虎| 欧美mv和日韩mv国产网站| 在线成人av网站| 日本高清不卡视频| 91在线精品秘密一区二区| 粉嫩一区二区三区在线看| 激情文学综合插| 美女视频网站久久| 蜜桃一区二区三区四区| 无吗不卡中文字幕| 亚洲成人精品一区| 亚洲成人免费av| 午夜亚洲国产au精品一区二区| 亚洲美女视频在线观看| 日韩美女视频一区| 亚洲视频免费观看| 亚洲精品v日韩精品| 综合电影一区二区三区 | 欧美一二三在线| 8v天堂国产在线一区二区| 欧美性猛片aaaaaaa做受| 日本高清无吗v一区| 色一区在线观看| 欧美私人免费视频| 欧美精品 国产精品| 欧美日韩不卡一区二区| 欧美丰满嫩嫩电影| 日韩欧美一二区| 亚洲精品在线观看网站| wwwwww.欧美系列| 久久久久九九视频| 亚洲天天做日日做天天谢日日欢 | 久久久久久99久久久精品网站| 久久综合丝袜日本网| 国产亚洲精品资源在线26u| 久久精品视频一区二区| 国产精品久久免费看| 一区二区三区在线视频观看58 | 久久精品国产秦先生| 国产精品一区二区无线| 97久久精品人人做人人爽| 欧美在线free| 欧美va亚洲va| 国产精品美日韩| 亚洲精品成人天堂一二三| 日本vs亚洲vs韩国一区三区| 韩国精品免费视频| 色综合天天综合给合国产| 欧美日韩成人一区| 久久久久9999亚洲精品| 最新不卡av在线| 蜜乳av一区二区| 国产91精品一区二区麻豆网站| 91麻豆免费看片| 日韩视频在线永久播放| 中文字幕第一区二区| 亚洲一级电影视频| 国产裸体歌舞团一区二区| 色婷婷综合久色| 日韩欧美自拍偷拍| 亚洲视频 欧洲视频| 热久久一区二区| 94-欧美-setu| 日韩免费电影一区| 椎名由奈av一区二区三区| 久久精品国产亚洲aⅴ| 91视视频在线观看入口直接观看www| 欧美三级日本三级少妇99| 久久奇米777| 亚洲二区在线观看| jlzzjlzz国产精品久久| 欧美一区二区三区免费视频 | 亚洲午夜久久久久久久久久久| 麻豆专区一区二区三区四区五区| 91香蕉国产在线观看软件| www日韩大片| 婷婷丁香激情综合| 91亚洲国产成人精品一区二区三 | 中文字幕成人网| 奇米综合一区二区三区精品视频| 91美女精品福利| 国产喷白浆一区二区三区| 日本怡春院一区二区| 91视频一区二区| 久久影院电视剧免费观看| 日韩高清不卡一区| 在线观看日韩一区| 亚洲人成7777| 不卡的av电影| 中日韩av电影| 国产精品一区久久久久| 精品国产免费一区二区三区四区| 亚洲成av人片在线观看无码| 色综合天天综合狠狠| 国产精品高清亚洲| 成人综合在线视频| 国产欧美精品日韩区二区麻豆天美 | 精品黑人一区二区三区久久| 亚洲国产中文字幕| 色婷婷精品久久二区二区蜜臀av| 国产精品丝袜一区| 成人av中文字幕| 中文字幕在线一区| 99久久精品一区二区| 国产精品亲子伦对白| 风间由美性色一区二区三区| 久久男人中文字幕资源站| 国产美女主播视频一区| 久久综合九色综合欧美98| 久久99精品久久久久久动态图 | 天堂影院一区二区| 精品视频资源站| 亚洲观看高清完整版在线观看| 欧洲av在线精品| 天涯成人国产亚洲精品一区av| 欧美日韩国产经典色站一区二区三区| 亚洲超碰97人人做人人爱| 欧美揉bbbbb揉bbbbb| 性做久久久久久| 91精品国产高清一区二区三区蜜臀| 亚洲成人高清在线| 欧美日韩成人综合| 久久福利视频一区二区| 国产日韩欧美精品一区| 91影院在线观看| 亚洲一区二区视频在线观看| 欧美日韩电影在线| 激情综合网最新| 中文乱码免费一区二区| 色天天综合久久久久综合片| 亚洲电影欧美电影有声小说| 日韩精品一区二区三区四区| 国产精品一区二区男女羞羞无遮挡| 国产精品久久久久影院亚瑟 | 制服丝袜成人动漫| 久久99精品久久久久久动态图| 国产婷婷一区二区| 欧美在线观看禁18| 毛片基地黄久久久久久天堂| 国产三级精品三级在线专区| 91久久一区二区| 久久激情综合网| 亚洲欧美二区三区| 日韩欧美不卡一区| 成人毛片在线观看|