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

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

?? hashmap.java

?? linux下編程用 編譯軟件
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* HashMap.java -- a class providing a basic hashtable data structure,   mapping Object --> Object   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005  Free Software Foundation, Inc.This file is part of GNU Classpath.GNU Classpath is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2, or (at your option)any later version.GNU Classpath is distributed in the hope that it will be useful, butWITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNUGeneral Public License for more details.You should have received a copy of the GNU General Public Licensealong with GNU Classpath; see the file COPYING.  If not, write to theFree Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA02110-1301 USA.Linking this library statically or dynamically with other modules ismaking a combined work based on this library.  Thus, the terms andconditions of the GNU General Public License cover the wholecombination.As a special exception, the copyright holders of this library give youpermission to link this library with independent modules to produce anexecutable, regardless of the license terms of these independentmodules, and to copy and distribute the resulting executable underterms of your choice, provided that you also meet, for each linkedindependent module, the terms and conditions of the license of thatmodule.  An independent module is a module which is not derived fromor based on this library.  If you modify this library, you may extendthis exception to your version of the library, but you are notobligated to do so.  If you do not wish to do so, delete thisexception statement from your version. */package java.util;import java.io.IOException;import java.io.ObjectInputStream;import java.io.ObjectOutputStream;import java.io.Serializable;// NOTE: This implementation is very similar to that of Hashtable. If you fix// a bug in here, chances are you should make a similar change to the Hashtable// code.// NOTE: This implementation has some nasty coding style in order to// support LinkedHashMap, which extends this./** * This class provides a hashtable-backed implementation of the * Map interface. * <p> * * It uses a hash-bucket approach; that is, hash collisions are handled * by linking the new node off of the pre-existing node (or list of * nodes).  In this manner, techniques such as linear probing (which * can cause primary clustering) and rehashing (which does not fit very * well with Java's method of precomputing hash codes) are avoided. * <p> * * Under ideal circumstances (no collisions), HashMap offers O(1) * performance on most operations (<code>containsValue()</code> is, * of course, O(n)).  In the worst case (all keys map to the same * hash code -- very unlikely), most operations are O(n). * <p> * * HashMap is part of the JDK1.2 Collections API.  It differs from * Hashtable in that it accepts the null key and null values, and it * does not support "Enumeration views." Also, it is not synchronized; * if you plan to use it in multiple threads, consider using:<br> * <code>Map m = Collections.synchronizedMap(new HashMap(...));</code> * <p> * * The iterators are <i>fail-fast</i>, meaning that any structural * modification, except for <code>remove()</code> called on the iterator * itself, cause the iterator to throw a * <code>ConcurrentModificationException</code> rather than exhibit * non-deterministic behavior. * * @author Jon Zeppieri * @author Jochen Hoenicke * @author Bryce McKinlay * @author Eric Blake (ebb9@email.byu.edu) * @see Object#hashCode() * @see Collection * @see Map * @see TreeMap * @see LinkedHashMap * @see IdentityHashMap * @see Hashtable * @since 1.2 * @status updated to 1.4 */public class HashMap extends AbstractMap  implements Map, Cloneable, Serializable{  /**   * Default number of buckets. This is the value the JDK 1.3 uses. Some   * early documentation specified this value as 101. That is incorrect.   * Package visible for use by HashSet.   */  static final int DEFAULT_CAPACITY = 11;  /**   * The default load factor; this is explicitly specified by the spec.   * Package visible for use by HashSet.   */  static final float DEFAULT_LOAD_FACTOR = 0.75f;  /**   * Compatible with JDK 1.2.   */  private static final long serialVersionUID = 362498820763181265L;  /**   * The rounded product of the capacity and the load factor; when the number   * of elements exceeds the threshold, the HashMap calls   * <code>rehash()</code>.   * @serial the threshold for rehashing   */  private int threshold;  /**   * Load factor of this HashMap:  used in computing the threshold.   * Package visible for use by HashSet.   * @serial the load factor   */  final float loadFactor;  /**   * Array containing the actual key-value mappings.   * Package visible for use by nested and subclasses.   */  transient HashEntry[] buckets;  /**   * Counts the number of modifications this HashMap has undergone, used   * by Iterators to know when to throw ConcurrentModificationExceptions.   * Package visible for use by nested and subclasses.   */  transient int modCount;  /**   * The size of this HashMap:  denotes the number of key-value pairs.   * Package visible for use by nested and subclasses.   */  transient int size;  /**   * The cache for {@link #entrySet()}.   */  private transient Set entries;  /**   * Class to represent an entry in the hash table. Holds a single key-value   * pair. Package visible for use by subclass.   *   * @author Eric Blake (ebb9@email.byu.edu)   */  static class HashEntry extends AbstractMap.BasicMapEntry  {    /**     * The next entry in the linked list. Package visible for use by subclass.     */    HashEntry next;    /**     * Simple constructor.     * @param key the key     * @param value the value     */    HashEntry(Object key, Object value)    {      super(key, value);    }    /**     * Called when this entry is accessed via {@link #put(Object, Object)}.     * This version does nothing, but in LinkedHashMap, it must do some     * bookkeeping for access-traversal mode.     */    void access()    {    }    /**     * Called when this entry is removed from the map. This version simply     * returns the value, but in LinkedHashMap, it must also do bookkeeping.     *     * @return the value of this key as it is removed     */    Object cleanup()    {      return value;    }  }  /**   * Construct a new HashMap with the default capacity (11) and the default   * load factor (0.75).   */  public HashMap()  {    this(DEFAULT_CAPACITY, DEFAULT_LOAD_FACTOR);  }  /**   * Construct a new HashMap from the given Map, with initial capacity   * the greater of the size of <code>m</code> or the default of 11.   * <p>   *   * Every element in Map m will be put into this new HashMap.   *   * @param m a Map whose key / value pairs will be put into the new HashMap.   *        <b>NOTE: key / value pairs are not cloned in this constructor.</b>   * @throws NullPointerException if m is null   */  public HashMap(Map m)  {    this(Math.max(m.size() * 2, DEFAULT_CAPACITY), DEFAULT_LOAD_FACTOR);    putAll(m);  }  /**   * Construct a new HashMap with a specific inital capacity and   * default load factor of 0.75.   *   * @param initialCapacity the initial capacity of this HashMap (&gt;=0)   * @throws IllegalArgumentException if (initialCapacity &lt; 0)   */  public HashMap(int initialCapacity)  {    this(initialCapacity, DEFAULT_LOAD_FACTOR);  }  /**   * Construct a new HashMap with a specific inital capacity and load factor.   *   * @param initialCapacity the initial capacity (&gt;=0)   * @param loadFactor the load factor (&gt; 0, not NaN)   * @throws IllegalArgumentException if (initialCapacity &lt; 0) ||   *                                     ! (loadFactor &gt; 0.0)   */  public HashMap(int initialCapacity, float loadFactor)  {    if (initialCapacity < 0)      throw new IllegalArgumentException("Illegal Capacity: "                                         + initialCapacity);    if (! (loadFactor > 0)) // check for NaN too      throw new IllegalArgumentException("Illegal Load: " + loadFactor);    if (initialCapacity == 0)      initialCapacity = 1;    buckets = new HashEntry[initialCapacity];    this.loadFactor = loadFactor;    threshold = (int) (initialCapacity * loadFactor);  }  /**   * Returns the number of kay-value mappings currently in this Map.   *   * @return the size   */  public int size()  {    return size;  }  /**   * Returns true if there are no key-value mappings currently in this Map.   *   * @return <code>size() == 0</code>   */  public boolean isEmpty()  {    return size == 0;  }  /**   * Return the value in this HashMap associated with the supplied key,   * or <code>null</code> if the key maps to nothing.  NOTE: Since the value   * could also be null, you must use containsKey to see if this key   * actually maps to something.   *   * @param key the key for which to fetch an associated value   * @return what the key maps to, if present   * @see #put(Object, Object)   * @see #containsKey(Object)   */  public Object get(Object key)  {    int idx = hash(key);    HashEntry e = buckets[idx];    while (e != null)      {        if (equals(key, e.key))          return e.value;        e = e.next;      }    return null;  }  /**   * Returns true if the supplied object <code>equals()</code> a key   * in this HashMap.   *   * @param key the key to search for in this HashMap   * @return true if the key is in the table   * @see #containsValue(Object)   */  public boolean containsKey(Object key)  {    int idx = hash(key);    HashEntry e = buckets[idx];    while (e != null)      {        if (equals(key, e.key))          return true;        e = e.next;      }    return false;  }  /**   * Puts the supplied value into the Map, mapped by the supplied key.   * The value may be retrieved by any object which <code>equals()</code>   * this key. NOTE: Since the prior value could also be null, you must   * first use containsKey if you want to see if you are replacing the   * key's mapping.   *   * @param key the key used to locate the value   * @param value the value to be stored in the HashMap   * @return the prior mapping of the key, or null if there was none   * @see #get(Object)   * @see Object#equals(Object)   */  public Object put(Object key, Object value)  {    int idx = hash(key);    HashEntry e = buckets[idx];    while (e != null)      {        if (equals(key, e.key))          {            e.access(); // Must call this for bookkeeping in LinkedHashMap.            Object r = e.value;            e.value = value;            return r;          }        else          e = e.next;      }    // At this point, we know we need to add a new entry.    modCount++;    if (++size > threshold)      {        rehash();        // Need a new hash value to suit the bigger table.        idx = hash(key);      }    // LinkedHashMap cannot override put(), hence this call.    addEntry(key, value, idx, true);    return null;  }  /**   * Copies all elements of the given map into this hashtable.  If this table   * already has a mapping for a key, the new mapping replaces the current   * one.   *   * @param m the map to be hashed into this   */  public void putAll(Map m)  {    Iterator itr = m.entrySet().iterator();    while (itr.hasNext())      {        Map.Entry e = (Map.Entry) itr.next();        // Optimize in case the Entry is one of our own.        if (e instanceof AbstractMap.BasicMapEntry)          {            AbstractMap.BasicMapEntry entry = (AbstractMap.BasicMapEntry) e;            put(entry.key, entry.value);          }        else          put(e.getKey(), e.getValue());      }  }    /**   * Removes from the HashMap and returns the value which is mapped by the   * supplied key. If the key maps to nothing, then the HashMap remains   * unchanged, and <code>null</code> is returned. NOTE: Since the value   * could also be null, you must use containsKey to see if you are   * actually removing a mapping.   *   * @param key the key used to locate the value to remove   * @return whatever the key mapped to, if present   */  public Object remove(Object key)  {    int idx = hash(key);    HashEntry e = buckets[idx];    HashEntry last = null;    while (e != null)      {        if (equals(key, e.key))          {            modCount++;            if (last == null)              buckets[idx] = e.next;            else              last.next = e.next;            size--;            // Method call necessary for LinkedHashMap to work correctly.            return e.cleanup();          }        last = e;        e = e.next;      }    return null;  }  /**   * Clears the Map so it has no keys. This is O(1).   */  public void clear()  {    if (size != 0)      {        modCount++;        Arrays.fill(buckets, null);        size = 0;      }  }  /**   * Returns true if this HashMap contains a value <code>o</code>, such that   * <code>o.equals(value)</code>.   *   * @param value the value to search for in this HashMap   * @return true if at least one key maps to the value   * @see #containsKey(Object)   */  public boolean containsValue(Object value)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人黄色av电影| 欧美三级电影在线看| 成人免费毛片高清视频| 午夜一区二区三区在线观看| 国产日产精品一区| 91精品国产综合久久精品图片| 国产成人一区在线| 久久精品国产色蜜蜜麻豆| 亚洲综合色丁香婷婷六月图片| 国产调教视频一区| 日韩欧美成人激情| 欧美美女激情18p| 97se亚洲国产综合在线| 国产乱子伦视频一区二区三区 | 丁香啪啪综合成人亚洲小说 | 欧美亚洲免费在线一区| 成人一区在线看| 国产在线一区观看| 日本欧美在线观看| 亚洲电影第三页| 亚洲一区二区三区四区在线| 日本一区二区动态图| 久久综合久久综合久久综合| 欧美一区二区三区喷汁尤物| 欧美亚洲自拍偷拍| 91搞黄在线观看| 99精品视频在线播放观看| 国产成人自拍高清视频在线免费播放 | 亚洲精品在线一区二区| 日韩三级伦理片妻子的秘密按摩| 欧美精品色综合| 欧美日韩一区二区三区四区五区 | 91麻豆精品国产91久久久久久久久| 色婷婷久久99综合精品jk白丝 | 欧美日韩亚洲综合在线| 在线观看不卡一区| 欧美性猛片aaaaaaa做受| 在线视频欧美精品| av一区二区久久| 成人综合婷婷国产精品久久免费| 国产在线不卡一卡二卡三卡四卡| 午夜伦理一区二区| 午夜电影一区二区| 日本中文字幕一区二区有限公司| 欧美系列亚洲系列| 在线观看日韩av先锋影音电影院| 色8久久精品久久久久久蜜| 在线视频你懂得一区| 欧美午夜在线观看| 日韩视频免费观看高清完整版在线观看| 欧美精品在线观看播放| 日韩视频免费观看高清完整版| 精品国精品国产| 国产欧美日韩中文久久| 亚洲丝袜制服诱惑| 亚洲综合无码一区二区| 偷拍亚洲欧洲综合| 久久精品国产精品青草| 国产成人免费在线视频| 91在线观看免费视频| 欧美色老头old∨ideo| 欧美一区二区三区不卡| 久久综合999| 亚洲欧洲综合另类在线| 天堂久久一区二区三区| 国产一区二区不卡老阿姨| 成+人+亚洲+综合天堂| 在线一区二区三区四区五区| 欧美一区二区三区小说| 国产日韩欧美不卡在线| 夜夜嗨av一区二区三区网页| 伦理电影国产精品| 成人av免费在线观看| 欧美日韩亚洲国产综合| 久久美女艺术照精彩视频福利播放 | 久久电影网站中文字幕| 成人理论电影网| 7777精品伊人久久久大香线蕉的 | 欧美高清激情brazzers| 久久久久高清精品| 一区二区欧美国产| 韩国女主播一区二区三区| av动漫一区二区| 日韩欧美色综合网站| 亚洲日本在线天堂| 久草中文综合在线| 在线一区二区三区| 亚洲精品在线一区二区| 亚洲精品免费视频| 国产乱码一区二区三区| 欧美日韩亚洲另类| 国产精品国产精品国产专区不蜜| 午夜视频一区二区| 成人动漫一区二区| 欧美成人一区二区三区片免费| 亚洲女同一区二区| 国产传媒久久文化传媒| 欧美浪妇xxxx高跟鞋交| 日韩伦理av电影| 国产精品亚洲午夜一区二区三区| 欧美三级三级三级| 日韩理论片网站| 懂色av一区二区三区蜜臀| 欧美成人精品福利| 亚州成人在线电影| 91蜜桃在线观看| 国产精品免费视频一区| 久88久久88久久久| 91精品婷婷国产综合久久| 一区二区三区加勒比av| 夫妻av一区二区| 久久网站热最新地址| 免费在线观看不卡| 欧美日韩国产天堂| 伊人婷婷欧美激情| 97se狠狠狠综合亚洲狠狠| 国产日韩欧美精品一区| 国产一区高清在线| 欧美成人激情免费网| 免费观看在线色综合| 欧美日韩第一区日日骚| 亚洲一区二区视频在线观看| 91麻豆免费在线观看| 中文字幕中文字幕在线一区| 国产福利精品导航| 精品成a人在线观看| 美脚の诱脚舐め脚责91 | 亚洲精品福利视频网站| 99久久伊人精品| 中文字幕一区免费在线观看| 大美女一区二区三区| 国产亚洲精品久| 国产福利一区在线| 欧美国产精品中文字幕| 国产91丝袜在线播放0| 国产精品素人视频| 成人性色生活片| 国产精品私房写真福利视频| 成人a区在线观看| 亚洲欧洲日韩一区二区三区| 99久久亚洲一区二区三区青草| 亚洲三级理论片| 在线免费观看视频一区| 一区二区免费在线播放| 欧美巨大另类极品videosbest | 91老司机福利 在线| 亚洲免费观看视频| 欧美日韩免费观看一区三区| 天天色综合天天| 欧美r级电影在线观看| 国产乱码精品一区二区三区忘忧草| 久久久不卡影院| 91片黄在线观看| 午夜欧美在线一二页| 欧美不卡激情三级在线观看| 国产精品伊人色| 亚洲欧美一区二区三区久本道91| 在线精品国精品国产尤物884a| 午夜精品久久久久久久久| 日韩欧美国产系列| 国产成人高清在线| 一区二区三区四区五区视频在线观看| 欧美视频在线一区| 蜜桃av一区二区在线观看| 久久久久久日产精品| 色综合久久久久综合99| 爽好久久久欧美精品| 国产亚洲精品精华液| 色噜噜夜夜夜综合网| 免费观看一级特黄欧美大片| 国产片一区二区| 欧美怡红院视频| 国产一区二区中文字幕| 亚洲欧洲精品一区二区精品久久久 | 1区2区3区欧美| 欧美高清你懂得| 成av人片一区二区| 日本中文字幕不卡| 国产精品国产三级国产普通话99| 在线播放中文字幕一区| 成人性视频网站| 丝袜诱惑制服诱惑色一区在线观看 | 亚洲一区二区三区四区在线免费观看 | 成人深夜福利app| 午夜成人免费电影| 国产精品久99| 日韩你懂的在线观看| 色噜噜夜夜夜综合网| 韩国三级电影一区二区| 亚洲国产欧美日韩另类综合| 国产午夜精品一区二区三区四区| 91成人免费在线视频| 国产精品亚洲第一| 五月天激情综合| 亚洲天堂免费看| 久久精品人人做| 日韩午夜小视频| 欧美三级韩国三级日本一级| 99热99精品| 国产精品99久久久久|