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

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

?? hashmap.java

?? linux下編程用 編譯軟件
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
  {    for (int i = buckets.length - 1; i >= 0; i--)      {        HashEntry e = buckets[i];        while (e != null)          {            if (equals(value, e.value))              return true;            e = e.next;          }      }    return false;  }  /**   * Returns a shallow clone of this HashMap. The Map itself is cloned,   * but its contents are not.  This is O(n).   *   * @return the clone   */  public Object clone()  {    HashMap copy = null;    try      {        copy = (HashMap) super.clone();      }    catch (CloneNotSupportedException x)      {        // This is impossible.      }    copy.buckets = new HashEntry[buckets.length];    copy.putAllInternal(this);    // Clear the entry cache. AbstractMap.clone() does the others.    copy.entries = null;    return copy;  }  /**   * Returns a "set view" of this HashMap's keys. The set is backed by the   * HashMap, so changes in one show up in the other.  The set supports   * element removal, but not element addition.   *   * @return a set view of the keys   * @see #values()   * @see #entrySet()   */  public Set keySet()  {    if (keys == null)      // Create an AbstractSet with custom implementations of those methods      // that can be overridden easily and efficiently.      keys = new AbstractSet()      {        public int size()        {          return size;        }        public Iterator iterator()        {          // Cannot create the iterator directly, because of LinkedHashMap.          return HashMap.this.iterator(KEYS);        }        public void clear()        {          HashMap.this.clear();        }        public boolean contains(Object o)        {          return containsKey(o);        }        public boolean remove(Object o)        {          // Test against the size of the HashMap to determine if anything          // really got removed. This is necessary because the return value          // of HashMap.remove() is ambiguous in the null case.          int oldsize = size;          HashMap.this.remove(o);          return oldsize != size;        }      };    return keys;  }  /**   * Returns a "collection view" (or "bag view") of this HashMap's values.   * The collection is backed by the HashMap, so changes in one show up   * in the other.  The collection supports element removal, but not element   * addition.   *   * @return a bag view of the values   * @see #keySet()   * @see #entrySet()   */  public Collection values()  {    if (values == null)      // We don't bother overriding many of the optional methods, as doing so      // wouldn't provide any significant performance advantage.      values = new AbstractCollection()      {        public int size()        {          return size;        }        public Iterator iterator()        {          // Cannot create the iterator directly, because of LinkedHashMap.          return HashMap.this.iterator(VALUES);        }        public void clear()        {          HashMap.this.clear();        }      };    return values;  }  /**   * Returns a "set view" of this HashMap's entries. The set is backed by   * the HashMap, so changes in one show up in the other.  The set supports   * element removal, but not element addition.<p>   *   * Note that the iterators for all three views, from keySet(), entrySet(),   * and values(), traverse the HashMap in the same sequence.   *   * @return a set view of the entries   * @see #keySet()   * @see #values()   * @see Map.Entry   */  public Set entrySet()  {    if (entries == null)      // Create an AbstractSet with custom implementations of those methods      // that can be overridden easily and efficiently.      entries = new AbstractSet()      {        public int size()        {          return size;        }        public Iterator iterator()        {          // Cannot create the iterator directly, because of LinkedHashMap.          return HashMap.this.iterator(ENTRIES);        }        public void clear()        {          HashMap.this.clear();        }        public boolean contains(Object o)        {          return getEntry(o) != null;        }        public boolean remove(Object o)        {          HashEntry e = getEntry(o);          if (e != null)            {              HashMap.this.remove(e.key);              return true;            }          return false;        }      };    return entries;  }  /**   * Helper method for put, that creates and adds a new Entry.  This is   * overridden in LinkedHashMap for bookkeeping purposes.   *   * @param key the key of the new Entry   * @param value the value   * @param idx the index in buckets where the new Entry belongs   * @param callRemove whether to call the removeEldestEntry method   * @see #put(Object, Object)   */  void addEntry(Object key, Object value, int idx, boolean callRemove)  {    HashEntry e = new HashEntry(key, value);    e.next = buckets[idx];    buckets[idx] = e;  }  /**   * Helper method for entrySet(), which matches both key and value   * simultaneously.   *   * @param o the entry to match   * @return the matching entry, if found, or null   * @see #entrySet()   */  // Package visible, for use in nested classes.  final HashEntry getEntry(Object o)  {    if (! (o instanceof Map.Entry))      return null;    Map.Entry me = (Map.Entry) o;    Object key = me.getKey();    int idx = hash(key);    HashEntry e = buckets[idx];    while (e != null)      {        if (equals(e.key, key))          return equals(e.value, me.getValue()) ? e : null;        e = e.next;      }    return null;  }  /**   * Helper method that returns an index in the buckets array for `key'   * based on its hashCode().  Package visible for use by subclasses.   *   * @param key the key   * @return the bucket number   */  final int hash(Object key)  {    return key == null ? 0 : Math.abs(key.hashCode() % buckets.length);  }  /**   * Generates a parameterized iterator.  Must be overrideable, since   * LinkedHashMap iterates in a different order.   *   * @param type {@link #KEYS}, {@link #VALUES}, or {@link #ENTRIES}   * @return the appropriate iterator   */  Iterator iterator(int type)  {    return new HashIterator(type);  }  /**   * A simplified, more efficient internal implementation of putAll(). clone()    * should not call putAll or put, in order to be compatible with the JDK    * implementation with respect to subclasses.   *   * @param m the map to initialize this from   */  void putAllInternal(Map m)  {    Iterator itr = m.entrySet().iterator();    size = 0;    while (itr.hasNext())      {        size++;	Map.Entry e = (Map.Entry) itr.next();	Object key = e.getKey();	int idx = hash(key);	addEntry(key, e.getValue(), idx, false);      }  }  /**   * Increases the size of the HashMap and rehashes all keys to new   * array indices; this is called when the addition of a new value   * would cause size() &gt; threshold. Note that the existing Entry   * objects are reused in the new hash table.   *   * <p>This is not specified, but the new size is twice the current size   * plus one; this number is not always prime, unfortunately.   */  private void rehash()  {    HashEntry[] oldBuckets = buckets;    int newcapacity = (buckets.length * 2) + 1;    threshold = (int) (newcapacity * loadFactor);    buckets = new HashEntry[newcapacity];    for (int i = oldBuckets.length - 1; i >= 0; i--)      {        HashEntry e = oldBuckets[i];        while (e != null)          {            int idx = hash(e.key);            HashEntry dest = buckets[idx];            HashEntry next = e.next;            e.next = buckets[idx];            buckets[idx] = e;            e = next;          }      }  }  /**   * Serializes this object to the given stream.   *   * @param s the stream to write to   * @throws IOException if the underlying stream fails   * @serialData the <i>capacity</i>(int) that is the length of the   *             bucket array, the <i>size</i>(int) of the hash map   *             are emitted first.  They are followed by size entries,   *             each consisting of a key (Object) and a value (Object).   */  private void writeObject(ObjectOutputStream s) throws IOException  {    // Write the threshold and loadFactor fields.    s.defaultWriteObject();    s.writeInt(buckets.length);    s.writeInt(size);    // Avoid creating a wasted Set by creating the iterator directly.    Iterator it = iterator(ENTRIES);    while (it.hasNext())      {        HashEntry entry = (HashEntry) it.next();        s.writeObject(entry.key);        s.writeObject(entry.value);      }  }  /**   * Deserializes this object from the given stream.   *   * @param s the stream to read from   * @throws ClassNotFoundException if the underlying stream fails   * @throws IOException if the underlying stream fails   * @serialData the <i>capacity</i>(int) that is the length of the   *             bucket array, the <i>size</i>(int) of the hash map   *             are emitted first.  They are followed by size entries,   *             each consisting of a key (Object) and a value (Object).   */  private void readObject(ObjectInputStream s)    throws IOException, ClassNotFoundException  {    // Read the threshold and loadFactor fields.    s.defaultReadObject();    // Read and use capacity, followed by key/value pairs.    buckets = new HashEntry[s.readInt()];    int len = s.readInt();    size = len;    while (len-- > 0)      {        Object key = s.readObject();        addEntry(key, s.readObject(), hash(key), false);      }  }  /**   * Iterate over HashMap's entries.   * This implementation is parameterized to give a sequential view of   * keys, values, or entries.   *   * @author Jon Zeppieri   */  private final class HashIterator implements Iterator  {    /**     * The type of this Iterator: {@link #KEYS}, {@link #VALUES},     * or {@link #ENTRIES}.     */    private final int type;    /**     * The number of modifications to the backing HashMap that we know about.     */    private int knownMod = modCount;    /** The number of elements remaining to be returned by next(). */    private int count = size;    /** Current index in the physical hash table. */    private int idx = buckets.length;    /** The last Entry returned by a next() call. */    private HashEntry last;    /**     * The next entry that should be returned by next(). It is set to something     * if we're iterating through a bucket that contains multiple linked     * entries. It is null if next() needs to find a new bucket.     */    private HashEntry next;    /**     * Construct a new HashIterator with the supplied type.     * @param type {@link #KEYS}, {@link #VALUES}, or {@link #ENTRIES}     */    HashIterator(int type)    {      this.type = type;    }    /**     * Returns true if the Iterator has more elements.     * @return true if there are more elements     * @throws ConcurrentModificationException if the HashMap was modified     */    public boolean hasNext()    {      if (knownMod != modCount)        throw new ConcurrentModificationException();      return count > 0;    }    /**     * Returns the next element in the Iterator's sequential view.     * @return the next element     * @throws ConcurrentModificationException if the HashMap was modified     * @throws NoSuchElementException if there is none     */    public Object next()    {      if (knownMod != modCount)        throw new ConcurrentModificationException();      if (count == 0)        throw new NoSuchElementException();      count--;      HashEntry e = next;      while (e == null)        e = buckets[--idx];      next = e.next;      last = e;      if (type == VALUES)        return e.value;      if (type == KEYS)        return e.key;      return e;    }    /**     * Removes from the backing HashMap the last element which was fetched     * with the <code>next()</code> method.     * @throws ConcurrentModificationException if the HashMap was modified     * @throws IllegalStateException if called when there is no last element     */    public void remove()    {      if (knownMod != modCount)        throw new ConcurrentModificationException();      if (last == null)        throw new IllegalStateException();      HashMap.this.remove(last.key);      last = null;      knownMod++;    }  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产69精品久久99不卡| 日韩免费在线观看| 91精选在线观看| 日本一区免费视频| 亚洲18女电影在线观看| 国产成人av电影在线观看| 欧美午夜一区二区三区| 国产精品对白交换视频| 久久疯狂做爰流白浆xx| 91麻豆精品91久久久久同性| 亚洲欧美激情小说另类| 国产福利精品导航| 欧美大白屁股肥臀xxxxxx| 亚洲高清视频的网址| 91免费视频大全| 欧美激情中文不卡| 国产精品影视网| 日韩欧美一区二区在线视频| 一区二区欧美精品| 欧美电影免费观看完整版| 一区二区在线免费观看| 99精品视频在线免费观看| 国产精品色婷婷| 国产精品1区2区3区在线观看| 91精品欧美一区二区三区综合在 | 中文字幕一区二| 国产成+人+日韩+欧美+亚洲| 欧美电影免费观看高清完整版在线观看| 亚洲一区二区影院| 在线精品视频免费观看| 一区二区三区不卡在线观看| 日本道色综合久久| 亚洲女与黑人做爰| 色噜噜夜夜夜综合网| 亚洲精品中文字幕乱码三区| 99久久综合99久久综合网站| 国产精品网友自拍| av电影天堂一区二区在线| 国产精品色哟哟| 成人a区在线观看| 亚洲嫩草精品久久| 欧美亚洲一区三区| 亚洲电影中文字幕在线观看| 日本韩国欧美国产| 五月激情综合色| 欧美一级一区二区| 极品少妇一区二区| 国产精品久久久久影院老司 | 欧美激情一二三区| 91蜜桃网址入口| 亚洲国产美国国产综合一区二区| 欧美日本乱大交xxxxx| 蜜桃av噜噜一区| 中文在线免费一区三区高中清不卡| www.激情成人| 日日摸夜夜添夜夜添国产精品| 日韩欧美一区二区视频| 岛国精品一区二区| 亚洲国产日韩综合久久精品| 91精品欧美综合在线观看最新| 九九九精品视频| 成人免费在线播放视频| 欧美日韩国产综合视频在线观看| 久久国产精品无码网站| 亚洲欧洲国产日本综合| 777a∨成人精品桃花网| 国产福利电影一区二区三区| 一区二区不卡在线播放 | 极品少妇xxxx偷拍精品少妇| 中文字幕不卡在线| 欧美精品免费视频| 国产v综合v亚洲欧| 亚洲h在线观看| 国产精品五月天| 在线不卡a资源高清| 国产成人综合视频| 亚洲成人精品一区二区| 国产精品三级视频| 91精品国产综合久久蜜臀| 国产69精品久久久久毛片| 三级欧美韩日大片在线看| 中文在线一区二区| 精品乱人伦小说| 精品视频在线看| 成人精品免费视频| 韩国午夜理伦三级不卡影院| 亚洲一区免费在线观看| 国产午夜精品理论片a级大结局 | 亚洲国产中文字幕在线视频综合| 国产亚洲一区二区三区四区| 欧美久久久久久蜜桃| 99re亚洲国产精品| 国产91在线看| 国产在线精品一区二区三区不卡| 亚洲bdsm女犯bdsm网站| 亚洲女同ⅹxx女同tv| 国产欧美一区视频| 精品国产在天天线2019| 欧美日韩日日摸| 欧美亚洲综合网| 91黄色免费网站| 色视频一区二区| 成人av片在线观看| 丁香一区二区三区| 国产成a人无v码亚洲福利| 精品一区二区三区免费播放| 日韩高清一区在线| 日韩中文欧美在线| 蜜芽一区二区三区| 日韩精品1区2区3区| 五月天婷婷综合| 午夜伦欧美伦电影理论片| 亚洲老妇xxxxxx| 亚洲在线视频免费观看| 亚洲一区免费视频| 亚洲午夜精品17c| 午夜av一区二区| 日本亚洲视频在线| 日韩成人一区二区三区在线观看| 亚洲成人免费在线观看| 午夜久久久久久久久久一区二区| 天堂va蜜桃一区二区三区 | 91精品国产综合久久福利软件| 欧美视频一区二区三区四区| 91福利在线观看| 欧美高清视频在线高清观看mv色露露十八| 在线观看免费一区| 正在播放一区二区| 精品国产一区二区亚洲人成毛片| 欧美不卡一二三| 久久久亚洲欧洲日产国码αv| 久久久久久9999| 国产精品国产a级| 亚洲精品少妇30p| 午夜激情一区二区三区| 久久99精品国产麻豆不卡| 国产成人精品亚洲日本在线桃色| 成人精品电影在线观看| 99re这里只有精品6| 制服丝袜日韩国产| 久久视频一区二区| 亚洲男人的天堂在线观看| 午夜精品视频一区| 激情伊人五月天久久综合| 成人少妇影院yyyy| 欧美视频中文字幕| 欧美成人激情免费网| 最新日韩av在线| 日本美女一区二区| 成人免费视频免费观看| 欧美亚洲国产一区二区三区| 日韩一级片在线观看| 欧美激情一区二区三区全黄| 亚洲国产成人精品视频| 国产福利一区二区三区| 欧美日韩精品三区| 欧美经典三级视频一区二区三区| 玉足女爽爽91| 久久99精品久久久久久久久久久久| av午夜一区麻豆| 日韩欧美成人激情| 综合分类小说区另类春色亚洲小说欧美| 午夜电影一区二区三区| caoporn国产一区二区| 91精品国模一区二区三区| 国产精品久久久一本精品 | 日韩欧美国产1| 椎名由奈av一区二区三区| 久久精品国产成人一区二区三区| 91视频www| 国产日韩欧美a| 免费在线成人网| 欧美在线色视频| 中文字幕日韩av资源站| 精品一区二区三区久久| 在线播放91灌醉迷j高跟美女| 国产精品青草综合久久久久99| 另类小说欧美激情| 欧美久久一二三四区| 一区二区三区四区乱视频| 国产成人精品免费在线| 精品捆绑美女sm三区| 午夜精品福利久久久| 在线观看av一区二区| 一区二区中文视频| 高清不卡一区二区| 亚洲精品一区二区三区99 | 一区二区三区中文字幕电影 | 国产精品视频在线看| 经典三级视频一区| 欧美va亚洲va香蕉在线| 日韩成人av影视| 7777女厕盗摄久久久| 亚洲第四色夜色| 91国在线观看| 一区二区成人在线观看| 色噜噜久久综合| 一区二区三区电影在线播| 91黄色激情网站| 午夜久久久久久久久久一区二区|