/jdk-8u31-docs-all/docs/api/java/util/TreeMap.html
HTML | 2016 lines | 1878 code | 25 blank | 113 comment | 0 complexity | e991bd5e2b536a1504c9c1cf13571146 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 (1.8.0_31) on Wed Dec 17 20:47:34 PST 2014 -->
- <title>TreeMap (Java Platform SE 8 )</title>
- <meta name="date" content="2014-12-17">
- <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()">
- <meta name="keywords" content="replace()">
- <meta name="keywords" content="forEach()">
- <meta name="keywords" content="replaceAll()">
- <link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
- <script type="text/javascript" src="../../script.js"></script>
- </head>
- <body>
- <script type="text/javascript"><!--
- try {
- if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="TreeMap (Java Platform SE 8 )";
- }
- }
- catch(err) {
- }
- //-->
- var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10,"i37":10,"i38":10,"i39":10};
- var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
- var altColor = "altColor";
- var rowColor = "rowColor";
- var tableTab = "tableTab";
- var activeTableTab = "activeTableTab";
- </script>
- <noscript>
- <div>JavaScript is disabled on your browser.</div>
- </noscript>
- <!-- ========= START OF TOP NAVBAR ======= -->
- <div class="topNav"><a name="navbar.top">
- <!-- -->
- </a>
- <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
- <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"><strong>Java™ Platform<br>Standard Ed. 8</strong></div>
- </div>
- <div class="subNav">
- <ul class="navList">
- <li><a href="../../java/util/TooManyListenersException.html" title="class in java.util"><span class="typeNameLink">Prev Class</span></a></li>
- <li><a href="../../java/util/TreeSet.html" title="class in java.util"><span class="typeNameLink">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">compact1, compact2, compact3</div>
- <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="paramLabel">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="typeNameLabel">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="simpleTagLabel">Since:</span></dt>
- <dd>1.2</dd>
- <dt><span class="seeLabel">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="memberSummary" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#TreeMap--">TreeMap</a></span>()</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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#TreeMap-java.util.Comparator-">TreeMap</a></span>(<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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#TreeMap-java.util.Map-">TreeMap</a></span>(<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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#TreeMap-java.util.SortedMap-">TreeMap</a></span>(<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="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
- <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
- <tr>
- <th class="colFirst" scope="col">Modifier and Type</th>
- <th class="colLast" scope="col">Method and Description</th>
- </tr>
- <tr id="i0" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#ceilingEntry-K-">ceilingEntry</a></span>(<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 id="i1" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#ceilingKey-K-">ceilingKey</a></span>(<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 id="i2" class="altColor">
- <td class="colFirst"><code>void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#clear--">clear</a></span>()</code>
- <div class="block">Removes all of the mappings from this map.</div>
- </td>
- </tr>
- <tr id="i3" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#clone--">clone</a></span>()</code>
- <div class="block">Returns a shallow copy of this <code>TreeMap</code> instance.</div>
- </td>
- </tr>
- <tr id="i4" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#comparator--">comparator</a></span>()</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 id="i5" class="rowColor">
- <td class="colFirst"><code>boolean</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#containsKey-java.lang.Object-">containsKey</a></span>(<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 id="i6" class="altColor">
- <td class="colFirst"><code>boolean</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#containsValue-java.lang.Object-">containsValue</a></span>(<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 id="i7" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#descendingKeySet--">descendingKeySet</a></span>()</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 id="i8" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#descendingMap--">descendingMap</a></span>()</code>
- <div class="block">Returns a reverse order view of the mappings contained in this map.</div>
- </td>
- </tr>
- <tr id="i9" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#entrySet--">entrySet</a></span>()</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 id="i10" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#firstEntry--">firstEntry</a></span>()</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 id="i11" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#firstKey--">firstKey</a></span>()</code>
- <div class="block">Returns the first (lowest) key currently in this map.</div>
- </td>
- </tr>
- <tr id="i12" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#floorEntry-K-">floorEntry</a></span>(<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 id="i13" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#floorKey-K-">floorKey</a></span>(<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 id="i14" class="altColor">
- <td class="colFirst"><code>void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#forEach-java.util.function.BiConsumer-">forEach</a></span>(<a href="../../java/util/function/BiConsumer.html" title="interface in java.util.function">BiConsumer</a><? super <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,? super <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>> action)</code>
- <div class="block">Performs the given action for each entry in this map until all entries
- have been processed or the action throws an exception.</div>
- </td>
- </tr>
- <tr id="i15" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#get-java.lang.Object-">get</a></span>(<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 id="i16" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#headMap-K-">headMap</a></span>(<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 id="i17" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#headMap-K-boolean-">headMap</a></span>(<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 id="i18" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#higherEntry-K-">higherEntry</a></span>(<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 id="i19" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#higherKey-K-">higherKey</a></span>(<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 id="i20" class="altColor">
- <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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#keySet--">keySet</a></span>()</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 id="i21" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#lastEntry--">lastEntry</a></span>()</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 id="i22" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#lastKey--">lastKey</a></span>()</code>
- <div class="block">Returns the last (highest) key currently in this map.</div>
- </td>
- </tr>
- <tr id="i23" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#lowerEntry-K-">lowerEntry</a></span>(<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 id="i24" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#lowerKey-K-">lowerKey</a></span>(<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 id="i25" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#navigableKeySet--">navigableKeySet</a></span>()</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 id="i26" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#pollFirstEntry--">pollFirstEntry</a></span>()</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 id="i27" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#pollLastEntry--">pollLastEntry</a></span>()</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 id="i28" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#put-K-V-">put</a></span>(<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 id="i29" class="rowColor">
- <td class="colFirst"><code>void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#putAll-java.util.Map-">putAll</a></span>(<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 id="i30" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#remove-java.lang.Object-">remove</a></span>(<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 id="i31" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#replace-K-V-">replace</a></span>(<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">Replaces the entry for the specified key only if it is
- currently mapped to some value.</div>
- </td>
- </tr>
- <tr id="i32" class="altColor">
- <td class="colFirst"><code>boolean</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#replace-K-V-V-">replace</a></span>(<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> oldValue,
- <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a> newValue)</code>
- <div class="block">Replaces the entry for the specified key only if currently
- mapped to the specified value.</div>
- </td>
- </tr>
- <tr id="i33" class="rowColor">
- <td class="colFirst"><code>void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#replaceAll-java.util.function.BiFunction-">replaceAll</a></span>(<a href="../../java/util/function/BiFunction.html" title="interface in java.util.function">BiFunction</a><? super <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>,? super <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>,? extends <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>> function)</code>
- <div class="block">Replaces each entry's value with the result of invoking the given
- function on that entry until all entries have been processed or the
- function throws an exception.</div>
- </td>
- </tr>
- <tr id="i34" class="altColor">
- <td class="colFirst"><code>int</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#size--">size</a></span>()</code>
- <div class="block">Returns the number of key-value mappings in this map.</div>
- </td>
- </tr>
- <tr id="i35" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#subMap-K-boolean-K-boolean-">subMap</a></span>(<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 id="i36" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#subMap-K-K-">subMap</a></span>(<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 id="i37" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#tailMap-K-">tailMap</a></span>(<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 id="i38" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#tailMap-K-boolean-">tailMap</a></span>(<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 id="i39" 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><span class="memberNameLink"><a href="../../java/util/TreeMap.html#values--">values</a></span>()</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-int-">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#compute-K-java.util.function.BiFunction-">compute</a>, <a href="../../java/util/Map.html#computeIfAbsent-K-java.util.function.Function-">computeIfAbsent</a>, <a href="../../java/util/Map.html#computeIfPresent-K-java.util.function.BiFunction-">computeIfPresent</a>, <a href="../../java/util/Map.html#equals-java.lang.Object-">equals</a>, <a href="../../java/util/Map.html#getOrDefault-java.lang.Object-V-">getOrDefault</a>, <a href="../../java/util/Map.html#hashCode--">hashCode</a>, <a href="../../java/util/Map.html#isEmpty--">isEmpty</a>, <a href="../../java/util/Map.html#merge-K-V-java.util.function.BiFunction-">merge</a>, <a href="../../java/util/Map.html#putIfAbsent-K-V-">putIfAbsent</a>, <a href="../../java/util/Map.html#remove-java.lang.Object-java.lang.Object-">remove</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="paramLabel">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="paramLabel">Parameters:</span></dt>
- <dd><code>m</code> - the map whose mappings are to be placed in this map</dd>
- <dt><span class="throwsLabel">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="paramLabel">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="throwsLabel">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><span class="overrideSpecifyLabel">Specified by:</span></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><span class="overrideSpecifyLabel">Overrides:</span></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="returnLabel">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><span class="overrideSpecifyLabel">Specified by:</span></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…
Large files files are truncated, but you can click here to view the full file