PageRenderTime 72ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 1ms

/jdk-8u31-docs-all/docs/api/java/util/TreeMap.html

https://gitlab.com/PNNutkung/Java-API
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

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!-- NewPage -->
  3. <html lang="en">
  4. <head>
  5. <!-- Generated by javadoc (1.8.0_31) on Wed Dec 17 20:47:34 PST 2014 -->
  6. <title>TreeMap (Java Platform SE 8 )</title>
  7. <meta name="date" content="2014-12-17">
  8. <meta name="keywords" content="java.util.TreeMap class">
  9. <meta name="keywords" content="size()">
  10. <meta name="keywords" content="containsKey()">
  11. <meta name="keywords" content="containsValue()">
  12. <meta name="keywords" content="get()">
  13. <meta name="keywords" content="comparator()">
  14. <meta name="keywords" content="firstKey()">
  15. <meta name="keywords" content="lastKey()">
  16. <meta name="keywords" content="putAll()">
  17. <meta name="keywords" content="put()">
  18. <meta name="keywords" content="remove()">
  19. <meta name="keywords" content="clear()">
  20. <meta name="keywords" content="clone()">
  21. <meta name="keywords" content="firstEntry()">
  22. <meta name="keywords" content="lastEntry()">
  23. <meta name="keywords" content="pollFirstEntry()">
  24. <meta name="keywords" content="pollLastEntry()">
  25. <meta name="keywords" content="lowerEntry()">
  26. <meta name="keywords" content="lowerKey()">
  27. <meta name="keywords" content="floorEntry()">
  28. <meta name="keywords" content="floorKey()">
  29. <meta name="keywords" content="ceilingEntry()">
  30. <meta name="keywords" content="ceilingKey()">
  31. <meta name="keywords" content="higherEntry()">
  32. <meta name="keywords" content="higherKey()">
  33. <meta name="keywords" content="keySet()">
  34. <meta name="keywords" content="navigableKeySet()">
  35. <meta name="keywords" content="descendingKeySet()">
  36. <meta name="keywords" content="values()">
  37. <meta name="keywords" content="entrySet()">
  38. <meta name="keywords" content="descendingMap()">
  39. <meta name="keywords" content="subMap()">
  40. <meta name="keywords" content="headMap()">
  41. <meta name="keywords" content="tailMap()">
  42. <meta name="keywords" content="replace()">
  43. <meta name="keywords" content="forEach()">
  44. <meta name="keywords" content="replaceAll()">
  45. <link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
  46. <script type="text/javascript" src="../../script.js"></script>
  47. </head>
  48. <body>
  49. <script type="text/javascript"><!--
  50. try {
  51. if (location.href.indexOf('is-external=true') == -1) {
  52. parent.document.title="TreeMap (Java Platform SE 8 )";
  53. }
  54. }
  55. catch(err) {
  56. }
  57. //-->
  58. 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};
  59. var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
  60. var altColor = "altColor";
  61. var rowColor = "rowColor";
  62. var tableTab = "tableTab";
  63. var activeTableTab = "activeTableTab";
  64. </script>
  65. <noscript>
  66. <div>JavaScript is disabled on your browser.</div>
  67. </noscript>
  68. <!-- ========= START OF TOP NAVBAR ======= -->
  69. <div class="topNav"><a name="navbar.top">
  70. <!-- -->
  71. </a>
  72. <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
  73. <a name="navbar.top.firstrow">
  74. <!-- -->
  75. </a>
  76. <ul class="navList" title="Navigation">
  77. <li><a href="../../overview-summary.html">Overview</a></li>
  78. <li><a href="package-summary.html">Package</a></li>
  79. <li class="navBarCell1Rev">Class</li>
  80. <li><a href="class-use/TreeMap.html">Use</a></li>
  81. <li><a href="package-tree.html">Tree</a></li>
  82. <li><a href="../../deprecated-list.html">Deprecated</a></li>
  83. <li><a href="../../index-files/index-1.html">Index</a></li>
  84. <li><a href="../../help-doc.html">Help</a></li>
  85. </ul>
  86. <div class="aboutLanguage"><strong>Java&trade;&nbsp;Platform<br>Standard&nbsp;Ed.&nbsp;8</strong></div>
  87. </div>
  88. <div class="subNav">
  89. <ul class="navList">
  90. <li><a href="../../java/util/TooManyListenersException.html" title="class in java.util"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  91. <li><a href="../../java/util/TreeSet.html" title="class in java.util"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  92. </ul>
  93. <ul class="navList">
  94. <li><a href="../../index.html?java/util/TreeMap.html" target="_top">Frames</a></li>
  95. <li><a href="TreeMap.html" target="_top">No&nbsp;Frames</a></li>
  96. </ul>
  97. <ul class="navList" id="allclasses_navbar_top">
  98. <li><a href="../../allclasses-noframe.html">All&nbsp;Classes</a></li>
  99. </ul>
  100. <div>
  101. <script type="text/javascript"><!--
  102. allClassesLink = document.getElementById("allclasses_navbar_top");
  103. if(window==top) {
  104. allClassesLink.style.display = "block";
  105. }
  106. else {
  107. allClassesLink.style.display = "none";
  108. }
  109. //-->
  110. </script>
  111. </div>
  112. <div>
  113. <ul class="subNavList">
  114. <li>Summary:&nbsp;</li>
  115. <li><a href="#nested.classes.inherited.from.class.java.util.AbstractMap">Nested</a>&nbsp;|&nbsp;</li>
  116. <li>Field&nbsp;|&nbsp;</li>
  117. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  118. <li><a href="#method.summary">Method</a></li>
  119. </ul>
  120. <ul class="subNavList">
  121. <li>Detail:&nbsp;</li>
  122. <li>Field&nbsp;|&nbsp;</li>
  123. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  124. <li><a href="#method.detail">Method</a></li>
  125. </ul>
  126. </div>
  127. <a name="skip.navbar.top">
  128. <!-- -->
  129. </a></div>
  130. <!-- ========= END OF TOP NAVBAR ========= -->
  131. <!-- ======== START OF CLASS DATA ======== -->
  132. <div class="header">
  133. <div class="subTitle">compact1, compact2, compact3</div>
  134. <div class="subTitle">java.util</div>
  135. <h2 title="Class TreeMap" class="title">Class TreeMap&lt;K,V&gt;</h2>
  136. </div>
  137. <div class="contentContainer">
  138. <ul class="inheritance">
  139. <li><a href="../../java/lang/Object.html" title="class in java.lang">java.lang.Object</a></li>
  140. <li>
  141. <ul class="inheritance">
  142. <li><a href="../../java/util/AbstractMap.html" title="class in java.util">java.util.AbstractMap</a>&lt;K,V&gt;</li>
  143. <li>
  144. <ul class="inheritance">
  145. <li>java.util.TreeMap&lt;K,V&gt;</li>
  146. </ul>
  147. </li>
  148. </ul>
  149. </li>
  150. </ul>
  151. <div class="description">
  152. <ul class="blockList">
  153. <li class="blockList">
  154. <dl>
  155. <dt><span class="paramLabel">Type Parameters:</span></dt>
  156. <dd><code>K</code> - the type of keys maintained by this map</dd>
  157. <dd><code>V</code> - the type of mapped values</dd>
  158. </dl>
  159. <dl>
  160. <dt>All Implemented Interfaces:</dt>
  161. <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>&lt;K,V&gt;, <a href="../../java/util/NavigableMap.html" title="interface in java.util">NavigableMap</a>&lt;K,V&gt;, <a href="../../java/util/SortedMap.html" title="interface in java.util">SortedMap</a>&lt;K,V&gt;</dd>
  162. </dl>
  163. <hr>
  164. <br>
  165. <pre>public class <span class="typeNameLabel">TreeMap&lt;K,V&gt;</span>
  166. extends <a href="../../java/util/AbstractMap.html" title="class in java.util">AbstractMap</a>&lt;K,V&gt;
  167. implements <a href="../../java/util/NavigableMap.html" title="interface in java.util">NavigableMap</a>&lt;K,V&gt;, <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>
  168. <div class="block">A Red-Black tree based <a href="../../java/util/NavigableMap.html" title="interface in java.util"><code>NavigableMap</code></a> implementation.
  169. The map is sorted according to the <a href="../../java/lang/Comparable.html" title="interface in java.lang">natural
  170. 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
  171. creation time, depending on which constructor is used.
  172. <p>This implementation provides guaranteed log(n) time cost for the
  173. <code>containsKey</code>, <code>get</code>, <code>put</code> and <code>remove</code>
  174. operations. Algorithms are adaptations of those in Cormen, Leiserson, and
  175. Rivest's <em>Introduction to Algorithms</em>.
  176. <p>Note that the ordering maintained by a tree map, like any sorted map, and
  177. whether or not an explicit comparator is provided, must be <em>consistent
  178. with <code>equals</code></em> if this sorted map is to correctly implement the
  179. <code>Map</code> interface. (See <code>Comparable</code> or <code>Comparator</code> for a
  180. precise definition of <em>consistent with equals</em>.) This is so because
  181. the <code>Map</code> interface is defined in terms of the <code>equals</code>
  182. 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
  183. this method are, from the standpoint of the sorted map, equal. The behavior
  184. of a sorted map <em>is</em> well-defined even if its ordering is
  185. inconsistent with <code>equals</code>; it just fails to obey the general contract
  186. of the <code>Map</code> interface.
  187. <p><strong>Note that this implementation is not synchronized.</strong>
  188. If multiple threads access a map concurrently, and at least one of the
  189. threads modifies the map structurally, it <em>must</em> be synchronized
  190. externally. (A structural modification is any operation that adds or
  191. deletes one or more mappings; merely changing the value associated
  192. with an existing key is not a structural modification.) This is
  193. typically accomplished by synchronizing on some object that naturally
  194. encapsulates the map.
  195. If no such object exists, the map should be "wrapped" using the
  196. <a href="../../java/util/Collections.html#synchronizedSortedMap-java.util.SortedMap-"><code>Collections.synchronizedSortedMap</code></a>
  197. method. This is best done at creation time, to prevent accidental
  198. unsynchronized access to the map: <pre>
  199. SortedMap m = Collections.synchronizedSortedMap(new TreeMap(...));</pre>
  200. <p>The iterators returned by the <code>iterator</code> method of the collections
  201. returned by all of this class's "collection view methods" are
  202. <em>fail-fast</em>: if the map is structurally modified at any time after
  203. the iterator is created, in any way except through the iterator's own
  204. <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
  205. modification, the iterator fails quickly and cleanly, rather than risking
  206. arbitrary, non-deterministic behavior at an undetermined time in the future.
  207. <p>Note that the fail-fast behavior of an iterator cannot be guaranteed
  208. as it is, generally speaking, impossible to make any hard guarantees in the
  209. presence of unsynchronized concurrent modification. Fail-fast iterators
  210. throw <code>ConcurrentModificationException</code> on a best-effort basis.
  211. Therefore, it would be wrong to write a program that depended on this
  212. exception for its correctness: <em>the fail-fast behavior of iterators
  213. should be used only to detect bugs.</em>
  214. <p>All <code>Map.Entry</code> pairs returned by methods in this class
  215. and its views represent snapshots of mappings at the time they were
  216. produced. They do <strong>not</strong> support the <code>Entry.setValue</code>
  217. method. (Note however that it is possible to change mappings in the
  218. associated map using <code>put</code>.)
  219. <p>This class is a member of the
  220. <a href="../../../technotes/guides/collections/index.html">
  221. Java Collections Framework</a>.</div>
  222. <dl>
  223. <dt><span class="simpleTagLabel">Since:</span></dt>
  224. <dd>1.2</dd>
  225. <dt><span class="seeLabel">See Also:</span></dt>
  226. <dd><a href="../../java/util/Map.html" title="interface in java.util"><code>Map</code></a>,
  227. <a href="../../java/util/HashMap.html" title="class in java.util"><code>HashMap</code></a>,
  228. <a href="../../java/util/Hashtable.html" title="class in java.util"><code>Hashtable</code></a>,
  229. <a href="../../java/lang/Comparable.html" title="interface in java.lang"><code>Comparable</code></a>,
  230. <a href="../../java/util/Comparator.html" title="interface in java.util"><code>Comparator</code></a>,
  231. <a href="../../java/util/Collection.html" title="interface in java.util"><code>Collection</code></a>,
  232. <a href="../../serialized-form.html#java.util.TreeMap">Serialized Form</a></dd>
  233. </dl>
  234. </li>
  235. </ul>
  236. </div>
  237. <div class="summary">
  238. <ul class="blockList">
  239. <li class="blockList">
  240. <!-- ======== NESTED CLASS SUMMARY ======== -->
  241. <ul class="blockList">
  242. <li class="blockList"><a name="nested.class.summary">
  243. <!-- -->
  244. </a>
  245. <h3>Nested Class Summary</h3>
  246. <ul class="blockList">
  247. <li class="blockList"><a name="nested.classes.inherited.from.class.java.util.AbstractMap">
  248. <!-- -->
  249. </a>
  250. <h3>Nested classes/interfaces inherited from class&nbsp;java.util.<a href="../../java/util/AbstractMap.html" title="class in java.util">AbstractMap</a></h3>
  251. <code><a href="../../java/util/AbstractMap.SimpleEntry.html" title="class in java.util">AbstractMap.SimpleEntry</a>&lt;<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>&gt;, <a href="../../java/util/AbstractMap.SimpleImmutableEntry.html" title="class in java.util">AbstractMap.SimpleImmutableEntry</a>&lt;<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>&gt;</code></li>
  252. </ul>
  253. </li>
  254. </ul>
  255. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  256. <ul class="blockList">
  257. <li class="blockList"><a name="constructor.summary">
  258. <!-- -->
  259. </a>
  260. <h3>Constructor Summary</h3>
  261. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
  262. <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
  263. <tr>
  264. <th class="colOne" scope="col">Constructor and Description</th>
  265. </tr>
  266. <tr class="altColor">
  267. <td class="colOne"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#TreeMap--">TreeMap</a></span>()</code>
  268. <div class="block">Constructs a new, empty tree map, using the natural ordering of its
  269. keys.</div>
  270. </td>
  271. </tr>
  272. <tr class="rowColor">
  273. <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>&lt;? super <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&gt;&nbsp;comparator)</code>
  274. <div class="block">Constructs a new, empty tree map, ordered according to the given
  275. comparator.</div>
  276. </td>
  277. </tr>
  278. <tr class="altColor">
  279. <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>&lt;? 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>&gt;&nbsp;m)</code>
  280. <div class="block">Constructs a new tree map containing the same mappings as the given
  281. map, ordered according to the <em>natural ordering</em> of its keys.</div>
  282. </td>
  283. </tr>
  284. <tr class="rowColor">
  285. <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>&lt;<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>&gt;&nbsp;m)</code>
  286. <div class="block">Constructs a new tree map containing the same mappings and
  287. using the same ordering as the specified sorted map.</div>
  288. </td>
  289. </tr>
  290. </table>
  291. </li>
  292. </ul>
  293. <!-- ========== METHOD SUMMARY =========== -->
  294. <ul class="blockList">
  295. <li class="blockList"><a name="method.summary">
  296. <!-- -->
  297. </a>
  298. <h3>Method Summary</h3>
  299. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  300. <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
  301. <tr>
  302. <th class="colFirst" scope="col">Modifier and Type</th>
  303. <th class="colLast" scope="col">Method and Description</th>
  304. </tr>
  305. <tr id="i0" class="altColor">
  306. <td class="colFirst"><code><a href="../../java/util/Map.Entry.html" title="interface in java.util">Map.Entry</a>&lt;<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>&gt;</code></td>
  307. <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>&nbsp;key)</code>
  308. <div class="block">Returns a key-value mapping associated with the least key
  309. greater than or equal to the given key, or <code>null</code> if
  310. there is no such key.</div>
  311. </td>
  312. </tr>
  313. <tr id="i1" class="rowColor">
  314. <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a></code></td>
  315. <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>&nbsp;key)</code>
  316. <div class="block">Returns the least key greater than or equal to the given key,
  317. or <code>null</code> if there is no such key.</div>
  318. </td>
  319. </tr>
  320. <tr id="i2" class="altColor">
  321. <td class="colFirst"><code>void</code></td>
  322. <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#clear--">clear</a></span>()</code>
  323. <div class="block">Removes all of the mappings from this map.</div>
  324. </td>
  325. </tr>
  326. <tr id="i3" class="rowColor">
  327. <td class="colFirst"><code><a href="../../java/lang/Object.html" title="class in java.lang">Object</a></code></td>
  328. <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#clone--">clone</a></span>()</code>
  329. <div class="block">Returns a shallow copy of this <code>TreeMap</code> instance.</div>
  330. </td>
  331. </tr>
  332. <tr id="i4" class="altColor">
  333. <td class="colFirst"><code><a href="../../java/util/Comparator.html" title="interface in java.util">Comparator</a>&lt;? super <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&gt;</code></td>
  334. <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#comparator--">comparator</a></span>()</code>
  335. <div class="block">Returns the comparator used to order the keys in this map, or
  336. <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>
  337. </td>
  338. </tr>
  339. <tr id="i5" class="rowColor">
  340. <td class="colFirst"><code>boolean</code></td>
  341. <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>&nbsp;key)</code>
  342. <div class="block">Returns <code>true</code> if this map contains a mapping for the specified
  343. key.</div>
  344. </td>
  345. </tr>
  346. <tr id="i6" class="altColor">
  347. <td class="colFirst"><code>boolean</code></td>
  348. <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>&nbsp;value)</code>
  349. <div class="block">Returns <code>true</code> if this map maps one or more keys to the
  350. specified value.</div>
  351. </td>
  352. </tr>
  353. <tr id="i7" class="rowColor">
  354. <td class="colFirst"><code><a href="../../java/util/NavigableSet.html" title="interface in java.util">NavigableSet</a>&lt;<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&gt;</code></td>
  355. <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#descendingKeySet--">descendingKeySet</a></span>()</code>
  356. <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>
  357. </td>
  358. </tr>
  359. <tr id="i8" class="altColor">
  360. <td class="colFirst"><code><a href="../../java/util/NavigableMap.html" title="interface in java.util">NavigableMap</a>&lt;<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>&gt;</code></td>
  361. <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#descendingMap--">descendingMap</a></span>()</code>
  362. <div class="block">Returns a reverse order view of the mappings contained in this map.</div>
  363. </td>
  364. </tr>
  365. <tr id="i9" class="rowColor">
  366. <td class="colFirst"><code><a href="../../java/util/Set.html" title="interface in java.util">Set</a>&lt;<a href="../../java/util/Map.Entry.html" title="interface in java.util">Map.Entry</a>&lt;<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>&gt;&gt;</code></td>
  367. <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#entrySet--">entrySet</a></span>()</code>
  368. <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>
  369. </td>
  370. </tr>
  371. <tr id="i10" class="altColor">
  372. <td class="colFirst"><code><a href="../../java/util/Map.Entry.html" title="interface in java.util">Map.Entry</a>&lt;<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>&gt;</code></td>
  373. <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#firstEntry--">firstEntry</a></span>()</code>
  374. <div class="block">Returns a key-value mapping associated with the least
  375. key in this map, or <code>null</code> if the map is empty.</div>
  376. </td>
  377. </tr>
  378. <tr id="i11" class="rowColor">
  379. <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a></code></td>
  380. <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#firstKey--">firstKey</a></span>()</code>
  381. <div class="block">Returns the first (lowest) key currently in this map.</div>
  382. </td>
  383. </tr>
  384. <tr id="i12" class="altColor">
  385. <td class="colFirst"><code><a href="../../java/util/Map.Entry.html" title="interface in java.util">Map.Entry</a>&lt;<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>&gt;</code></td>
  386. <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>&nbsp;key)</code>
  387. <div class="block">Returns a key-value mapping associated with the greatest key
  388. less than or equal to the given key, or <code>null</code> if there
  389. is no such key.</div>
  390. </td>
  391. </tr>
  392. <tr id="i13" class="rowColor">
  393. <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a></code></td>
  394. <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>&nbsp;key)</code>
  395. <div class="block">Returns the greatest key less than or equal to the given key,
  396. or <code>null</code> if there is no such key.</div>
  397. </td>
  398. </tr>
  399. <tr id="i14" class="altColor">
  400. <td class="colFirst"><code>void</code></td>
  401. <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>&lt;? 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>&gt;&nbsp;action)</code>
  402. <div class="block">Performs the given action for each entry in this map until all entries
  403. have been processed or the action throws an exception.</div>
  404. </td>
  405. </tr>
  406. <tr id="i15" class="rowColor">
  407. <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a></code></td>
  408. <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>&nbsp;key)</code>
  409. <div class="block">Returns the value to which the specified key is mapped,
  410. or <code>null</code> if this map contains no mapping for the key.</div>
  411. </td>
  412. </tr>
  413. <tr id="i16" class="altColor">
  414. <td class="colFirst"><code><a href="../../java/util/SortedMap.html" title="interface in java.util">SortedMap</a>&lt;<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>&gt;</code></td>
  415. <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>&nbsp;toKey)</code>
  416. <div class="block">Returns a view of the portion of this map whose keys are
  417. strictly less than <code>toKey</code>.</div>
  418. </td>
  419. </tr>
  420. <tr id="i17" class="rowColor">
  421. <td class="colFirst"><code><a href="../../java/util/NavigableMap.html" title="interface in java.util">NavigableMap</a>&lt;<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>&gt;</code></td>
  422. <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>&nbsp;toKey,
  423. boolean&nbsp;inclusive)</code>
  424. <div class="block">Returns a view of the portion of this map whose keys are less than (or
  425. equal to, if <code>inclusive</code> is true) <code>toKey</code>.</div>
  426. </td>
  427. </tr>
  428. <tr id="i18" class="altColor">
  429. <td class="colFirst"><code><a href="../../java/util/Map.Entry.html" title="interface in java.util">Map.Entry</a>&lt;<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>&gt;</code></td>
  430. <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>&nbsp;key)</code>
  431. <div class="block">Returns a key-value mapping associated with the least key
  432. strictly greater than the given key, or <code>null</code> if there
  433. is no such key.</div>
  434. </td>
  435. </tr>
  436. <tr id="i19" class="rowColor">
  437. <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a></code></td>
  438. <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>&nbsp;key)</code>
  439. <div class="block">Returns the least key strictly greater than the given key, or
  440. <code>null</code> if there is no such key.</div>
  441. </td>
  442. </tr>
  443. <tr id="i20" class="altColor">
  444. <td class="colFirst"><code><a href="../../java/util/Set.html" title="interface in java.util">Set</a>&lt;<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&gt;</code></td>
  445. <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#keySet--">keySet</a></span>()</code>
  446. <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>
  447. </td>
  448. </tr>
  449. <tr id="i21" class="rowColor">
  450. <td class="colFirst"><code><a href="../../java/util/Map.Entry.html" title="interface in java.util">Map.Entry</a>&lt;<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>&gt;</code></td>
  451. <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#lastEntry--">lastEntry</a></span>()</code>
  452. <div class="block">Returns a key-value mapping associated with the greatest
  453. key in this map, or <code>null</code> if the map is empty.</div>
  454. </td>
  455. </tr>
  456. <tr id="i22" class="altColor">
  457. <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a></code></td>
  458. <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#lastKey--">lastKey</a></span>()</code>
  459. <div class="block">Returns the last (highest) key currently in this map.</div>
  460. </td>
  461. </tr>
  462. <tr id="i23" class="rowColor">
  463. <td class="colFirst"><code><a href="../../java/util/Map.Entry.html" title="interface in java.util">Map.Entry</a>&lt;<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>&gt;</code></td>
  464. <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>&nbsp;key)</code>
  465. <div class="block">Returns a key-value mapping associated with the greatest key
  466. strictly less than the given key, or <code>null</code> if there is
  467. no such key.</div>
  468. </td>
  469. </tr>
  470. <tr id="i24" class="altColor">
  471. <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a></code></td>
  472. <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>&nbsp;key)</code>
  473. <div class="block">Returns the greatest key strictly less than the given key, or
  474. <code>null</code> if there is no such key.</div>
  475. </td>
  476. </tr>
  477. <tr id="i25" class="rowColor">
  478. <td class="colFirst"><code><a href="../../java/util/NavigableSet.html" title="interface in java.util">NavigableSet</a>&lt;<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&gt;</code></td>
  479. <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#navigableKeySet--">navigableKeySet</a></span>()</code>
  480. <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>
  481. </td>
  482. </tr>
  483. <tr id="i26" class="altColor">
  484. <td class="colFirst"><code><a href="../../java/util/Map.Entry.html" title="interface in java.util">Map.Entry</a>&lt;<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>&gt;</code></td>
  485. <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#pollFirstEntry--">pollFirstEntry</a></span>()</code>
  486. <div class="block">Removes and returns a key-value mapping associated with
  487. the least key in this map, or <code>null</code> if the map is empty.</div>
  488. </td>
  489. </tr>
  490. <tr id="i27" class="rowColor">
  491. <td class="colFirst"><code><a href="../../java/util/Map.Entry.html" title="interface in java.util">Map.Entry</a>&lt;<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>&gt;</code></td>
  492. <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#pollLastEntry--">pollLastEntry</a></span>()</code>
  493. <div class="block">Removes and returns a key-value mapping associated with
  494. the greatest key in this map, or <code>null</code> if the map is empty.</div>
  495. </td>
  496. </tr>
  497. <tr id="i28" class="altColor">
  498. <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a></code></td>
  499. <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>&nbsp;key,
  500. <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>&nbsp;value)</code>
  501. <div class="block">Associates the specified value with the specified key in this map.</div>
  502. </td>
  503. </tr>
  504. <tr id="i29" class="rowColor">
  505. <td class="colFirst"><code>void</code></td>
  506. <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>&lt;? 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>&gt;&nbsp;map)</code>
  507. <div class="block">Copies all of the mappings from the specified map to this map.</div>
  508. </td>
  509. </tr>
  510. <tr id="i30" class="altColor">
  511. <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a></code></td>
  512. <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>&nbsp;key)</code>
  513. <div class="block">Removes the mapping for this key from this TreeMap if present.</div>
  514. </td>
  515. </tr>
  516. <tr id="i31" class="rowColor">
  517. <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a></code></td>
  518. <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>&nbsp;key,
  519. <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>&nbsp;value)</code>
  520. <div class="block">Replaces the entry for the specified key only if it is
  521. currently mapped to some value.</div>
  522. </td>
  523. </tr>
  524. <tr id="i32" class="altColor">
  525. <td class="colFirst"><code>boolean</code></td>
  526. <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>&nbsp;key,
  527. <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>&nbsp;oldValue,
  528. <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>&nbsp;newValue)</code>
  529. <div class="block">Replaces the entry for the specified key only if currently
  530. mapped to the specified value.</div>
  531. </td>
  532. </tr>
  533. <tr id="i33" class="rowColor">
  534. <td class="colFirst"><code>void</code></td>
  535. <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>&lt;? 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>&gt;&nbsp;function)</code>
  536. <div class="block">Replaces each entry's value with the result of invoking the given
  537. function on that entry until all entries have been processed or the
  538. function throws an exception.</div>
  539. </td>
  540. </tr>
  541. <tr id="i34" class="altColor">
  542. <td class="colFirst"><code>int</code></td>
  543. <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#size--">size</a></span>()</code>
  544. <div class="block">Returns the number of key-value mappings in this map.</div>
  545. </td>
  546. </tr>
  547. <tr id="i35" class="rowColor">
  548. <td class="colFirst"><code><a href="../../java/util/NavigableMap.html" title="interface in java.util">NavigableMap</a>&lt;<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>&gt;</code></td>
  549. <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>&nbsp;fromKey,
  550. boolean&nbsp;fromInclusive,
  551. <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;toKey,
  552. boolean&nbsp;toInclusive)</code>
  553. <div class="block">Returns a view of the portion of this map whose keys range from
  554. <code>fromKey</code> to <code>toKey</code>.</div>
  555. </td>
  556. </tr>
  557. <tr id="i36" class="altColor">
  558. <td class="colFirst"><code><a href="../../java/util/SortedMap.html" title="interface in java.util">SortedMap</a>&lt;<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>&gt;</code></td>
  559. <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>&nbsp;fromKey,
  560. <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;toKey)</code>
  561. <div class="block">Returns a view of the portion of this map whose keys range from
  562. <code>fromKey</code>, inclusive, to <code>toKey</code>, exclusive.</div>
  563. </td>
  564. </tr>
  565. <tr id="i37" class="rowColor">
  566. <td class="colFirst"><code><a href="../../java/util/SortedMap.html" title="interface in java.util">SortedMap</a>&lt;<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>&gt;</code></td>
  567. <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>&nbsp;fromKey)</code>
  568. <div class="block">Returns a view of the portion of this map whose keys are
  569. greater than or equal to <code>fromKey</code>.</div>
  570. </td>
  571. </tr>
  572. <tr id="i38" class="altColor">
  573. <td class="colFirst"><code><a href="../../java/util/NavigableMap.html" title="interface in java.util">NavigableMap</a>&lt;<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>&gt;</code></td>
  574. <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>&nbsp;fromKey,
  575. boolean&nbsp;inclusive)</code>
  576. <div class="block">Returns a view of the portion of this map whose keys are greater than (or
  577. equal to, if <code>inclusive</code> is true) <code>fromKey</code>.</div>
  578. </td>
  579. </tr>
  580. <tr id="i39" class="rowColor">
  581. <td class="colFirst"><code><a href="../../java/util/Collection.html" title="interface in java.util">Collection</a>&lt;<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>&gt;</code></td>
  582. <td class="colLast"><code><span class="memberNameLink"><a href="../../java/util/TreeMap.html#values--">values</a></span>()</code>
  583. <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>
  584. </td>
  585. </tr>
  586. </table>
  587. <ul class="blockList">
  588. <li class="blockList"><a name="methods.inherited.from.class.java.util.AbstractMap">
  589. <!-- -->
  590. </a>
  591. <h3>Methods inherited from class&nbsp;java.util.<a href="../../java/util/AbstractMap.html" title="class in java.util">AbstractMap</a></h3>
  592. <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>
  593. </ul>
  594. <ul class="blockList">
  595. <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
  596. <!-- -->
  597. </a>
  598. <h3>Methods inherited from class&nbsp;java.lang.<a href="../../java/lang/Object.html" title="class in java.lang">Object</a></h3>
  599. <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>
  600. </ul>
  601. <ul class="blockList">
  602. <li class="blockList"><a name="methods.inherited.from.class.java.util.Map">
  603. <!-- -->
  604. </a>
  605. <h3>Methods inherited from interface&nbsp;java.util.<a href="../../java/util/Map.html" title="interface in java.util">Map</a></h3>
  606. <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>
  607. </ul>
  608. </li>
  609. </ul>
  610. </li>
  611. </ul>
  612. </div>
  613. <div class="details">
  614. <ul class="blockList">
  615. <li class="blockList">
  616. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  617. <ul class="blockList">
  618. <li class="blockList"><a name="constructor.detail">
  619. <!-- -->
  620. </a>
  621. <h3>Constructor Detail</h3>
  622. <a name="TreeMap--">
  623. <!-- -->
  624. </a>
  625. <ul class="blockList">
  626. <li class="blockList">
  627. <h4>TreeMap</h4>
  628. <pre>public&nbsp;TreeMap()</pre>
  629. <div class="block">Constructs a new, empty tree map, using the natural ordering of its
  630. 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
  631. <em>mutually comparable</em>: <code>k1.compareTo(k2)</code> must not throw
  632. a <code>ClassCastException</code> for any keys <code>k1</code> and
  633. <code>k2</code> in the map. If the user attempts to put a key into the
  634. map that violates this constraint (for example, the user attempts to
  635. put a string key into a map whose keys are integers), the
  636. <code>put(Object key, Object value)</code> call will throw a
  637. <code>ClassCastException</code>.</div>
  638. </li>
  639. </ul>
  640. <a name="TreeMap-java.util.Comparator-">
  641. <!-- -->
  642. </a>
  643. <ul class="blockList">
  644. <li class="blockList">
  645. <h4>TreeMap</h4>
  646. <pre>public&nbsp;TreeMap(<a href="../../java/util/Comparator.html" title="interface in java.util">Comparator</a>&lt;? super <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&gt;&nbsp;comparator)</pre>
  647. <div class="block">Constructs a new, empty tree map, ordered according to the given
  648. comparator. All keys inserted into the map must be <em>mutually
  649. comparable</em> by the given comparator: <code>comparator.compare(k1,
  650. k2)</code> must not throw a <code>ClassCastException</code> for any keys
  651. <code>k1</code> and <code>k2</code> in the map. If the user attempts to put
  652. a key into the map that violates this constraint, the <code>put(Object
  653. key, Object value)</code> call will throw a
  654. <code>ClassCastException</code>.</div>
  655. <dl>
  656. <dt><span class="paramLabel">Parameters:</span></dt>
  657. <dd><code>comparator</code> - the comparator that will be used to order this map.
  658. If <code>null</code>, the <a href="../../java/lang/Comparable.html" title="interface in java.lang">natural
  659. ordering</a> of the keys will be used.</dd>
  660. </dl>
  661. </li>
  662. </ul>
  663. <a name="TreeMap-java.util.Map-">
  664. <!-- -->
  665. </a>
  666. <ul class="blockList">
  667. <li class="blockList">
  668. <h4>TreeMap</h4>
  669. <pre>public&nbsp;TreeMap(<a href="../../java/util/Map.html" title="interface in java.util">Map</a>&lt;? 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>&gt;&nbsp;m)</pre>
  670. <div class="block">Constructs a new tree map containing the same mappings as the given
  671. map, ordered according to the <em>natural ordering</em> of its keys.
  672. 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
  673. <em>mutually comparable</em>: <code>k1.compareTo(k2)</code> must not throw
  674. a <code>ClassCastException</code> for any keys <code>k1</code> and
  675. <code>k2</code> in the map. This method runs in n*log(n) time.</div>
  676. <dl>
  677. <dt><span class="paramLabel">Parameters:</span></dt>
  678. <dd><code>m</code> - the map whose mappings are to be placed in this map</dd>
  679. <dt><span class="throwsLabel">Throws:</span></dt>
  680. <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>,
  681. or are not mutually comparable</dd>
  682. <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified map is null</dd>
  683. </dl>
  684. </li>
  685. </ul>
  686. <a name="TreeMap-java.util.SortedMap-">
  687. <!-- -->
  688. </a>
  689. <ul class="blockListLast">
  690. <li class="blockList">
  691. <h4>TreeMap</h4>
  692. <pre>public&nbsp;TreeMap(<a href="../../java/util/SortedMap.html" title="interface in java.util">SortedMap</a>&lt;<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>&gt;&nbsp;m)</pre>
  693. <div class="block">Constructs a new tree map containing the same mappings and
  694. using the same ordering as the specified sorted map. This
  695. method runs in linear time.</div>
  696. <dl>
  697. <dt><span class="paramLabel">Parameters:</span></dt>
  698. <dd><code>m</code> - the sorted map whose mappings are to be placed in this map,
  699. and whose comparator is to be used to sort this map</dd>
  700. <dt><span class="throwsLabel">Throws:</span></dt>
  701. <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified map is null</dd>
  702. </dl>
  703. </li>
  704. </ul>
  705. </li>
  706. </ul>
  707. <!-- ============ METHOD DETAIL ========== -->
  708. <ul class="blockList">
  709. <li class="blockList"><a name="method.detail">
  710. <!-- -->
  711. </a>
  712. <h3>Method Detail</h3>
  713. <a name="size--">
  714. <!-- -->
  715. </a>
  716. <ul class="blockList">
  717. <li class="blockList">
  718. <h4>size</h4>
  719. <pre>public&nbsp;int&nbsp;size()</pre>
  720. <div class="block">Returns the number of key-value mappings in this map.</div>
  721. <dl>
  722. <dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
  723. <dd><code><a href="../../java/util/Map.html#size--">size</a></code>&nbsp;in interface&nbsp;<code><a href="../../java/util/Map.html" title="interface in java.util">Map</a>&lt;<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>&gt;</code></dd>
  724. <dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
  725. <dd><code><a href="../../java/util/AbstractMap.html#size--">size</a></code>&nbsp;in class&nbsp;<code><a href="../../java/util/AbstractMap.html" title="class in java.util">AbstractMap</a>&lt;<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>&gt;</code></dd>
  726. <dt><span class="returnLabel">Returns:</span></dt>
  727. <dd>the number of key-value mappings in this map</dd>
  728. </dl>
  729. </li>
  730. </ul>
  731. <a name="containsKey-java.lang.Object-">
  732. <!-- -->
  733. </a>
  734. <ul class="blockList">
  735. <li class="blockList">
  736. <h4>containsKey</h4>
  737. <pre>public&nbsp;boolean&nbsp;containsKey(<a href="../../java/lang/Object.html" title="class in java.lang">Object</a>&nbsp;key)</pre>
  738. <div class="block">Returns <code>true</code> if this map contains a mapping for the specified
  739. key.</div>
  740. <dl>
  741. <dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
  742. <dd><code><a href="../../java/util/Map.html#containsKey-java.lang.Object-">containsKey</a></code>&nbsp;in interface&nbsp;<code><a href="../../java/util/Map.html" title="interface in java.util">Map</a>&lt;<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