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

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

?? treemap.java

?? 俄羅斯高人Mamaich的Pocket gcc編譯器(運行在PocketPC上)的全部源代碼。
?? 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一区二区三区免费野_久草精品视频
亚洲一卡二卡三卡四卡五卡| 成人激情校园春色| 国产精品一区二区久久不卡| 成人av网站在线观看免费| 777午夜精品免费视频| 国产精品久久三| 奇米色一区二区| 色老汉一区二区三区| 国产网站一区二区三区| 日本不卡在线视频| 欧美亚一区二区| 最新中文字幕一区二区三区| 激情综合色综合久久| 欧美精品v日韩精品v韩国精品v| 综合电影一区二区三区 | 国产精品国产三级国产专播品爱网| 亚洲成a人v欧美综合天堂| 99精品1区2区| 国产精品美女一区二区三区| 紧缚捆绑精品一区二区| 欧美一级片免费看| 亚洲成a人v欧美综合天堂| 色综合久久六月婷婷中文字幕| 国产午夜精品理论片a级大结局| 精品一区二区三区久久久| 欧美美女黄视频| 午夜精品久久久久久久| 在线观看视频一区二区| 亚洲天堂a在线| 色综合久久久久综合体| 亚洲日本免费电影| 91亚洲精华国产精华精华液| 中文字幕一区在线| 91在线国产观看| 亚洲乱码国产乱码精品精可以看| 99热精品一区二区| 亚洲免费观看高清完整版在线观看| 99久久精品免费看国产| 亚洲人成在线观看一区二区| 91色porny蝌蚪| 亚洲精品视频观看| 欧美偷拍一区二区| 日日夜夜免费精品| 欧美成人三级在线| 国产精品2024| 国产精品麻豆99久久久久久| 91视频.com| 亚洲第一综合色| 日韩午夜在线观看| 国产在线一区二区综合免费视频| 久久久久久日产精品| 成人永久免费视频| 亚洲女同一区二区| 欧美日韩国产另类一区| 久久成人久久爱| 国产精品系列在线| 欧美色网一区二区| 久久99精品国产麻豆婷婷| 国产午夜精品一区二区三区四区| av一区二区不卡| 亚洲一卡二卡三卡四卡| 日韩精品一区二区三区蜜臀| 高清不卡一二三区| 亚洲国产sm捆绑调教视频 | 26uuu欧美| 成人精品免费网站| 亚洲最大的成人av| 日韩欧美国产系列| 色综合久久九月婷婷色综合| 三级亚洲高清视频| 国产精品人妖ts系列视频| 精品视频1区2区| 国产精品一级二级三级| 亚洲成人av电影| 国产女主播一区| 欧美精品久久久久久久久老牛影院| 韩日欧美一区二区三区| 亚洲一区欧美一区| 欧美激情一区二区三区四区| 欧美丰满一区二区免费视频| 成人精品鲁一区一区二区| 亚洲成人你懂的| 国产精品色眯眯| 日韩精品一区二区三区视频| 色一情一伦一子一伦一区| 国产在线播放一区| 首页欧美精品中文字幕| 亚洲色图制服诱惑| 国产三级一区二区| 欧美一级精品大片| 欧美视频一区二区| www.66久久| 国产jizzjizz一区二区| 日日夜夜免费精品| 亚洲国产欧美在线| 亚洲色图都市小说| 国产日韩欧美亚洲| www一区二区| 日韩三级中文字幕| 欧美疯狂性受xxxxx喷水图片| 欧美一区二区三区成人| 99久久国产综合色|国产精品| 国产一区激情在线| 精一区二区三区| 人妖欧美一区二区| 石原莉奈一区二区三区在线观看| 伊人开心综合网| 亚洲天堂久久久久久久| 国产精品嫩草影院av蜜臀| 久久久精品免费免费| 精品乱码亚洲一区二区不卡| 欧美一级理论性理论a| 欧美另类变人与禽xxxxx| 欧美午夜一区二区| 欧美影视一区二区三区| 在线免费观看日本一区| 色婷婷综合久久久久中文一区二区 | 国产日韩精品久久久| 精品久久人人做人人爽| 精品国产乱码久久久久久图片 | 国产精品女同互慰在线看| 久久久久久久久久久黄色| 欧美精品一区视频| 26uuu亚洲综合色| 久久蜜桃一区二区| 国产婷婷色一区二区三区| 中文字幕精品一区二区精品绿巨人| 国产三级欧美三级日产三级99| 国产片一区二区三区| 国产校园另类小说区| 国产精品久久99| 亚洲与欧洲av电影| 日本成人在线网站| 狠狠久久亚洲欧美| 成人午夜视频在线观看| 成人ar影院免费观看视频| 日本精品一区二区三区四区的功能| 欧美在线一二三| 日韩色在线观看| 国产日产欧美一区二区视频| 国产精品久99| 亚洲成人av福利| 国产真实乱子伦精品视频| 92精品国产成人观看免费| 欧美日本在线观看| xvideos.蜜桃一区二区| 另类中文字幕网| caoporn国产精品| 欧美男人的天堂一二区| 2023国产精品| 一区2区3区在线看| 久久丁香综合五月国产三级网站| 粉嫩绯色av一区二区在线观看| 在线观看av一区二区| 欧美r级电影在线观看| 亚洲日本在线观看| 蜜桃视频在线一区| 91美女蜜桃在线| 欧美tk丨vk视频| 亚洲一区二区三区精品在线| 国产真实乱偷精品视频免| 欧美午夜精品久久久久久超碰| 精品国产青草久久久久福利| 亚洲精品美国一| 国产成人三级在线观看| 欧美亚日韩国产aⅴ精品中极品| 久久综合狠狠综合久久综合88| 亚洲精品免费在线观看| 国产乱码字幕精品高清av| 精品视频在线免费| 亚洲三级在线免费观看| 国产一区二区三区国产| 欧美日韩免费一区二区三区视频| 久久亚洲精品国产精品紫薇| 午夜久久久久久久久| 91美女在线视频| 欧美国产视频在线| 麻豆免费看一区二区三区| 91久久精品日日躁夜夜躁欧美| 国产午夜亚洲精品羞羞网站| 男女男精品视频| 欧美日韩国产一区二区三区地区| 中文字幕不卡一区| 韩日精品视频一区| 欧美一级午夜免费电影| 午夜久久久久久久久久一区二区| 91免费在线看| 国产精品国产精品国产专区不片| 国产一区二区三区免费| 欧美成人一区二区三区在线观看 | 在线观看国产精品网站| 中文字幕一区二区三区精华液| 国产主播一区二区三区| 欧美xingq一区二区| 免费久久精品视频| 日韩欧美国产成人一区二区| 日日嗨av一区二区三区四区| 欧美日韩国产精品成人| 亚洲一区二区三区四区在线 | 精品视频一区三区九区|