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

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

?? treemap.java

?? gcc-you can use this code to learn something about gcc, and inquire further into linux,
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
/* TreeMap.java -- a class providing a basic Red-Black Tree data structure,   mapping Object --> Object   Copyright (C) 1998, 1999, 2000, 2001, 2002 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., 59 Temple Place, Suite 330, Boston, MA02111-1307 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.Serializable;import java.io.ObjectOutputStream;import java.io.ObjectInputStream;import java.io.IOException;/** * This class provides a red-black tree implementation of the SortedMap * interface.  Elements in the Map will be sorted by either a user-provided * Comparator object, or by the natural ordering of the keys. * * The algorithms are adopted from Corman, Leiserson, and Rivest's * <i>Introduction to Algorithms.</i>  TreeMap guarantees O(log n) * insertion and deletion of elements.  That being said, there is a large * enough constant coefficient in front of that "log n" (overhead involved * in keeping the tree balanced), that TreeMap may not be the best choice * for small collections. If something is already sorted, you may want to * just use a LinkedHashMap to maintain the order while providing O(1) access. * * TreeMap is a part of the JDK1.2 Collections API.  Null keys are allowed * only if a Comparator is used which can deal with them; natural ordering * cannot cope with null.  Null values are always allowed. Note that the * ordering must be <i>consistent with equals</i> to correctly implement * the Map interface. If this condition is violated, the map is still * well-behaved, but you may have suprising results when comparing it to * other maps.<p> * * This implementation is not synchronized. If you need to share this between * multiple threads, do something like:<br> * <code>SortedMap m *       = Collections.synchronizedSortedMap(new TreeMap(...));</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 Bryce McKinlay * @author Eric Blake <ebb9@email.byu.edu> * @see Map * @see HashMap * @see Hashtable * @see LinkedHashMap * @see Comparable * @see Comparator * @see Collection * @see Collections#synchronizedSortedMap(SortedMap) * @since 1.2 * @status updated to 1.4 */public class TreeMap extends AbstractMap  implements SortedMap, Cloneable, Serializable{  // Implementation note:  // A red-black tree is a binary search tree with the additional properties  // that all paths to a leaf node visit the same number of black nodes,  // and no red node has red children. To avoid some null-pointer checks,  // we use the special node nil which is always black, has no relatives,  // and has key and value of null (but is not equal to a mapping of null).  /**   * Compatible with JDK 1.2.   */  private static final long serialVersionUID = 919286545866124006L;  /**   * Color status of a node. Package visible for use by nested classes.   */  static final int RED = -1,                   BLACK = 1;  /**   * Sentinal node, used to avoid null checks for corner cases and make the   * delete rebalance code simpler. The rebalance code must never assign   * the parent, left, or right of nil, but may safely reassign the color   * to be black. This object must never be used as a key in a TreeMap, or   * it will break bounds checking of a SubMap.   */  static final Node nil = new Node(null, null, BLACK);  static    {      // Nil is self-referential, so we must initialize it after creation.      nil.parent = nil;      nil.left = nil;      nil.right = nil;    }  /**   * The root node of this TreeMap.   */  private transient Node root = nil;  /**   * The size of this TreeMap. Package visible for use by nested classes.   */  transient int size;  /**   * The cache for {@link #entrySet()}.   */  private transient Set entries;  /**   * Counts the number of modifications this TreeMap has undergone, used   * by Iterators to know when to throw ConcurrentModificationExceptions.   * Package visible for use by nested classes.   */  transient int modCount;  /**   * This TreeMap's comparator, or null for natural ordering.   * Package visible for use by nested classes.   * @serial the comparator ordering this tree, or null   */  final Comparator comparator;  /**   * Class to represent an entry in the tree. Holds a single key-value pair,   * plus pointers to parent and child nodes.   *   * @author Eric Blake <ebb9@email.byu.edu>   */  private static final class Node extends AbstractMap.BasicMapEntry  {    // All fields package visible for use by nested classes.    /** The color of this node. */    int color;    /** The left child node. */    Node left = nil;    /** The right child node. */    Node right = nil;    /** The parent node. */    Node parent = nil;    /**     * Simple constructor.     * @param key the key     * @param value the value     */    Node(Object key, Object value, int color)    {      super(key, value);      this.color = color;    }  }  /**   * Instantiate a new TreeMap with no elements, using the keys' natural   * ordering to sort. All entries in the map must have a key which implements   * Comparable, and which are <i>mutually comparable</i>, otherwise map   * operations may throw a {@link ClassCastException}. Attempts to use   * a null key will throw a {@link NullPointerException}.   *   * @see Comparable   */  public TreeMap()  {    this((Comparator) null);  }  /**   * Instantiate a new TreeMap with no elements, using the provided comparator   * to sort. All entries in the map must have keys which are mutually   * comparable by the Comparator, otherwise map operations may throw a   * {@link ClassCastException}.   *   * @param comparator the sort order for the keys of this map, or null   *        for the natural order   */  public TreeMap(Comparator c)  {    comparator = c;  }  /**   * Instantiate a new TreeMap, initializing it with all of the elements in   * the provided Map.  The elements will be sorted using the natural   * ordering of the keys. This algorithm runs in n*log(n) time. All entries   * in the map must have keys which implement Comparable and are mutually   * comparable, otherwise map operations may throw a   * {@link ClassCastException}.   *   * @param map a Map, whose entries will be put into this TreeMap   * @throws ClassCastException if the keys in the provided Map are not   *         comparable   * @throws NullPointerException if map is null   * @see Comparable   */  public TreeMap(Map map)  {    this((Comparator) null);    putAll(map);  }  /**   * Instantiate a new TreeMap, initializing it with all of the elements in   * the provided SortedMap.  The elements will be sorted using the same   * comparator as in the provided SortedMap. This runs in linear time.   *   * @param sm a SortedMap, whose entries will be put into this TreeMap   * @throws NullPointerException if sm is null   */  public TreeMap(SortedMap sm)  {    this(sm.comparator());    int pos = sm.size();    Iterator itr = sm.entrySet().iterator();    fabricateTree(pos);    Node node = firstNode();    while (--pos >= 0)      {        Map.Entry me = (Map.Entry) itr.next();        node.key = me.getKey();        node.value = me.getValue();        node = successor(node);      }  }  /**   * Clears the Map so it has no keys. This is O(1).   */  public void clear()  {    if (size > 0)      {        modCount++;        root = nil;        size = 0;      }  }  /**   * Returns a shallow clone of this TreeMap. The Map itself is cloned,   * but its contents are not.   *   * @return the clone   */  public Object clone()  {    TreeMap copy = null;    try      {        copy = (TreeMap) super.clone();      }    catch (CloneNotSupportedException x)      {      }    copy.entries = null;    copy.fabricateTree(size);    Node node = firstNode();    Node cnode = copy.firstNode();    while (node != nil)      {        cnode.key = node.key;        cnode.value = node.value;        node = successor(node);        cnode = copy.successor(cnode);      }    return copy;  }  /**   * Return the comparator used to sort this map, or null if it is by   * natural order.   *   * @return the map's comparator   */  public Comparator comparator()  {    return comparator;  }  /**   * Returns true if the map contains a mapping for the given key.   *   * @param key the key to look for   * @return true if the key has a mapping   * @throws ClassCastException if key is not comparable to map elements   * @throws NullPointerException if key is null and the comparator is not   *         tolerant of nulls   */  public boolean containsKey(Object key)  {    return getNode(key) != nil;  }  /**   * Returns true if the map contains at least one mapping to the given value.   * This requires linear time.   *   * @param value the value to look for   * @return true if the value appears in a mapping   */  public boolean containsValue(Object value)  {    Node node = firstNode();    while (node != nil)      {        if (equals(value, node.value))          return true;        node = successor(node);      }    return false;  }  /**   * Returns a "set view" of this TreeMap's entries. The set is backed by   * the TreeMap, 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 TreeMap in sorted 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 overriden easily and efficiently.      entries = new AbstractSet()      {        public int size()        {          return size;        }        public Iterator iterator()        {          return new TreeIterator(ENTRIES);        }        public void clear()        {          TreeMap.this.clear();        }        public boolean contains(Object o)        {          if (! (o instanceof Map.Entry))            return false;          Map.Entry me = (Map.Entry) o;          Node n = getNode(me.getKey());          return n != nil && AbstractSet.equals(me.getValue(), n.value);      }        public boolean remove(Object o)        {          if (! (o instanceof Map.Entry))            return false;          Map.Entry me = (Map.Entry) o;          Node n = getNode(me.getKey());          if (n != nil && AbstractSet.equals(me.getValue(), n.value))            {              removeNode(n);              return true;            }          return false;        }      };    return entries;  }  /**   * Returns the first (lowest) key in the map.   *   * @return the first key   * @throws NoSuchElementException if the map is empty   */  public Object firstKey()  {    if (root == nil)      throw new NoSuchElementException();    return firstNode().key;  }  /**   * Return the value in this TreeMap 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   * @throws ClassCastException if key is not comparable to elements in the map   * @throws NullPointerException if key is null but the comparator does not   *         tolerate nulls   * @see #put(Object, Object)   * @see #containsKey(Object)   */  public Object get(Object key)  {    // Exploit fact that nil.value == null.    return getNode(key).value;  }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
3atv一区二区三区| 色久综合一二码| 久久婷婷成人综合色| 加勒比av一区二区| 久久久久久久久久久电影| 成人深夜视频在线观看| 中文字幕一区av| 精品视频色一区| 欧美bbbbb| 欧美激情一区不卡| 色综合久久88色综合天天| 亚洲成av人片一区二区三区| 欧美一级日韩免费不卡| 国产乱国产乱300精品| 中文字幕一区二区三区在线播放| 在线免费一区三区| 久久精品噜噜噜成人av农村| 欧美激情艳妇裸体舞| 色吧成人激情小说| 麻豆精品新av中文字幕| 国产精品国产三级国产普通话蜜臀| 在线免费观看日本一区| 精品亚洲成a人在线观看| 国产精品久久99| 91精品福利在线一区二区三区 | 久久久精品一品道一区| 91免费版在线看| 久久精品噜噜噜成人88aⅴ | 亚洲美女区一区| 日韩三区在线观看| 大白屁股一区二区视频| 奇米四色…亚洲| 亚洲男人都懂的| 久久精品男人的天堂| 欧美天堂亚洲电影院在线播放| 国产一区二区视频在线播放| 亚洲一区二区中文在线| 国产精品人人做人人爽人人添| 精品1区2区3区| 97精品国产97久久久久久久久久久久| 热久久免费视频| 一区二区免费在线播放| 久久众筹精品私拍模特| 欧美精品在欧美一区二区少妇| 成人黄色在线看| 国内精品久久久久影院色| 一区二区欧美视频| 专区另类欧美日韩| 中文字幕精品三区| 精品日本一线二线三线不卡| 一本色道久久综合亚洲91| 国产成人在线影院| 黑人精品欧美一区二区蜜桃 | 精品久久国产字幕高潮| 欧美日韩在线三级| 国产亚洲精品久| 欧美一区二区三区日韩| 欧美午夜片在线看| 91小视频免费看| 99精品视频一区| 成熟亚洲日本毛茸茸凸凹| 国内精品久久久久影院色| 日产精品久久久久久久性色| 夜夜嗨av一区二区三区网页| 国产精品另类一区| 国产肉丝袜一区二区| 久久久久久久国产精品影院| 精品裸体舞一区二区三区| 欧美一区二区高清| 欧美一区二区三区在线视频| 在线综合亚洲欧美在线视频| 欧美日韩中文字幕精品| 欧美精品乱人伦久久久久久| 在线观看一区二区精品视频| 色婷婷国产精品综合在线观看| 成人免费视频caoporn| 岛国一区二区在线观看| 国产1区2区3区精品美女| 成人一区在线看| 99精品桃花视频在线观看| 99精品在线免费| 91国产福利在线| 欧美精品v国产精品v日韩精品| 欧美一区二区在线免费观看| 日韩精品在线一区二区| 精品国产伦理网| 国产性天天综合网| 国产精品久久久久久亚洲毛片 | 综合精品久久久| 亚洲综合丝袜美腿| 亚洲成av人片一区二区三区| 视频一区二区中文字幕| 久久电影国产免费久久电影| 国产一区二区三区四区五区美女| 国产乱一区二区| 一本大道久久a久久综合| 欧美狂野另类xxxxoooo| 精品国产一区二区三区不卡| 国产精品色噜噜| 亚洲在线中文字幕| 日本麻豆一区二区三区视频| 国产制服丝袜一区| 97久久超碰国产精品| 欧美人与禽zozo性伦| 精品99一区二区| 亚洲视频一区在线| 日韩av一区二| voyeur盗摄精品| 欧美猛男男办公室激情| 久久久久久久av麻豆果冻| 亚洲理论在线观看| 精品亚洲免费视频| 色婷婷av一区二区三区软件| 欧美成人女星排行榜| 亚洲欧洲成人自拍| 日韩精品福利网| kk眼镜猥琐国模调教系列一区二区| 91黄色免费观看| 久久久九九九九| 亚洲成人动漫av| 成人精品视频一区| 有坂深雪av一区二区精品| 天堂va蜜桃一区二区三区漫画版| 国产伦精品一区二区三区视频青涩| 色噜噜狠狠色综合中国| 精品国产乱码久久久久久夜甘婷婷| 中文字幕欧美日韩一区| 青青草精品视频| 色av成人天堂桃色av| 欧美国产精品专区| 日韩国产欧美在线观看| 色悠悠久久综合| 国产人成一区二区三区影院| 天天影视色香欲综合网老头| 99在线精品观看| 国产日韩一级二级三级| 日韩电影在线观看一区| 91国产成人在线| 国产精品久久久久婷婷二区次| 麻豆精品一区二区| 欧美美女直播网站| 亚洲靠逼com| av一区二区三区四区| 国产网站一区二区| 狠狠色狠狠色综合| 欧美va亚洲va国产综合| 日韩专区在线视频| 欧美午夜精品理论片a级按摩| 国产精品久久久久影院色老大| 国模冰冰炮一区二区| 日韩一级欧美一级| 天堂久久一区二区三区| 在线亚洲一区二区| 又紧又大又爽精品一区二区| 91无套直看片红桃| 亚洲天堂免费看| 一本色道a无线码一区v| 亚洲欧洲日韩av| 91在线免费看| 亚洲品质自拍视频| 99热精品国产| 亚洲精品国产品国语在线app| 99久久99久久精品免费看蜜桃| 中日韩免费视频中文字幕| 国产成人免费视频| 中文字幕欧美日本乱码一线二线 | 亚洲嫩草精品久久| 91免费看`日韩一区二区| 亚洲视频 欧洲视频| 91丨九色丨蝌蚪富婆spa| 亚洲色图第一区| 欧美亚洲愉拍一区二区| 亚洲成人综合视频| 91精品国产品国语在线不卡| 免费成人在线观看视频| 欧美精品一区二区三区四区| 国内精品久久久久影院薰衣草| 久久久久久黄色| 99re亚洲国产精品| 一区二区三区在线观看欧美| 欧美日韩亚洲国产综合| 久久精品国产一区二区三区免费看| 精品黑人一区二区三区久久| 国产激情视频一区二区在线观看 | 狠狠v欧美v日韩v亚洲ⅴ| 久久一夜天堂av一区二区三区| 国产成人aaa| 亚洲精品菠萝久久久久久久| 欧美精品自拍偷拍动漫精品| 麻豆国产一区二区| 国产欧美精品国产国产专区| 色哟哟一区二区在线观看| 三级久久三级久久| 国产午夜亚洲精品不卡| 精品福利一区二区三区 | 久久精品国产一区二区三| 国产欧美日韩视频在线观看| 91精品福利在线| 国产一区二区不卡老阿姨| 国产精品视频麻豆|