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

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

?? treemap.java

?? This is a resource based on j2me embedded,if you dont understand,you can connection with me .
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
/* * @(#)TreeMap.java	1.50 06/10/10 * * Copyright  1990-2008 Sun Microsystems, Inc. All Rights Reserved.   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER   *    * This program is free software; you can redistribute it and/or   * modify it under the terms of the GNU General Public License version   * 2 only, as published by the Free Software Foundation.    *    * This program 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 version 2 for more details (a copy is   * included at /legal/license.txt).    *    * You should have received a copy of the GNU General Public License   * version 2 along with this work; if not, write to the Free Software   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA   * 02110-1301 USA    *    * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa   * Clara, CA 95054 or visit www.sun.com if you need additional   * information or have any questions.  * */package java.util;/** * Red-Black tree based implementation of the <tt>SortedMap</tt> interface. * This class guarantees that the map will be in ascending key order, sorted * according to the <i>natural order</i> for the key's class (see * <tt>Comparable</tt>), or by the comparator provided at creation time, * depending on which constructor is used.<p> * * This implementation provides guaranteed log(n) time cost for the * <tt>containsKey</tt>, <tt>get</tt>, <tt>put</tt> and <tt>remove</tt> * operations.  Algorithms are adaptations of those in Cormen, Leiserson, and * Rivest's <I>Introduction to Algorithms</I>.<p> * * Note that the ordering maintained by a sorted map (whether or not an * explicit comparator is provided) must be <i>consistent with equals</i> if * this sorted map is to correctly implement the <tt>Map</tt> interface.  (See * <tt>Comparable</tt> or <tt>Comparator</tt> for a precise definition of * <i>consistent with equals</i>.)  This is so because the <tt>Map</tt> * interface is defined in terms of the equals operation, but a map performs * all key comparisons using its <tt>compareTo</tt> (or <tt>compare</tt>) * method, so two keys that are deemed equal by this method are, from the * standpoint of the sorted map, equal.  The behavior of a sorted map * <i>is</i> well-defined even if its ordering is inconsistent with equals; it * just fails to obey the general contract of the <tt>Map</tt> interface.<p> * * <b>Note that this implementation is not synchronized.</b> If multiple * threads access a map concurrently, and at least one of the threads modifies * the map structurally, it <i>must</i> be synchronized externally.  (A * structural modification is any operation that adds or deletes one or more * mappings; merely changing the value associated with an existing key is not * a structural modification.)  This is typically accomplished by * synchronizing on some object that naturally encapsulates the map.  If no * such object exists, the map should be "wrapped" using the * <tt>Collections.synchronizedMap</tt> method.  This is best done at creation * time, to prevent accidental unsynchronized access to the map:  * <pre> *     Map m = Collections.synchronizedMap(new TreeMap(...)); * </pre><p> * * The iterators returned by all of this class's "collection view methods" are * <i>fail-fast</i>: if the map is structurally modified at any time after the * iterator is created, in any way except through the iterator's own * <tt>remove</tt> or <tt>add</tt> methods, the iterator throws a * <tt>ConcurrentModificationException</tt>.  Thus, in the face of concurrent * modification, the iterator fails quickly and cleanly, rather than risking * arbitrary, non-deterministic behavior at an undetermined time in the * future. * * <p>Note that the fail-fast behavior of an iterator cannot be guaranteed * as it is, generally speaking, impossible to make any hard guarantees in the * presence of unsynchronized concurrent modification.  Fail-fast iterators * throw <tt>ConcurrentModificationException</tt> on a best-effort basis.  * Therefore, it would be wrong to write a program that depended on this * exception for its correctness:   <i>the fail-fast behavior of iterators * should be used only to detect bugs.</i><p> * * This class is a member of the  * <a href="{@docRoot}/../guide/collections/index.html"> * Java Collections Framework</a>. * * @author  Josh Bloch and Doug Lea * @version 1.43, 02/02/00 * @see Map * @see HashMap * @see Hashtable * @see Comparable * @see Comparator * @see Collection * @see Collections#synchronizedMap(Map) * @since 1.2 */public class TreeMap extends AbstractMap                     implements SortedMap, Cloneable, java.io.Serializable{    /**     * The Comparator used to maintain order in this TreeMap, or     * null if this TreeMap uses its elements natural ordering.     *     * @serial     */    private Comparator comparator = null;    private transient Entry root = null;    /**     * The number of entries in the tree     */    private transient int size = 0;    /**     * The number of structural modifications to the tree.     */    private transient int modCount = 0;    private void incrementSize()   { modCount++; size++; }    private void decrementSize()   { modCount++; size--; }    /**     * Constructs a new, empty map, sorted according to the keys' natural     * order.  All keys inserted into the map must implement the     * <tt>Comparable</tt> interface.  Furthermore, all such keys must be     * <i>mutually comparable</i>: <tt>k1.compareTo(k2)</tt> must not throw a     * ClassCastException for any elements <tt>k1</tt> and <tt>k2</tt> in the     * map.  If the user attempts to put a key into the map that violates this     * constraint (for example, the user attempts to put a string key into a     * map whose keys are integers), the <tt>put(Object key, Object     * value)</tt> call will throw a <tt>ClassCastException</tt>.     *     * @see Comparable     */    public TreeMap() {    }    /**     * Constructs a new, empty map, sorted according to the given comparator.     * All keys inserted into the map must be <i>mutually comparable</i> by     * the given comparator: <tt>comparator.compare(k1, k2)</tt> must not     * throw a <tt>ClassCastException</tt> for any keys <tt>k1</tt> and     * <tt>k2</tt> in the map.  If the user attempts to put a key into the     * map that violates this constraint, the <tt>put(Object key, Object     * value)</tt> call will throw a <tt>ClassCastException</tt>.     *     * @param c the comparator that will be used to sort this map.  A     *        <tt>null</tt> value indicates that the keys' <i>natural     *        ordering</i> should be used.     */    public TreeMap(Comparator c) {        this.comparator = c;    }    /**     * Constructs a new map containing the same mappings as the given map,     * sorted according to the keys' <i>natural order</i>.  All keys inserted     * into the new map must implement the <tt>Comparable</tt> interface.     * Furthermore, all such keys must be <i>mutually comparable</i>:     * <tt>k1.compareTo(k2)</tt> must not throw a <tt>ClassCastException</tt>     * for any elements <tt>k1</tt> and <tt>k2</tt> in the map.  This method     * runs in n*log(n) time.     *     * @param  m the map whose mappings are to be placed in this map.     * @throws ClassCastException the keys in t are not Comparable, or     *         are not mutually comparable.     * @throws NullPointerException if the specified map is null.     */    public TreeMap(Map m) {        putAll(m);    }    /**     * Constructs a new map containing the same mappings as the given     * <tt>SortedMap</tt>, sorted according to the same ordering.  This method     * runs in linear time.     *     * @param  m the sorted map whose mappings are to be placed in this map,     *         and whose comparator is to be used to sort this map.     * @throws NullPointerException if the specified sorted map is null.     */    public TreeMap(SortedMap m) {        comparator = m.comparator();        try {            buildFromSorted(m.size(), m.entrySet().iterator(), null, null);        } catch (java.io.IOException cannotHappen) {        } catch (ClassNotFoundException cannotHappen) {        }    }    // Query Operations    /**     * Returns the number of key-value mappings in this map.     *     * @return the number of key-value mappings in this map.     */    public int size() {        return size;    }    /**     * Returns <tt>true</tt> if this map contains a mapping for the specified     * key.     *     * @param key key whose presence in this map is to be tested.     *      * @return <tt>true</tt> if this map contains a mapping for the     *            specified key.     * @throws ClassCastException if the key cannot be compared with the keys     *                  currently in the map.     * @throws NullPointerException key is <tt>null</tt> and this map uses     *                  natural ordering, or its comparator does not tolerate     *            <tt>null</tt> keys.     */    public boolean containsKey(Object key) {        return getEntry(key) != null;    }    /**     * Returns <tt>true</tt> if this map maps one or more keys to the     * specified value.  More formally, returns <tt>true</tt> if and only if     * this map contains at least one mapping to a value <tt>v</tt> such     * that <tt>(value==null ? v==null : value.equals(v))</tt>.  This     * operation will probably require time linear in the Map size for most     * implementations of Map.     *     * @param value value whose presence in this Map is to be tested.     * @return  <tt>true</tt> if a mapping to <tt>value</tt> exists;     *		<tt>false</tt> otherwise.     * @since 1.2     */    public boolean containsValue(Object value) {        return (root==null ? false :                (value==null ? valueSearchNull(root)                             : valueSearchNonNull(root, value)));    }    private boolean valueSearchNull(Entry n) {        if (n.value == null)            return true;        // Check left and right subtrees for value        return (n.left  != null && valueSearchNull(n.left)) ||               (n.right != null && valueSearchNull(n.right));    }    private boolean valueSearchNonNull(Entry n, Object value) {        // Check this node for the value        if (value.equals(n.value))            return true;        // Check left and right subtrees for value        return (n.left  != null && valueSearchNonNull(n.left, value)) ||               (n.right != null && valueSearchNonNull(n.right, value));    }    /**     * Returns the value to which this map maps the specified key.  Returns     * <tt>null</tt> if the map contains no mapping for this key.  A return     * value of <tt>null</tt> does not <i>necessarily</i> indicate that the     * map contains no mapping for the key; it's also possible that the map     * explicitly maps the key to <tt>null</tt>.  The <tt>containsKey</tt>     * operation may be used to distinguish these two cases.     *     * @param key key whose associated value is to be returned.     * @return the value to which this map maps the specified key, or     *               <tt>null</tt> if the map contains no mapping for the key.     * @throws    ClassCastException key cannot be compared with the keys     *                  currently in the map.     * @throws NullPointerException key is <tt>null</tt> and this map uses     *                  natural ordering, or its comparator does not tolerate     *                  <tt>null</tt> keys.     *      * @see #containsKey(Object)     */    public Object get(Object key) {        Entry p = getEntry(key);        return (p==null ? null : p.value);    }    /**     * Returns the comparator used to order this map, or <tt>null</tt> if this     * map uses its keys' natural order.     *     * @return the comparator associated with this sorted map, or     *                <tt>null</tt> if it uses its keys' natural sort method.     */    public Comparator comparator() {        return comparator;    }    /**     * Returns the first (lowest) key currently in this sorted map.     *     * @return the first (lowest) key currently in this sorted map.     * @throws    NoSuchElementException Map is empty.     */    public Object firstKey() {        return key(firstEntry());    }    /**     * Returns the last (highest) key currently in this sorted map.     *     * @return the last (highest) key currently in this sorted map.     * @throws    NoSuchElementException Map is empty.     */    public Object lastKey() {        return key(lastEntry());    }    /**     * Copies all of the mappings from the specified map to this map.  These     * mappings replace any mappings that this map had for any of the keys     * currently in the specified map.     *     * @param     map mappings to be stored in this map.     * @throws    ClassCastException class of a key or value in the specified     *                   map prevents it from being stored in this map.     *      * @throws NullPointerException if the given map is <tt>null</tt> or     *         this map does not permit <tt>null</tt> keys and a      *         key in the specified map is <tt>null</tt>.     */    public void putAll(Map map) {        int mapSize = map.size();        if (size==0 && mapSize!=0 && map instanceof SortedMap) {            Comparator c = ((SortedMap)map).comparator();            if (c == comparator || (c != null && c.equals(comparator))) {              ++modCount;              try {                  buildFromSorted(mapSize, map.entrySet().iterator(),                                  null, null);              } catch (java.io.IOException cannotHappen) {              } catch (ClassNotFoundException cannotHappen) {              }              return;            }        }        super.putAll(map);    }    /**     * Returns this map's entry for the given key, or <tt>null</tt> if the map     * does not contain an entry for the key.     *     * @return this map's entry for the given key, or <tt>null</tt> if the map     *                does not contain an entry for the key.     * @throws ClassCastException if the key cannot be compared with the keys     *                  currently in the map.     * @throws NullPointerException key is <tt>null</tt> and this map uses     *                  natural order, or its comparator does not tolerate *     *                  <tt>null</tt> keys.     */    private Entry getEntry(Object key) {        Entry p = root;        while (p != null) {            int cmp = compare(key,p.key);            if (cmp == 0)                return p;            else if (cmp < 0)                p = p.left;            else                p = p.right;        }        return null;    }    /**     * Gets the entry corresponding to the specified key; if no such entry     * exists, returns the entry for the least key greater than the specified     * key; if no such entry exists (i.e., the greatest key in the Tree is less     * than the specified key), returns <tt>null</tt>.     */    private Entry getCeilEntry(Object key) {        Entry p = root;        if (p==null)            return null;        while (true) {            int cmp = compare(key, p.key);            if (cmp == 0) {                return p;            } else if (cmp < 0) {                if (p.left != null)                    p = p.left;                else                    return p;            } else {                if (p.right != null) {                    p = p.right;                } else {                    Entry parent = p.parent;                    Entry ch = p;                    while (parent != null && ch == parent.right) {                        ch = parent;                        parent = parent.parent;                    }                    return parent;                }            }        }    }    /**     * Returns the entry for the greatest key less than the specified key; if     * no such entry exists (i.e., the least key in the Tree is greater than     * the specified key), returns <tt>null</tt>.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
高潮精品一区videoshd| 欧美精品一区二区三区高清aⅴ| 91女神在线视频| 日韩美女主播在线视频一区二区三区| 国产精品视频yy9299一区| 日韩电影一区二区三区四区| 国产乱码字幕精品高清av | 麻豆精品一区二区| 国内精品伊人久久久久av影院 | 国产午夜精品在线观看| 亚洲精品免费在线播放| 国产福利精品导航| 欧美一卡二卡在线观看| 亚洲精品国产视频| 激情图片小说一区| 日韩欧美激情一区| 日韩精品视频网站| 欧美亚洲国产一区二区三区va | 国产精品色哟哟| 国内成人精品2018免费看| 69堂亚洲精品首页| 一卡二卡三卡日韩欧美| 91首页免费视频| 中文字幕制服丝袜一区二区三区 | 亚洲欧洲成人精品av97| 国产精品1区2区| 国产亚洲女人久久久久毛片| 蜜桃一区二区三区在线| 欧美精品丝袜久久久中文字幕| 亚洲黄色性网站| 日本韩国一区二区三区| 亚洲精品国产精品乱码不99| 91麻豆自制传媒国产之光| 亚洲欧洲色图综合| 99久免费精品视频在线观看| 国产精品福利一区二区三区| 粉嫩蜜臀av国产精品网站| 欧美高清在线视频| 成人精品在线视频观看| 专区另类欧美日韩| 欧美主播一区二区三区美女| 亚洲综合色视频| 欧美日本国产视频| 免费亚洲电影在线| 国产视频一区在线观看| 成人激情电影免费在线观看| 亚洲欧美一区二区三区孕妇| 在线欧美一区二区| 天天色天天爱天天射综合| 欧美大度的电影原声| 国产福利一区在线观看| 亚洲天堂av老司机| 欧美精品乱码久久久久久| 久久99深爱久久99精品| 国产欧美精品一区二区色综合朱莉| 成人在线视频一区| 一区二区三区精品视频| 欧美一区二区三区免费大片 | 成人精品小蝌蚪| 一区二区三区日韩在线观看| 欧美疯狂做受xxxx富婆| 国产精品资源在线观看| 国产精品第13页| 欧美精品乱人伦久久久久久| 国产在线精品视频| 亚洲精品视频免费看| 日韩欧美在线一区二区三区| 岛国精品在线播放| 视频一区二区三区入口| 国产欧美日韩三级| 欧美日韩一区小说| 国产精品一区二区91| 亚洲综合丁香婷婷六月香| www国产成人免费观看视频 深夜成人网 | 一区二区三区精品| 日韩一区二区三区三四区视频在线观看 | 欧美一级爆毛片| 99久久精品99国产精品| 麻豆国产欧美一区二区三区| 欧美国产精品v| 91麻豆精品国产自产在线观看一区 | 亚洲精品日产精品乱码不卡| 日韩精品一区二区三区视频在线观看| aa级大片欧美| 狠狠色丁香婷婷综合| 亚洲成人av一区| 国产精品伦一区| 久久尤物电影视频在线观看| 欧美三级电影精品| aaa国产一区| 国产伦精品一区二区三区视频青涩 | 国产盗摄女厕一区二区三区| 日韩黄色小视频| 亚洲精品老司机| 国产精品久久久久久亚洲毛片| 日韩欧美视频一区| 777奇米四色成人影色区| 色婷婷亚洲一区二区三区| 国产成人av福利| 狠狠色丁香久久婷婷综| 日本欧美一区二区在线观看| 一区二区三区精品| 色噜噜久久综合| 精品视频全国免费看| 无码av免费一区二区三区试看| 国产精品久久久久久亚洲毛片| 2019国产精品| 精品国产乱码久久久久久1区2区 | 亚洲欧美日韩国产综合在线| 久久综合久久鬼色中文字| 在线不卡一区二区| 国产午夜精品理论片a级大结局 | 日韩av一区二区在线影视| 亚洲一级二级三级| 一区二区三区色| 亚洲成人av在线电影| 亚洲成人午夜影院| 天堂av在线一区| 美脚の诱脚舐め脚责91 | 欧美日韩一区不卡| 欧美日韩久久久久久| 欧美日韩久久久| 日韩三级精品电影久久久 | 日本亚洲三级在线| 日本系列欧美系列| 老司机午夜精品| 国产成人精品一区二| 国产suv一区二区三区88区| 国产成人精品免费一区二区| 盗摄精品av一区二区三区| 99视频热这里只有精品免费| 91麻豆产精品久久久久久| 欧美色倩网站大全免费| 欧美一级理论片| 久久精品男人的天堂| 日韩伦理电影网| 视频一区在线播放| 国产在线不卡视频| 91麻豆国产香蕉久久精品| 欧美理论在线播放| 精品国产一区a| 中文字幕亚洲视频| 亚洲国产日韩a在线播放性色| 日本不卡免费在线视频| 国产精品一级片在线观看| 91麻豆国产精品久久| 欧美一区二区三区在线观看视频| 精品国产一二三| 一区二区在线观看av| 麻豆91精品91久久久的内涵| 成人深夜在线观看| 777久久久精品| 日本一区二区成人| 天堂在线一区二区| 国产高清久久久久| 欧美三级中文字幕在线观看| 精品国产乱码久久久久久1区2区| 中文字幕在线观看不卡| 免费的成人av| 91麻豆产精品久久久久久 | 欧美色图在线观看| 久久久综合视频| 亚洲成人黄色影院| 成人国产精品视频| 日韩欧美一区二区视频| 亚洲免费在线视频| 九九**精品视频免费播放| 欧美专区日韩专区| 自拍偷自拍亚洲精品播放| 精品午夜一区二区三区在线观看| 在线一区二区三区四区五区| 久久精品亚洲国产奇米99| 天堂在线一区二区| 色天使色偷偷av一区二区| 国产午夜三级一区二区三| 美国三级日本三级久久99| 欧美性生活影院| 国产精品国模大尺度视频| 国产一区美女在线| 在线播放亚洲一区| 亚洲一区二区成人在线观看| www.日韩av| 亚洲国产精华液网站w| 久久国产精品99精品国产| 欧美色综合久久| 欧美中文字幕一区二区三区| 国产不卡在线视频| 成人一区二区三区| 欧美三级中文字幕| 亚洲视频每日更新| 成人高清伦理免费影院在线观看| 日韩精品中文字幕在线一区| 三级不卡在线观看| 精品视频1区2区3区| 一级做a爱片久久| 91免费版在线| 一区二区三区在线视频免费 | 日韩三级电影网址| 美女视频一区二区| 日韩一级免费观看|