/jdk-7u76-docs-all/docs/api/java/util/TreeMap.html
HTML | 1713 lines | 1591 code | 19 blank | 103 comment | 0 complexity | 3fe722f2ee217972186416b5c7f86534 MD5 | raw file
Large files files are truncated, but you can click here to view the full file
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <!-- NewPage -->
- <html lang="en">
- <head>
- <!-- Generated by javadoc (version 1.6.0_18) on Thu Dec 18 17:17:19 PST 2014 -->
- <title>TreeMap (Java Platform SE 7 )</title>
- <meta name="date" content="2014-12-18">
- <meta name="keywords" content="java.util.TreeMap class">
- <meta name="keywords" content="size()">
- <meta name="keywords" content="containsKey()">
- <meta name="keywords" content="containsValue()">
- <meta name="keywords" content="get()">
- <meta name="keywords" content="comparator()">
- <meta name="keywords" content="firstKey()">
- <meta name="keywords" content="lastKey()">
- <meta name="keywords" content="putAll()">
- <meta name="keywords" content="put()">
- <meta name="keywords" content="remove()">
- <meta name="keywords" content="clear()">
- <meta name="keywords" content="clone()">
- <meta name="keywords" content="firstEntry()">
- <meta name="keywords" content="lastEntry()">
- <meta name="keywords" content="pollFirstEntry()">
- <meta name="keywords" content="pollLastEntry()">
- <meta name="keywords" content="lowerEntry()">
- <meta name="keywords" content="lowerKey()">
- <meta name="keywords" content="floorEntry()">
- <meta name="keywords" content="floorKey()">
- <meta name="keywords" content="ceilingEntry()">
- <meta name="keywords" content="ceilingKey()">
- <meta name="keywords" content="higherEntry()">
- <meta name="keywords" content="higherKey()">
- <meta name="keywords" content="keySet()">
- <meta name="keywords" content="navigableKeySet()">
- <meta name="keywords" content="descendingKeySet()">
- <meta name="keywords" content="values()">
- <meta name="keywords" content="entrySet()">
- <meta name="keywords" content="descendingMap()">
- <meta name="keywords" content="subMap()">
- <meta name="keywords" content="headMap()">
- <meta name="keywords" content="tailMap()">
- <link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
- </head>
- <body>
- <script type="text/javascript"><!--
- if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="TreeMap (Java Platform SE 7 )";
- }
- //-->
- </script>
- <noscript>
- <div>JavaScript is disabled on your browser.</div>
- </noscript>
- <!-- ========= START OF TOP NAVBAR ======= -->
- <div class="topNav"><a name="navbar_top">
- <!-- -->
- </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
- <!-- -->
- </a>
- <ul class="navList" title="Navigation">
- <li><a href="../../overview-summary.html">Overview</a></li>
- <li><a href="package-summary.html">Package</a></li>
- <li class="navBarCell1Rev">Class</li>
- <li><a href="class-use/TreeMap.html">Use</a></li>
- <li><a href="package-tree.html">Tree</a></li>
- <li><a href="../../deprecated-list.html">Deprecated</a></li>
- <li><a href="../../index-files/index-1.html">Index</a></li>
- <li><a href="../../help-doc.html">Help</a></li>
- </ul>
- <div class="aboutLanguage"><em><strong>Java™ Platform<br>Standard Ed. 7</strong></em></div>
- </div>
- <div class="subNav">
- <ul class="navList">
- <li><a href="../../java/util/TooManyListenersException.html" title="class in java.util"><span class="strong">Prev Class</span></a></li>
- <li><a href="../../java/util/TreeSet.html" title="class in java.util"><span class="strong">Next Class</span></a></li>
- </ul>
- <ul class="navList">
- <li><a href="../../index.html?java/util/TreeMap.html" target="_top">Frames</a></li>
- <li><a href="TreeMap.html" target="_top">No Frames</a></li>
- </ul>
- <ul class="navList" id="allclasses_navbar_top">
- <li><a href="../../allclasses-noframe.html">All Classes</a></li>
- </ul>
- <div>
- <script type="text/javascript"><!--
- allClassesLink = document.getElementById("allclasses_navbar_top");
- if(window==top) {
- allClassesLink.style.display = "block";
- }
- else {
- allClassesLink.style.display = "none";
- }
- //-->
- </script>
- </div>
- <div>
- <ul class="subNavList">
- <li>Summary: </li>
- <li><a href="#nested_classes_inherited_from_class_java.util.AbstractMap">Nested</a> | </li>
- <li>Field | </li>
- <li><a href="#constructor_summary">Constr</a> | </li>
- <li><a href="#method_summary">Method</a></li>
- </ul>
- <ul class="subNavList">
- <li>Detail: </li>
- <li>Field | </li>
- <li><a href="#constructor_detail">Constr</a> | </li>
- <li><a href="#method_detail">Method</a></li>
- </ul>
- </div>
- <a name="skip-navbar_top">
- <!-- -->
- </a></div>
- <!-- ========= END OF TOP NAVBAR ========= -->
- <!-- ======== START OF CLASS DATA ======== -->
- <div class="header">
- <div class="subTitle">java.util</div>
- <h2 title="Class TreeMap" class="title">Class TreeMap<K,V></h2>
- </div>
- <div class="contentContainer">
- <ul class="inheritance">
- <li><a href="../../java/lang/Object.html" title="class in java.lang">java.lang.Object</a></li>
- <li>
- <ul class="inheritance">
- <li><a href="../../java/util/AbstractMap.html" title="class in java.util">java.util.AbstractMap</a><K,V></li>
- <li>
- <ul class="inheritance">
- <li>java.util.TreeMap<K,V></li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- <div class="description">
- <ul class="blockList">
- <li class="blockList">
- <dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>K</code> - the type of keys maintained by this map</dd><dd><code>V</code> - the type of mapped values</dd></dl>
- <dl>
- <dt>All Implemented Interfaces:</dt>
- <dd><a href="../../java/io/Serializable.html" title="interface in java.io">Serializable</a>, <a href="../../java/lang/Cloneable.html" title="interface in java.lang">Cloneable</a>, <a href="../../java/util/Map.html" title="interface in java.util">Map</a><K,V>, <a href="../../java/util/NavigableMap.html" title="interface in java.util">NavigableMap</a><K,V>, <a href="../../java/util/SortedMap.html" title="interface in java.util">SortedMap</a><K,V></dd>
- </dl>
- <hr>
- <br>
- <pre>public class <span class="strong">TreeMap<K,V></span>
- extends <a href="../../java/util/AbstractMap.html" title="class in java.util">AbstractMap</a><K,V>
- implements <a href="../../java/util/NavigableMap.html" title="interface in java.util">NavigableMap</a><K,V>, <a href="../../java/lang/Cloneable.html" title="interface in java.lang">Cloneable</a>, <a href="../../java/io/Serializable.html" title="interface in java.io">Serializable</a></pre>
- <div class="block">A Red-Black tree based <a href="../../java/util/NavigableMap.html" title="interface in java.util"><code>NavigableMap</code></a> implementation.
- The map is sorted according to the <a href="../../java/lang/Comparable.html" title="interface in java.lang">natural
- ordering</a> of its keys, or by a <a href="../../java/util/Comparator.html" title="interface in java.util"><code>Comparator</code></a> provided at map
- creation time, depending on which constructor is used.
- <p>This implementation provides guaranteed log(n) time cost for the
- <code>containsKey</code>, <code>get</code>, <code>put</code> and <code>remove</code>
- operations. Algorithms are adaptations of those in Cormen, Leiserson, and
- Rivest's <em>Introduction to Algorithms</em>.
- <p>Note that the ordering maintained by a tree map, like any sorted map, and
- whether or not an explicit comparator is provided, must be <em>consistent
- with <code>equals</code></em> if this sorted map is to correctly implement the
- <code>Map</code> interface. (See <code>Comparable</code> or <code>Comparator</code> for a
- precise definition of <em>consistent with equals</em>.) This is so because
- the <code>Map</code> interface is defined in terms of the <code>equals</code>
- operation, but a sorted map performs all key comparisons using its <code>compareTo</code> (or <code>compare</code>) 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 <em>is</em> well-defined even if its ordering is
- inconsistent with <code>equals</code>; it just fails to obey the general contract
- of the <code>Map</code> interface.
- <p><strong>Note that this implementation is not synchronized.</strong>
- If multiple threads access a map concurrently, and at least one of the
- threads modifies the map structurally, it <em>must</em> 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
- <a href="../../java/util/Collections.html#synchronizedSortedMap(java.util.SortedMap)"><code>Collections.synchronizedSortedMap</code></a>
- method. This is best done at creation time, to prevent accidental
- unsynchronized access to the map: <pre>
- SortedMap m = Collections.synchronizedSortedMap(new TreeMap(...));</pre>
- <p>The iterators returned by the <code>iterator</code> method of the collections
- returned by all of this class's "collection view methods" are
- <em>fail-fast</em>: if the map is structurally modified at any time after
- the iterator is created, in any way except through the iterator's own
- <code>remove</code> method, the iterator will throw a <a href="../../java/util/ConcurrentModificationException.html" title="class in java.util"><code>ConcurrentModificationException</code></a>. 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 <code>ConcurrentModificationException</code> on a best-effort basis.
- Therefore, it would be wrong to write a program that depended on this
- exception for its correctness: <em>the fail-fast behavior of iterators
- should be used only to detect bugs.</em>
- <p>All <code>Map.Entry</code> pairs returned by methods in this class
- and its views represent snapshots of mappings at the time they were
- produced. They do <strong>not</strong> support the <code>Entry.setValue</code>
- method. (Note however that it is possible to change mappings in the
- associated map using <code>put</code>.)
- <p>This class is a member of the
- <a href="../../../technotes/guides/collections/index.html">
- Java Collections Framework</a>.</div>
- <dl><dt><span class="strong">Since:</span></dt>
- <dd>1.2</dd>
- <dt><span class="strong">See Also:</span></dt><dd><a href="../../java/util/Map.html" title="interface in java.util"><code>Map</code></a>,
- <a href="../../java/util/HashMap.html" title="class in java.util"><code>HashMap</code></a>,
- <a href="../../java/util/Hashtable.html" title="class in java.util"><code>Hashtable</code></a>,
- <a href="../../java/lang/Comparable.html" title="interface in java.lang"><code>Comparable</code></a>,
- <a href="../../java/util/Comparator.html" title="interface in java.util"><code>Comparator</code></a>,
- <a href="../../java/util/Collection.html" title="interface in java.util"><code>Collection</code></a>,
- <a href="../../serialized-form.html#java.util.TreeMap">Serialized Form</a></dd></dl>
- </li>
- </ul>
- </div>
- <div class="summary">
- <ul class="blockList">
- <li class="blockList">
- <!-- ======== NESTED CLASS SUMMARY ======== -->
- <ul class="blockList">
- <li class="blockList"><a name="nested_class_summary">
- <!-- -->
- </a>
- <h3>Nested Class Summary</h3>
- <ul class="blockList">
- <li class="blockList"><a name="nested_classes_inherited_from_class_java.util.AbstractMap">
- <!-- -->
- </a>
- <h3>Nested classes/interfaces inherited from class java.util.<a href="../../java/util/AbstractMap.html" title="class in java.util">AbstractMap</a></h3>
- <code><a href="../../java/util/AbstractMap.SimpleEntry.html" title="class in java.util">AbstractMap.SimpleEntry</a><<a href="../../java/util/AbstractMap.SimpleEntry.html" title="type parameter in AbstractMap.SimpleEntry">K</a>,<a href="../../java/util/AbstractMap.SimpleEntry.html" title="type parameter in AbstractMap.SimpleEntry">V</a>>, <a href="../../java/util/AbstractMap.SimpleImmutableEntry.html" title="class in java.util">AbstractMap.SimpleImmutableEntry</a><<a href="../../java/util/AbstractMap.SimpleImmutableEntry.html" title="type parameter in AbstractMap.SimpleImmutableEntry">K</a>,<a href="../../java/util/AbstractMap.SimpleImmutableEntry.html" title="type parameter in AbstractMap.SimpleImmutableEntry">V</a>></code></li>
- </ul>
- </li>
- </ul>
- <!-- ======== CONSTRUCTOR SUMMARY ======== -->
- <ul class="blockList">
- <li class="blockList"><a name="constructor_summary">
- <!-- -->
- </a>
- <h3>Constructor Summary</h3>
- <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
- <caption><span>Constructors</span><span class="tabEnd"> </span></caption>
- <tr>
- <th class="colOne" scope="col">Constructor and Description</th>
- </tr>
- <tr class="altColor">
- <td class="colOne"><code><strong><a href="../../java/util/TreeMap.html#TreeMap()">TreeMap</a></strong>()</code>
- <div class="block">Constructs a new, empty tree map, using the natural ordering of its
- keys.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colOne"><code><strong><a href="../../java/util/TreeMap.html#TreeMap(java.util.Comparator)">TreeMap</a></strong>(<a href="../../java/util/Comparator.html" title="interface in java.util">Comparator</a><? super <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>> comparator)</code>
- <div class="block">Constructs a new, empty tree map, ordered according to the given
- comparator.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colOne"><code><strong><a href="../../java/util/TreeMap.html#TreeMap(java.util.Map)">TreeMap</a></strong>(<a href="../../java/util/Map.html" title="interface in java.util">Map</a><? extends <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,? extends <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>> m)</code>
- <div class="block">Constructs a new tree map containing the same mappings as the given
- map, ordered according to the <em>natural ordering</em> of its keys.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colOne"><code><strong><a href="../../java/util/TreeMap.html#TreeMap(java.util.SortedMap)">TreeMap</a></strong>(<a href="../../java/util/SortedMap.html" title="interface in java.util">SortedMap</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,? extends <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>> m)</code>
- <div class="block">Constructs a new tree map containing the same mappings and
- using the same ordering as the specified sorted map.</div>
- </td>
- </tr>
- </table>
- </li>
- </ul>
- <!-- ========== METHOD SUMMARY =========== -->
- <ul class="blockList">
- <li class="blockList"><a name="method_summary">
- <!-- -->
- </a>
- <h3>Method Summary</h3>
- <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
- <caption><span>Methods</span><span class="tabEnd"> </span></caption>
- <tr>
- <th class="colFirst" scope="col">Modifier and Type</th>
- <th class="colLast" scope="col">Method and Description</th>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code><a href="../../java/util/Map.Entry.html" title="interface in java.util">Map.Entry</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#ceilingEntry(K)">ceilingEntry</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a> key)</code>
- <div class="block">Returns a key-value mapping associated with the least key
- greater than or equal to the given key, or <code>null</code> if
- there is no such key.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#ceilingKey(K)">ceilingKey</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a> key)</code>
- <div class="block">Returns the least key greater than or equal to the given key,
- or <code>null</code> if there is no such key.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code>void</code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#clear()">clear</a></strong>()</code>
- <div class="block">Removes all of the mappings from this map.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code><a href="../../java/lang/Object.html" title="class in java.lang">Object</a></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#clone()">clone</a></strong>()</code>
- <div class="block">Returns a shallow copy of this <code>TreeMap</code> instance.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code><a href="../../java/util/Comparator.html" title="interface in java.util">Comparator</a><? super <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#comparator()">comparator</a></strong>()</code>
- <div class="block">Returns the comparator used to order the keys in this map, or
- <code>null</code> if this map uses the <a href="../../java/lang/Comparable.html" title="interface in java.lang">natural ordering</a> of its keys.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code>boolean</code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#containsKey(java.lang.Object)">containsKey</a></strong>(<a href="../../java/lang/Object.html" title="class in java.lang">Object</a> key)</code>
- <div class="block">Returns <code>true</code> if this map contains a mapping for the specified
- key.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code>boolean</code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#containsValue(java.lang.Object)">containsValue</a></strong>(<a href="../../java/lang/Object.html" title="class in java.lang">Object</a> value)</code>
- <div class="block">Returns <code>true</code> if this map maps one or more keys to the
- specified value.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code><a href="../../java/util/NavigableSet.html" title="interface in java.util">NavigableSet</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#descendingKeySet()">descendingKeySet</a></strong>()</code>
- <div class="block">Returns a reverse order <a href="../../java/util/NavigableSet.html" title="interface in java.util"><code>NavigableSet</code></a> view of the keys contained in this map.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code><a href="../../java/util/NavigableMap.html" title="interface in java.util">NavigableMap</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#descendingMap()">descendingMap</a></strong>()</code>
- <div class="block">Returns a reverse order view of the mappings contained in this map.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code><a href="../../java/util/Set.html" title="interface in java.util">Set</a><<a href="../../java/util/Map.Entry.html" title="interface in java.util">Map.Entry</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>>></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#entrySet()">entrySet</a></strong>()</code>
- <div class="block">Returns a <a href="../../java/util/Set.html" title="interface in java.util"><code>Set</code></a> view of the mappings contained in this map.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code><a href="../../java/util/Map.Entry.html" title="interface in java.util">Map.Entry</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#firstEntry()">firstEntry</a></strong>()</code>
- <div class="block">Returns a key-value mapping associated with the least
- key in this map, or <code>null</code> if the map is empty.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#firstKey()">firstKey</a></strong>()</code>
- <div class="block">Returns the first (lowest) key currently in this map.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code><a href="../../java/util/Map.Entry.html" title="interface in java.util">Map.Entry</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#floorEntry(K)">floorEntry</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a> key)</code>
- <div class="block">Returns a key-value mapping associated with the greatest key
- less than or equal to the given key, or <code>null</code> if there
- is no such key.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#floorKey(K)">floorKey</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a> key)</code>
- <div class="block">Returns the greatest key less than or equal to the given key,
- or <code>null</code> if there is no such key.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#get(java.lang.Object)">get</a></strong>(<a href="../../java/lang/Object.html" title="class in java.lang">Object</a> key)</code>
- <div class="block">Returns the value to which the specified key is mapped,
- or <code>null</code> if this map contains no mapping for the key.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code><a href="../../java/util/SortedMap.html" title="interface in java.util">SortedMap</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#headMap(K)">headMap</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a> toKey)</code>
- <div class="block">Returns a view of the portion of this map whose keys are
- strictly less than <code>toKey</code>.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code><a href="../../java/util/NavigableMap.html" title="interface in java.util">NavigableMap</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#headMap(K,%20boolean)">headMap</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a> toKey,
- boolean inclusive)</code>
- <div class="block">Returns a view of the portion of this map whose keys are less than (or
- equal to, if <code>inclusive</code> is true) <code>toKey</code>.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code><a href="../../java/util/Map.Entry.html" title="interface in java.util">Map.Entry</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#higherEntry(K)">higherEntry</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a> key)</code>
- <div class="block">Returns a key-value mapping associated with the least key
- strictly greater than the given key, or <code>null</code> if there
- is no such key.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#higherKey(K)">higherKey</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a> key)</code>
- <div class="block">Returns the least key strictly greater than the given key, or
- <code>null</code> if there is no such key.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code><a href="../../java/util/Set.html" title="interface in java.util">Set</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#keySet()">keySet</a></strong>()</code>
- <div class="block">Returns a <a href="../../java/util/Set.html" title="interface in java.util"><code>Set</code></a> view of the keys contained in this map.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code><a href="../../java/util/Map.Entry.html" title="interface in java.util">Map.Entry</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#lastEntry()">lastEntry</a></strong>()</code>
- <div class="block">Returns a key-value mapping associated with the greatest
- key in this map, or <code>null</code> if the map is empty.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#lastKey()">lastKey</a></strong>()</code>
- <div class="block">Returns the last (highest) key currently in this map.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code><a href="../../java/util/Map.Entry.html" title="interface in java.util">Map.Entry</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#lowerEntry(K)">lowerEntry</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a> key)</code>
- <div class="block">Returns a key-value mapping associated with the greatest key
- strictly less than the given key, or <code>null</code> if there is
- no such key.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#lowerKey(K)">lowerKey</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a> key)</code>
- <div class="block">Returns the greatest key strictly less than the given key, or
- <code>null</code> if there is no such key.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code><a href="../../java/util/NavigableSet.html" title="interface in java.util">NavigableSet</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#navigableKeySet()">navigableKeySet</a></strong>()</code>
- <div class="block">Returns a <a href="../../java/util/NavigableSet.html" title="interface in java.util"><code>NavigableSet</code></a> view of the keys contained in this map.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code><a href="../../java/util/Map.Entry.html" title="interface in java.util">Map.Entry</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#pollFirstEntry()">pollFirstEntry</a></strong>()</code>
- <div class="block">Removes and returns a key-value mapping associated with
- the least key in this map, or <code>null</code> if the map is empty.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code><a href="../../java/util/Map.Entry.html" title="interface in java.util">Map.Entry</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#pollLastEntry()">pollLastEntry</a></strong>()</code>
- <div class="block">Removes and returns a key-value mapping associated with
- the greatest key in this map, or <code>null</code> if the map is empty.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#put(K,%20V)">put</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a> key,
- <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a> value)</code>
- <div class="block">Associates the specified value with the specified key in this map.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code>void</code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#putAll(java.util.Map)">putAll</a></strong>(<a href="../../java/util/Map.html" title="interface in java.util">Map</a><? extends <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,? extends <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>> map)</code>
- <div class="block">Copies all of the mappings from the specified map to this map.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#remove(java.lang.Object)">remove</a></strong>(<a href="../../java/lang/Object.html" title="class in java.lang">Object</a> key)</code>
- <div class="block">Removes the mapping for this key from this TreeMap if present.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code>int</code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#size()">size</a></strong>()</code>
- <div class="block">Returns the number of key-value mappings in this map.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code><a href="../../java/util/NavigableMap.html" title="interface in java.util">NavigableMap</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#subMap(K,%20boolean,%20K,%20boolean)">subMap</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a> fromKey,
- boolean fromInclusive,
- <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a> toKey,
- boolean toInclusive)</code>
- <div class="block">Returns a view of the portion of this map whose keys range from
- <code>fromKey</code> to <code>toKey</code>.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code><a href="../../java/util/SortedMap.html" title="interface in java.util">SortedMap</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#subMap(K,%20K)">subMap</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a> fromKey,
- <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a> toKey)</code>
- <div class="block">Returns a view of the portion of this map whose keys range from
- <code>fromKey</code>, inclusive, to <code>toKey</code>, exclusive.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code><a href="../../java/util/SortedMap.html" title="interface in java.util">SortedMap</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#tailMap(K)">tailMap</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a> fromKey)</code>
- <div class="block">Returns a view of the portion of this map whose keys are
- greater than or equal to <code>fromKey</code>.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code><a href="../../java/util/NavigableMap.html" title="interface in java.util">NavigableMap</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#tailMap(K,%20boolean)">tailMap</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a> fromKey,
- boolean inclusive)</code>
- <div class="block">Returns a view of the portion of this map whose keys are greater than (or
- equal to, if <code>inclusive</code> is true) <code>fromKey</code>.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code><a href="../../java/util/Collection.html" title="interface in java.util">Collection</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></td>
- <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#values()">values</a></strong>()</code>
- <div class="block">Returns a <a href="../../java/util/Collection.html" title="interface in java.util"><code>Collection</code></a> view of the values contained in this map.</div>
- </td>
- </tr>
- </table>
- <ul class="blockList">
- <li class="blockList"><a name="methods_inherited_from_class_java.util.AbstractMap">
- <!-- -->
- </a>
- <h3>Methods inherited from class java.util.<a href="../../java/util/AbstractMap.html" title="class in java.util">AbstractMap</a></h3>
- <code><a href="../../java/util/AbstractMap.html#equals(java.lang.Object)">equals</a>, <a href="../../java/util/AbstractMap.html#hashCode()">hashCode</a>, <a href="../../java/util/AbstractMap.html#isEmpty()">isEmpty</a>, <a href="../../java/util/AbstractMap.html#toString()">toString</a></code></li>
- </ul>
- <ul class="blockList">
- <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
- <!-- -->
- </a>
- <h3>Methods inherited from class java.lang.<a href="../../java/lang/Object.html" title="class in java.lang">Object</a></h3>
- <code><a href="../../java/lang/Object.html#finalize()">finalize</a>, <a href="../../java/lang/Object.html#getClass()">getClass</a>, <a href="../../java/lang/Object.html#notify()">notify</a>, <a href="../../java/lang/Object.html#notifyAll()">notifyAll</a>, <a href="../../java/lang/Object.html#wait()">wait</a>, <a href="../../java/lang/Object.html#wait(long)">wait</a>, <a href="../../java/lang/Object.html#wait(long,%20int)">wait</a></code></li>
- </ul>
- <ul class="blockList">
- <li class="blockList"><a name="methods_inherited_from_class_java.util.Map">
- <!-- -->
- </a>
- <h3>Methods inherited from interface java.util.<a href="../../java/util/Map.html" title="interface in java.util">Map</a></h3>
- <code><a href="../../java/util/Map.html#equals(java.lang.Object)">equals</a>, <a href="../../java/util/Map.html#hashCode()">hashCode</a>, <a href="../../java/util/Map.html#isEmpty()">isEmpty</a></code></li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </div>
- <div class="details">
- <ul class="blockList">
- <li class="blockList">
- <!-- ========= CONSTRUCTOR DETAIL ======== -->
- <ul class="blockList">
- <li class="blockList"><a name="constructor_detail">
- <!-- -->
- </a>
- <h3>Constructor Detail</h3>
- <a name="TreeMap()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>TreeMap</h4>
- <pre>public TreeMap()</pre>
- <div class="block">Constructs a new, empty tree map, using the natural ordering of its
- keys. All keys inserted into the map must implement the <a href="../../java/lang/Comparable.html" title="interface in java.lang"><code>Comparable</code></a> interface. Furthermore, all such keys must be
- <em>mutually comparable</em>: <code>k1.compareTo(k2)</code> must not throw
- a <code>ClassCastException</code> for any keys <code>k1</code> and
- <code>k2</code> 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
- <code>put(Object key, Object value)</code> call will throw a
- <code>ClassCastException</code>.</div>
- </li>
- </ul>
- <a name="TreeMap(java.util.Comparator)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>TreeMap</h4>
- <pre>public TreeMap(<a href="../../java/util/Comparator.html" title="interface in java.util">Comparator</a><? super <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>> comparator)</pre>
- <div class="block">Constructs a new, empty tree map, ordered according to the given
- comparator. All keys inserted into the map must be <em>mutually
- comparable</em> by the given comparator: <code>comparator.compare(k1,
- k2)</code> must not throw a <code>ClassCastException</code> for any keys
- <code>k1</code> and <code>k2</code> in the map. If the user attempts to put
- a key into the map that violates this constraint, the <code>put(Object
- key, Object value)</code> call will throw a
- <code>ClassCastException</code>.</div>
- <dl><dt><span class="strong">Parameters:</span></dt><dd><code>comparator</code> - the comparator that will be used to order this map.
- If <code>null</code>, the <a href="../../java/lang/Comparable.html" title="interface in java.lang">natural
- ordering</a> of the keys will be used.</dd></dl>
- </li>
- </ul>
- <a name="TreeMap(java.util.Map)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>TreeMap</h4>
- <pre>public TreeMap(<a href="../../java/util/Map.html" title="interface in java.util">Map</a><? extends <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,? extends <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>> m)</pre>
- <div class="block">Constructs a new tree map containing the same mappings as the given
- map, ordered according to the <em>natural ordering</em> of its keys.
- All keys inserted into the new map must implement the <a href="../../java/lang/Comparable.html" title="interface in java.lang"><code>Comparable</code></a> interface. Furthermore, all such keys must be
- <em>mutually comparable</em>: <code>k1.compareTo(k2)</code> must not throw
- a <code>ClassCastException</code> for any keys <code>k1</code> and
- <code>k2</code> in the map. This method runs in n*log(n) time.</div>
- <dl><dt><span class="strong">Parameters:</span></dt><dd><code>m</code> - the map whose mappings are to be placed in this map</dd>
- <dt><span class="strong">Throws:</span></dt>
- <dd><code><a href="../../java/lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> - if the keys in m are not <a href="../../java/lang/Comparable.html" title="interface in java.lang"><code>Comparable</code></a>,
- or are not mutually comparable</dd>
- <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified map is null</dd></dl>
- </li>
- </ul>
- <a name="TreeMap(java.util.SortedMap)">
- <!-- -->
- </a>
- <ul class="blockListLast">
- <li class="blockList">
- <h4>TreeMap</h4>
- <pre>public TreeMap(<a href="../../java/util/SortedMap.html" title="interface in java.util">SortedMap</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,? extends <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>> m)</pre>
- <div class="block">Constructs a new tree map containing the same mappings and
- using the same ordering as the specified sorted map. This
- method runs in linear time.</div>
- <dl><dt><span class="strong">Parameters:</span></dt><dd><code>m</code> - the sorted map whose mappings are to be placed in this map,
- and whose comparator is to be used to sort this map</dd>
- <dt><span class="strong">Throws:</span></dt>
- <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified map is null</dd></dl>
- </li>
- </ul>
- </li>
- </ul>
- <!-- ============ METHOD DETAIL ========== -->
- <ul class="blockList">
- <li class="blockList"><a name="method_detail">
- <!-- -->
- </a>
- <h3>Method Detail</h3>
- <a name="size()">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>size</h4>
- <pre>public int size()</pre>
- <div class="block">Returns the number of key-value mappings in this map.</div>
- <dl>
- <dt><strong>Specified by:</strong></dt>
- <dd><code><a href="../../java/util/Map.html#size()">size</a></code> in interface <code><a href="../../java/util/Map.html" title="interface in java.util">Map</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></dd>
- <dt><strong>Overrides:</strong></dt>
- <dd><code><a href="../../java/util/AbstractMap.html#size()">size</a></code> in class <code><a href="../../java/util/AbstractMap.html" title="class in java.util">AbstractMap</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></dd>
- <dt><span class="strong">Returns:</span></dt><dd>the number of key-value mappings in this map</dd></dl>
- </li>
- </ul>
- <a name="containsKey(java.lang.Object)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>containsKey</h4>
- <pre>public boolean containsKey(<a href="../../java/lang/Object.html" title="class in java.lang">Object</a> key)</pre>
- <div class="block">Returns <code>true</code> if this map contains a mapping for the specified
- key.</div>
- <dl>
- <dt><strong>Specified by:</strong></dt>
- <dd><code><a href="../../java/util/Map.html#containsKey(java.lang.Object)">containsKey</a></code> in interface <code><a href="../../java/util/Map.html" title="interface in java.util">Map</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></dd>
- <dt><strong>Overrides:</strong></dt>
- <dd><code><a href="../../java/util/AbstractMap.html#containsKey(java.lang.Object)">containsKey</a></code> in class <code><a href="../../java/util/AbstractMap.html" title="class in java.util">AbstractMap</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></dd>
- <dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - key whose presence in this map is to be tested</dd>
- <dt><span class="strong">Returns:</span></dt><dd><code>true</code> if this map contains a mapping for the
- specified key</dd>
- <dt><span class="strong">Throws:</span></dt>
- <dd><code><a href="../../java/lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> - if the specified key cannot be compared
- with the keys currently in the map</dd>
- <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified key is null
- and this map uses natural ordering, or its comparator
- does not permit null keys</dd></dl>
- </li>
- </ul>
- <a name="containsValue(java.lang.Object)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>containsValue</h4>
- <pre>public boolean containsValue(<a href="../../java/lang/Object.html" title="class in java.lang">Object</a> value)</pre>
- <div class="block">Returns <code>true</code> if this map maps one or more keys to the
- specified value. More formally, returns <code>true</code> if and only if
- this map contains at least one mapping to a value <code>v</code> such
- that <code>(value==null ? v==null : value.equals(v))</code>. This
- operation will probably require time linear in the map size for
- most implementations.</div>
- <dl>
- <dt><strong>Specified by:</strong></dt>
- <dd><code><a href="../../java/util/Map.html#containsValue(java.lang.Object)">containsValue</a></code> in interface <code><a href="../../java/util/Map.html" title="interface in java.util">Map</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></dd>
- <dt><strong>Overrides:</strong></dt>
- <dd><code><a href="../../java/util/AbstractMap.html#containsValue(java.lang.Object)">containsValue</a></code> in class <code><a href="../../java/util/AbstractMap.html" title="class in java.util">AbstractMap</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></dd>
- <dt><span class="strong">Parameters:</span></dt><dd><code>value</code> - value whose presence in this map is to be tested</dd>
- <dt><span class="strong">Returns:</span></dt><dd><code>true</code> if a mapping to <code>value</code> exists;
- <code>false</code> otherwise</dd><dt><span class="strong">Since:</span></dt>
- <dd>1.2</dd></dl>
- </li>
- </ul>
- <a name="get(java.lang.Object)">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>get</h4>
- <pre>public <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a> get(<a href="../../java/lang/Object.html" title="class in java.lang">Object</a> key)</pre>
- <div class="block">Returns the value to which the specified key is mapped,
- or <code>null</code> if this map contains no mapping for the key.
- <p>More formally, if this map contains a mapping from a key
- <code>k</code> to a value <code>v</code> such that <code>key</code> compares
- equal to <code>k</code> according to the map's ordering, then this
- method returns <code>v</code>; otherwise it returns <code>null</code>.
- (There can be at most one such mapping.)
- <p>A return value of <code>null</code> does not <em>necessarily</em>
- indicate that the map contains no mapping for the key; it's also
- possible that the map explicitly maps the key to <code>null</code>.
- The <a href="../../java/util/TreeMap.html#containsKey(java.lang.Object)"><code>containsKey</code></a> operation may be used to
- distinguish these two cases.</div>
- <dl>
- <dt><strong>Specified by:</strong></dt>
- <dd><code><a href="../../java/util/Map.html#get(java.lang.Object)">get</a></code> in interface <code><a href="../../java/util/Map.html" title="interface in java.util">Map</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></dd>
- <dt><strong>Overrides:</strong></dt>
- <dd><code><a href="../../java/util/AbstractMap.html#get(java.lang.Object)">get</a></code> in class <code><a href="../../java/util/AbstractMap.html" title="class in java.util">AbstractMap</a><<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>></code></dd>
- <dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - the key whose associated value is to be returned</dd>
- <dt><span class="strong">Returns:</span></dt><dd>the value to which the specified key is mapped, or
- <code>null</code> if this map contains no mapping for the key</dd>
- <dt><span class="strong">Throws:</span></dt>
- <dd><code><a href="../../java/lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> - if the specified key cannot be compared
- with the keys currently in the map</dd>
- <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified key is nul…
Large files files are truncated, but you can click here to view the full file