PageRenderTime 36ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/jdk-7u76-docs-all/docs/api/java/util/TreeMap.html

https://gitlab.com/PNNutkung/Java-API
HTML | 1713 lines | 1591 code | 19 blank | 103 comment | 0 complexity | 3fe722f2ee217972186416b5c7f86534 MD5 | raw 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 (version 1.6.0_18) on Thu Dec 18 17:17:19 PST 2014 -->
  6. <title>TreeMap (Java Platform SE 7 )</title>
  7. <meta name="date" content="2014-12-18">
  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. <link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
  43. </head>
  44. <body>
  45. <script type="text/javascript"><!--
  46. if (location.href.indexOf('is-external=true') == -1) {
  47. parent.document.title="TreeMap (Java Platform SE 7 )";
  48. }
  49. //-->
  50. </script>
  51. <noscript>
  52. <div>JavaScript is disabled on your browser.</div>
  53. </noscript>
  54. <!-- ========= START OF TOP NAVBAR ======= -->
  55. <div class="topNav"><a name="navbar_top">
  56. <!-- -->
  57. </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
  58. <!-- -->
  59. </a>
  60. <ul class="navList" title="Navigation">
  61. <li><a href="../../overview-summary.html">Overview</a></li>
  62. <li><a href="package-summary.html">Package</a></li>
  63. <li class="navBarCell1Rev">Class</li>
  64. <li><a href="class-use/TreeMap.html">Use</a></li>
  65. <li><a href="package-tree.html">Tree</a></li>
  66. <li><a href="../../deprecated-list.html">Deprecated</a></li>
  67. <li><a href="../../index-files/index-1.html">Index</a></li>
  68. <li><a href="../../help-doc.html">Help</a></li>
  69. </ul>
  70. <div class="aboutLanguage"><em><strong>Java&trade;&nbsp;Platform<br>Standard&nbsp;Ed.&nbsp;7</strong></em></div>
  71. </div>
  72. <div class="subNav">
  73. <ul class="navList">
  74. <li><a href="../../java/util/TooManyListenersException.html" title="class in java.util"><span class="strong">Prev Class</span></a></li>
  75. <li><a href="../../java/util/TreeSet.html" title="class in java.util"><span class="strong">Next Class</span></a></li>
  76. </ul>
  77. <ul class="navList">
  78. <li><a href="../../index.html?java/util/TreeMap.html" target="_top">Frames</a></li>
  79. <li><a href="TreeMap.html" target="_top">No Frames</a></li>
  80. </ul>
  81. <ul class="navList" id="allclasses_navbar_top">
  82. <li><a href="../../allclasses-noframe.html">All Classes</a></li>
  83. </ul>
  84. <div>
  85. <script type="text/javascript"><!--
  86. allClassesLink = document.getElementById("allclasses_navbar_top");
  87. if(window==top) {
  88. allClassesLink.style.display = "block";
  89. }
  90. else {
  91. allClassesLink.style.display = "none";
  92. }
  93. //-->
  94. </script>
  95. </div>
  96. <div>
  97. <ul class="subNavList">
  98. <li>Summary:&nbsp;</li>
  99. <li><a href="#nested_classes_inherited_from_class_java.util.AbstractMap">Nested</a>&nbsp;|&nbsp;</li>
  100. <li>Field&nbsp;|&nbsp;</li>
  101. <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
  102. <li><a href="#method_summary">Method</a></li>
  103. </ul>
  104. <ul class="subNavList">
  105. <li>Detail:&nbsp;</li>
  106. <li>Field&nbsp;|&nbsp;</li>
  107. <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
  108. <li><a href="#method_detail">Method</a></li>
  109. </ul>
  110. </div>
  111. <a name="skip-navbar_top">
  112. <!-- -->
  113. </a></div>
  114. <!-- ========= END OF TOP NAVBAR ========= -->
  115. <!-- ======== START OF CLASS DATA ======== -->
  116. <div class="header">
  117. <div class="subTitle">java.util</div>
  118. <h2 title="Class TreeMap" class="title">Class TreeMap&lt;K,V&gt;</h2>
  119. </div>
  120. <div class="contentContainer">
  121. <ul class="inheritance">
  122. <li><a href="../../java/lang/Object.html" title="class in java.lang">java.lang.Object</a></li>
  123. <li>
  124. <ul class="inheritance">
  125. <li><a href="../../java/util/AbstractMap.html" title="class in java.util">java.util.AbstractMap</a>&lt;K,V&gt;</li>
  126. <li>
  127. <ul class="inheritance">
  128. <li>java.util.TreeMap&lt;K,V&gt;</li>
  129. </ul>
  130. </li>
  131. </ul>
  132. </li>
  133. </ul>
  134. <div class="description">
  135. <ul class="blockList">
  136. <li class="blockList">
  137. <dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>K</code> - the type of keys maintained by this map</dd><dd><code>V</code> - the type of mapped values</dd></dl>
  138. <dl>
  139. <dt>All Implemented Interfaces:</dt>
  140. <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>
  141. </dl>
  142. <hr>
  143. <br>
  144. <pre>public class <span class="strong">TreeMap&lt;K,V&gt;</span>
  145. extends <a href="../../java/util/AbstractMap.html" title="class in java.util">AbstractMap</a>&lt;K,V&gt;
  146. 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>
  147. <div class="block">A Red-Black tree based <a href="../../java/util/NavigableMap.html" title="interface in java.util"><code>NavigableMap</code></a> implementation.
  148. The map is sorted according to the <a href="../../java/lang/Comparable.html" title="interface in java.lang">natural
  149. 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
  150. creation time, depending on which constructor is used.
  151. <p>This implementation provides guaranteed log(n) time cost for the
  152. <code>containsKey</code>, <code>get</code>, <code>put</code> and <code>remove</code>
  153. operations. Algorithms are adaptations of those in Cormen, Leiserson, and
  154. Rivest's <em>Introduction to Algorithms</em>.
  155. <p>Note that the ordering maintained by a tree map, like any sorted map, and
  156. whether or not an explicit comparator is provided, must be <em>consistent
  157. with <code>equals</code></em> if this sorted map is to correctly implement the
  158. <code>Map</code> interface. (See <code>Comparable</code> or <code>Comparator</code> for a
  159. precise definition of <em>consistent with equals</em>.) This is so because
  160. the <code>Map</code> interface is defined in terms of the <code>equals</code>
  161. 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
  162. this method are, from the standpoint of the sorted map, equal. The behavior
  163. of a sorted map <em>is</em> well-defined even if its ordering is
  164. inconsistent with <code>equals</code>; it just fails to obey the general contract
  165. of the <code>Map</code> interface.
  166. <p><strong>Note that this implementation is not synchronized.</strong>
  167. If multiple threads access a map concurrently, and at least one of the
  168. threads modifies the map structurally, it <em>must</em> be synchronized
  169. externally. (A structural modification is any operation that adds or
  170. deletes one or more mappings; merely changing the value associated
  171. with an existing key is not a structural modification.) This is
  172. typically accomplished by synchronizing on some object that naturally
  173. encapsulates the map.
  174. If no such object exists, the map should be "wrapped" using the
  175. <a href="../../java/util/Collections.html#synchronizedSortedMap(java.util.SortedMap)"><code>Collections.synchronizedSortedMap</code></a>
  176. method. This is best done at creation time, to prevent accidental
  177. unsynchronized access to the map: <pre>
  178. SortedMap m = Collections.synchronizedSortedMap(new TreeMap(...));</pre>
  179. <p>The iterators returned by the <code>iterator</code> method of the collections
  180. returned by all of this class's "collection view methods" are
  181. <em>fail-fast</em>: if the map is structurally modified at any time after
  182. the iterator is created, in any way except through the iterator's own
  183. <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
  184. modification, the iterator fails quickly and cleanly, rather than risking
  185. arbitrary, non-deterministic behavior at an undetermined time in the future.
  186. <p>Note that the fail-fast behavior of an iterator cannot be guaranteed
  187. as it is, generally speaking, impossible to make any hard guarantees in the
  188. presence of unsynchronized concurrent modification. Fail-fast iterators
  189. throw <code>ConcurrentModificationException</code> on a best-effort basis.
  190. Therefore, it would be wrong to write a program that depended on this
  191. exception for its correctness: <em>the fail-fast behavior of iterators
  192. should be used only to detect bugs.</em>
  193. <p>All <code>Map.Entry</code> pairs returned by methods in this class
  194. and its views represent snapshots of mappings at the time they were
  195. produced. They do <strong>not</strong> support the <code>Entry.setValue</code>
  196. method. (Note however that it is possible to change mappings in the
  197. associated map using <code>put</code>.)
  198. <p>This class is a member of the
  199. <a href="../../../technotes/guides/collections/index.html">
  200. Java Collections Framework</a>.</div>
  201. <dl><dt><span class="strong">Since:</span></dt>
  202. <dd>1.2</dd>
  203. <dt><span class="strong">See Also:</span></dt><dd><a href="../../java/util/Map.html" title="interface in java.util"><code>Map</code></a>,
  204. <a href="../../java/util/HashMap.html" title="class in java.util"><code>HashMap</code></a>,
  205. <a href="../../java/util/Hashtable.html" title="class in java.util"><code>Hashtable</code></a>,
  206. <a href="../../java/lang/Comparable.html" title="interface in java.lang"><code>Comparable</code></a>,
  207. <a href="../../java/util/Comparator.html" title="interface in java.util"><code>Comparator</code></a>,
  208. <a href="../../java/util/Collection.html" title="interface in java.util"><code>Collection</code></a>,
  209. <a href="../../serialized-form.html#java.util.TreeMap">Serialized Form</a></dd></dl>
  210. </li>
  211. </ul>
  212. </div>
  213. <div class="summary">
  214. <ul class="blockList">
  215. <li class="blockList">
  216. <!-- ======== NESTED CLASS SUMMARY ======== -->
  217. <ul class="blockList">
  218. <li class="blockList"><a name="nested_class_summary">
  219. <!-- -->
  220. </a>
  221. <h3>Nested Class Summary</h3>
  222. <ul class="blockList">
  223. <li class="blockList"><a name="nested_classes_inherited_from_class_java.util.AbstractMap">
  224. <!-- -->
  225. </a>
  226. <h3>Nested classes/interfaces inherited from class&nbsp;java.util.<a href="../../java/util/AbstractMap.html" title="class in java.util">AbstractMap</a></h3>
  227. <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>
  228. </ul>
  229. </li>
  230. </ul>
  231. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  232. <ul class="blockList">
  233. <li class="blockList"><a name="constructor_summary">
  234. <!-- -->
  235. </a>
  236. <h3>Constructor Summary</h3>
  237. <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
  238. <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
  239. <tr>
  240. <th class="colOne" scope="col">Constructor and Description</th>
  241. </tr>
  242. <tr class="altColor">
  243. <td class="colOne"><code><strong><a href="../../java/util/TreeMap.html#TreeMap()">TreeMap</a></strong>()</code>
  244. <div class="block">Constructs a new, empty tree map, using the natural ordering of its
  245. keys.</div>
  246. </td>
  247. </tr>
  248. <tr class="rowColor">
  249. <td class="colOne"><code><strong><a href="../../java/util/TreeMap.html#TreeMap(java.util.Comparator)">TreeMap</a></strong>(<a href="../../java/util/Comparator.html" title="interface in java.util">Comparator</a>&lt;? super <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&gt;&nbsp;comparator)</code>
  250. <div class="block">Constructs a new, empty tree map, ordered according to the given
  251. comparator.</div>
  252. </td>
  253. </tr>
  254. <tr class="altColor">
  255. <td class="colOne"><code><strong><a href="../../java/util/TreeMap.html#TreeMap(java.util.Map)">TreeMap</a></strong>(<a href="../../java/util/Map.html" title="interface in java.util">Map</a>&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>
  256. <div class="block">Constructs a new tree map containing the same mappings as the given
  257. map, ordered according to the <em>natural ordering</em> of its keys.</div>
  258. </td>
  259. </tr>
  260. <tr class="rowColor">
  261. <td class="colOne"><code><strong><a href="../../java/util/TreeMap.html#TreeMap(java.util.SortedMap)">TreeMap</a></strong>(<a href="../../java/util/SortedMap.html" title="interface in java.util">SortedMap</a>&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>
  262. <div class="block">Constructs a new tree map containing the same mappings and
  263. using the same ordering as the specified sorted map.</div>
  264. </td>
  265. </tr>
  266. </table>
  267. </li>
  268. </ul>
  269. <!-- ========== METHOD SUMMARY =========== -->
  270. <ul class="blockList">
  271. <li class="blockList"><a name="method_summary">
  272. <!-- -->
  273. </a>
  274. <h3>Method Summary</h3>
  275. <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  276. <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
  277. <tr>
  278. <th class="colFirst" scope="col">Modifier and Type</th>
  279. <th class="colLast" scope="col">Method and Description</th>
  280. </tr>
  281. <tr class="altColor">
  282. <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>
  283. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#ceilingEntry(K)">ceilingEntry</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;key)</code>
  284. <div class="block">Returns a key-value mapping associated with the least key
  285. greater than or equal to the given key, or <code>null</code> if
  286. there is no such key.</div>
  287. </td>
  288. </tr>
  289. <tr class="rowColor">
  290. <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a></code></td>
  291. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#ceilingKey(K)">ceilingKey</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;key)</code>
  292. <div class="block">Returns the least key greater than or equal to the given key,
  293. or <code>null</code> if there is no such key.</div>
  294. </td>
  295. </tr>
  296. <tr class="altColor">
  297. <td class="colFirst"><code>void</code></td>
  298. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#clear()">clear</a></strong>()</code>
  299. <div class="block">Removes all of the mappings from this map.</div>
  300. </td>
  301. </tr>
  302. <tr class="rowColor">
  303. <td class="colFirst"><code><a href="../../java/lang/Object.html" title="class in java.lang">Object</a></code></td>
  304. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#clone()">clone</a></strong>()</code>
  305. <div class="block">Returns a shallow copy of this <code>TreeMap</code> instance.</div>
  306. </td>
  307. </tr>
  308. <tr class="altColor">
  309. <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>
  310. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#comparator()">comparator</a></strong>()</code>
  311. <div class="block">Returns the comparator used to order the keys in this map, or
  312. <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>
  313. </td>
  314. </tr>
  315. <tr class="rowColor">
  316. <td class="colFirst"><code>boolean</code></td>
  317. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#containsKey(java.lang.Object)">containsKey</a></strong>(<a href="../../java/lang/Object.html" title="class in java.lang">Object</a>&nbsp;key)</code>
  318. <div class="block">Returns <code>true</code> if this map contains a mapping for the specified
  319. key.</div>
  320. </td>
  321. </tr>
  322. <tr class="altColor">
  323. <td class="colFirst"><code>boolean</code></td>
  324. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#containsValue(java.lang.Object)">containsValue</a></strong>(<a href="../../java/lang/Object.html" title="class in java.lang">Object</a>&nbsp;value)</code>
  325. <div class="block">Returns <code>true</code> if this map maps one or more keys to the
  326. specified value.</div>
  327. </td>
  328. </tr>
  329. <tr class="rowColor">
  330. <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>
  331. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#descendingKeySet()">descendingKeySet</a></strong>()</code>
  332. <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>
  333. </td>
  334. </tr>
  335. <tr class="altColor">
  336. <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>
  337. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#descendingMap()">descendingMap</a></strong>()</code>
  338. <div class="block">Returns a reverse order view of the mappings contained in this map.</div>
  339. </td>
  340. </tr>
  341. <tr class="rowColor">
  342. <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>
  343. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#entrySet()">entrySet</a></strong>()</code>
  344. <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>
  345. </td>
  346. </tr>
  347. <tr class="altColor">
  348. <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>
  349. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#firstEntry()">firstEntry</a></strong>()</code>
  350. <div class="block">Returns a key-value mapping associated with the least
  351. key in this map, or <code>null</code> if the map is empty.</div>
  352. </td>
  353. </tr>
  354. <tr class="rowColor">
  355. <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a></code></td>
  356. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#firstKey()">firstKey</a></strong>()</code>
  357. <div class="block">Returns the first (lowest) key currently in this map.</div>
  358. </td>
  359. </tr>
  360. <tr class="altColor">
  361. <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>
  362. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#floorEntry(K)">floorEntry</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;key)</code>
  363. <div class="block">Returns a key-value mapping associated with the greatest key
  364. less than or equal to the given key, or <code>null</code> if there
  365. is no such key.</div>
  366. </td>
  367. </tr>
  368. <tr class="rowColor">
  369. <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a></code></td>
  370. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#floorKey(K)">floorKey</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;key)</code>
  371. <div class="block">Returns the greatest key less than or equal to the given key,
  372. or <code>null</code> if there is no such key.</div>
  373. </td>
  374. </tr>
  375. <tr class="altColor">
  376. <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a></code></td>
  377. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#get(java.lang.Object)">get</a></strong>(<a href="../../java/lang/Object.html" title="class in java.lang">Object</a>&nbsp;key)</code>
  378. <div class="block">Returns the value to which the specified key is mapped,
  379. or <code>null</code> if this map contains no mapping for the key.</div>
  380. </td>
  381. </tr>
  382. <tr class="rowColor">
  383. <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>
  384. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#headMap(K)">headMap</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;toKey)</code>
  385. <div class="block">Returns a view of the portion of this map whose keys are
  386. strictly less than <code>toKey</code>.</div>
  387. </td>
  388. </tr>
  389. <tr class="altColor">
  390. <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>
  391. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#headMap(K,%20boolean)">headMap</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;toKey,
  392. boolean&nbsp;inclusive)</code>
  393. <div class="block">Returns a view of the portion of this map whose keys are less than (or
  394. equal to, if <code>inclusive</code> is true) <code>toKey</code>.</div>
  395. </td>
  396. </tr>
  397. <tr class="rowColor">
  398. <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>
  399. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#higherEntry(K)">higherEntry</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;key)</code>
  400. <div class="block">Returns a key-value mapping associated with the least key
  401. strictly greater than the given key, or <code>null</code> if there
  402. is no such key.</div>
  403. </td>
  404. </tr>
  405. <tr class="altColor">
  406. <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a></code></td>
  407. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#higherKey(K)">higherKey</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;key)</code>
  408. <div class="block">Returns the least key strictly greater than the given key, or
  409. <code>null</code> if there is no such key.</div>
  410. </td>
  411. </tr>
  412. <tr class="rowColor">
  413. <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>
  414. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#keySet()">keySet</a></strong>()</code>
  415. <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>
  416. </td>
  417. </tr>
  418. <tr class="altColor">
  419. <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>
  420. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#lastEntry()">lastEntry</a></strong>()</code>
  421. <div class="block">Returns a key-value mapping associated with the greatest
  422. key in this map, or <code>null</code> if the map is empty.</div>
  423. </td>
  424. </tr>
  425. <tr class="rowColor">
  426. <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a></code></td>
  427. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#lastKey()">lastKey</a></strong>()</code>
  428. <div class="block">Returns the last (highest) key currently in this map.</div>
  429. </td>
  430. </tr>
  431. <tr class="altColor">
  432. <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>
  433. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#lowerEntry(K)">lowerEntry</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;key)</code>
  434. <div class="block">Returns a key-value mapping associated with the greatest key
  435. strictly less than the given key, or <code>null</code> if there is
  436. no such key.</div>
  437. </td>
  438. </tr>
  439. <tr class="rowColor">
  440. <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a></code></td>
  441. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#lowerKey(K)">lowerKey</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;key)</code>
  442. <div class="block">Returns the greatest key strictly less than the given key, or
  443. <code>null</code> if there is no such key.</div>
  444. </td>
  445. </tr>
  446. <tr class="altColor">
  447. <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>
  448. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#navigableKeySet()">navigableKeySet</a></strong>()</code>
  449. <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>
  450. </td>
  451. </tr>
  452. <tr class="rowColor">
  453. <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>
  454. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#pollFirstEntry()">pollFirstEntry</a></strong>()</code>
  455. <div class="block">Removes and returns a key-value mapping associated with
  456. the least key in this map, or <code>null</code> if the map is empty.</div>
  457. </td>
  458. </tr>
  459. <tr class="altColor">
  460. <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>
  461. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#pollLastEntry()">pollLastEntry</a></strong>()</code>
  462. <div class="block">Removes and returns a key-value mapping associated with
  463. the greatest key in this map, or <code>null</code> if the map is empty.</div>
  464. </td>
  465. </tr>
  466. <tr class="rowColor">
  467. <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a></code></td>
  468. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#put(K,%20V)">put</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;key,
  469. <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>&nbsp;value)</code>
  470. <div class="block">Associates the specified value with the specified key in this map.</div>
  471. </td>
  472. </tr>
  473. <tr class="altColor">
  474. <td class="colFirst"><code>void</code></td>
  475. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#putAll(java.util.Map)">putAll</a></strong>(<a href="../../java/util/Map.html" title="interface in java.util">Map</a>&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>
  476. <div class="block">Copies all of the mappings from the specified map to this map.</div>
  477. </td>
  478. </tr>
  479. <tr class="rowColor">
  480. <td class="colFirst"><code><a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a></code></td>
  481. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#remove(java.lang.Object)">remove</a></strong>(<a href="../../java/lang/Object.html" title="class in java.lang">Object</a>&nbsp;key)</code>
  482. <div class="block">Removes the mapping for this key from this TreeMap if present.</div>
  483. </td>
  484. </tr>
  485. <tr class="altColor">
  486. <td class="colFirst"><code>int</code></td>
  487. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#size()">size</a></strong>()</code>
  488. <div class="block">Returns the number of key-value mappings in this map.</div>
  489. </td>
  490. </tr>
  491. <tr class="rowColor">
  492. <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>
  493. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#subMap(K,%20boolean,%20K,%20boolean)">subMap</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;fromKey,
  494. boolean&nbsp;fromInclusive,
  495. <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;toKey,
  496. boolean&nbsp;toInclusive)</code>
  497. <div class="block">Returns a view of the portion of this map whose keys range from
  498. <code>fromKey</code> to <code>toKey</code>.</div>
  499. </td>
  500. </tr>
  501. <tr class="altColor">
  502. <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>
  503. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#subMap(K,%20K)">subMap</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;fromKey,
  504. <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;toKey)</code>
  505. <div class="block">Returns a view of the portion of this map whose keys range from
  506. <code>fromKey</code>, inclusive, to <code>toKey</code>, exclusive.</div>
  507. </td>
  508. </tr>
  509. <tr class="rowColor">
  510. <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>
  511. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#tailMap(K)">tailMap</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;fromKey)</code>
  512. <div class="block">Returns a view of the portion of this map whose keys are
  513. greater than or equal to <code>fromKey</code>.</div>
  514. </td>
  515. </tr>
  516. <tr class="altColor">
  517. <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>
  518. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#tailMap(K,%20boolean)">tailMap</a></strong>(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;fromKey,
  519. boolean&nbsp;inclusive)</code>
  520. <div class="block">Returns a view of the portion of this map whose keys are greater than (or
  521. equal to, if <code>inclusive</code> is true) <code>fromKey</code>.</div>
  522. </td>
  523. </tr>
  524. <tr class="rowColor">
  525. <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>
  526. <td class="colLast"><code><strong><a href="../../java/util/TreeMap.html#values()">values</a></strong>()</code>
  527. <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>
  528. </td>
  529. </tr>
  530. </table>
  531. <ul class="blockList">
  532. <li class="blockList"><a name="methods_inherited_from_class_java.util.AbstractMap">
  533. <!-- -->
  534. </a>
  535. <h3>Methods inherited from class&nbsp;java.util.<a href="../../java/util/AbstractMap.html" title="class in java.util">AbstractMap</a></h3>
  536. <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>
  537. </ul>
  538. <ul class="blockList">
  539. <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
  540. <!-- -->
  541. </a>
  542. <h3>Methods inherited from class&nbsp;java.lang.<a href="../../java/lang/Object.html" title="class in java.lang">Object</a></h3>
  543. <code><a href="../../java/lang/Object.html#finalize()">finalize</a>, <a href="../../java/lang/Object.html#getClass()">getClass</a>, <a href="../../java/lang/Object.html#notify()">notify</a>, <a href="../../java/lang/Object.html#notifyAll()">notifyAll</a>, <a href="../../java/lang/Object.html#wait()">wait</a>, <a href="../../java/lang/Object.html#wait(long)">wait</a>, <a href="../../java/lang/Object.html#wait(long,%20int)">wait</a></code></li>
  544. </ul>
  545. <ul class="blockList">
  546. <li class="blockList"><a name="methods_inherited_from_class_java.util.Map">
  547. <!-- -->
  548. </a>
  549. <h3>Methods inherited from interface&nbsp;java.util.<a href="../../java/util/Map.html" title="interface in java.util">Map</a></h3>
  550. <code><a href="../../java/util/Map.html#equals(java.lang.Object)">equals</a>, <a href="../../java/util/Map.html#hashCode()">hashCode</a>, <a href="../../java/util/Map.html#isEmpty()">isEmpty</a></code></li>
  551. </ul>
  552. </li>
  553. </ul>
  554. </li>
  555. </ul>
  556. </div>
  557. <div class="details">
  558. <ul class="blockList">
  559. <li class="blockList">
  560. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  561. <ul class="blockList">
  562. <li class="blockList"><a name="constructor_detail">
  563. <!-- -->
  564. </a>
  565. <h3>Constructor Detail</h3>
  566. <a name="TreeMap()">
  567. <!-- -->
  568. </a>
  569. <ul class="blockList">
  570. <li class="blockList">
  571. <h4>TreeMap</h4>
  572. <pre>public&nbsp;TreeMap()</pre>
  573. <div class="block">Constructs a new, empty tree map, using the natural ordering of its
  574. 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
  575. <em>mutually comparable</em>: <code>k1.compareTo(k2)</code> must not throw
  576. a <code>ClassCastException</code> for any keys <code>k1</code> and
  577. <code>k2</code> in the map. If the user attempts to put a key into the
  578. map that violates this constraint (for example, the user attempts to
  579. put a string key into a map whose keys are integers), the
  580. <code>put(Object key, Object value)</code> call will throw a
  581. <code>ClassCastException</code>.</div>
  582. </li>
  583. </ul>
  584. <a name="TreeMap(java.util.Comparator)">
  585. <!-- -->
  586. </a>
  587. <ul class="blockList">
  588. <li class="blockList">
  589. <h4>TreeMap</h4>
  590. <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>
  591. <div class="block">Constructs a new, empty tree map, ordered according to the given
  592. comparator. All keys inserted into the map must be <em>mutually
  593. comparable</em> by the given comparator: <code>comparator.compare(k1,
  594. k2)</code> must not throw a <code>ClassCastException</code> for any keys
  595. <code>k1</code> and <code>k2</code> in the map. If the user attempts to put
  596. a key into the map that violates this constraint, the <code>put(Object
  597. key, Object value)</code> call will throw a
  598. <code>ClassCastException</code>.</div>
  599. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>comparator</code> - the comparator that will be used to order this map.
  600. If <code>null</code>, the <a href="../../java/lang/Comparable.html" title="interface in java.lang">natural
  601. ordering</a> of the keys will be used.</dd></dl>
  602. </li>
  603. </ul>
  604. <a name="TreeMap(java.util.Map)">
  605. <!-- -->
  606. </a>
  607. <ul class="blockList">
  608. <li class="blockList">
  609. <h4>TreeMap</h4>
  610. <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>
  611. <div class="block">Constructs a new tree map containing the same mappings as the given
  612. map, ordered according to the <em>natural ordering</em> of its keys.
  613. 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
  614. <em>mutually comparable</em>: <code>k1.compareTo(k2)</code> must not throw
  615. a <code>ClassCastException</code> for any keys <code>k1</code> and
  616. <code>k2</code> in the map. This method runs in n*log(n) time.</div>
  617. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>m</code> - the map whose mappings are to be placed in this map</dd>
  618. <dt><span class="strong">Throws:</span></dt>
  619. <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>,
  620. or are not mutually comparable</dd>
  621. <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified map is null</dd></dl>
  622. </li>
  623. </ul>
  624. <a name="TreeMap(java.util.SortedMap)">
  625. <!-- -->
  626. </a>
  627. <ul class="blockListLast">
  628. <li class="blockList">
  629. <h4>TreeMap</h4>
  630. <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>
  631. <div class="block">Constructs a new tree map containing the same mappings and
  632. using the same ordering as the specified sorted map. This
  633. method runs in linear time.</div>
  634. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>m</code> - the sorted map whose mappings are to be placed in this map,
  635. and whose comparator is to be used to sort this map</dd>
  636. <dt><span class="strong">Throws:</span></dt>
  637. <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified map is null</dd></dl>
  638. </li>
  639. </ul>
  640. </li>
  641. </ul>
  642. <!-- ============ METHOD DETAIL ========== -->
  643. <ul class="blockList">
  644. <li class="blockList"><a name="method_detail">
  645. <!-- -->
  646. </a>
  647. <h3>Method Detail</h3>
  648. <a name="size()">
  649. <!-- -->
  650. </a>
  651. <ul class="blockList">
  652. <li class="blockList">
  653. <h4>size</h4>
  654. <pre>public&nbsp;int&nbsp;size()</pre>
  655. <div class="block">Returns the number of key-value mappings in this map.</div>
  656. <dl>
  657. <dt><strong>Specified by:</strong></dt>
  658. <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>
  659. <dt><strong>Overrides:</strong></dt>
  660. <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>
  661. <dt><span class="strong">Returns:</span></dt><dd>the number of key-value mappings in this map</dd></dl>
  662. </li>
  663. </ul>
  664. <a name="containsKey(java.lang.Object)">
  665. <!-- -->
  666. </a>
  667. <ul class="blockList">
  668. <li class="blockList">
  669. <h4>containsKey</h4>
  670. <pre>public&nbsp;boolean&nbsp;containsKey(<a href="../../java/lang/Object.html" title="class in java.lang">Object</a>&nbsp;key)</pre>
  671. <div class="block">Returns <code>true</code> if this map contains a mapping for the specified
  672. key.</div>
  673. <dl>
  674. <dt><strong>Specified by:</strong></dt>
  675. <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="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>&gt;</code></dd>
  676. <dt><strong>Overrides:</strong></dt>
  677. <dd><code><a href="../../java/util/AbstractMap.html#containsKey(java.lang.Object)">containsKey</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>
  678. <dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - key whose presence in this map is to be tested</dd>
  679. <dt><span class="strong">Returns:</span></dt><dd><code>true</code> if this map contains a mapping for the
  680. specified key</dd>
  681. <dt><span class="strong">Throws:</span></dt>
  682. <dd><code><a href="../../java/lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> - if the specified key cannot be compared
  683. with the keys currently in the map</dd>
  684. <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified key is null
  685. and this map uses natural ordering, or its comparator
  686. does not permit null keys</dd></dl>
  687. </li>
  688. </ul>
  689. <a name="containsValue(java.lang.Object)">
  690. <!-- -->
  691. </a>
  692. <ul class="blockList">
  693. <li class="blockList">
  694. <h4>containsValue</h4>
  695. <pre>public&nbsp;boolean&nbsp;containsValue(<a href="../../java/lang/Object.html" title="class in java.lang">Object</a>&nbsp;value)</pre>
  696. <div class="block">Returns <code>true</code> if this map maps one or more keys to the
  697. specified value. More formally, returns <code>true</code> if and only if
  698. this map contains at least one mapping to a value <code>v</code> such
  699. that <code>(value==null ? v==null : value.equals(v))</code>. This
  700. operation will probably require time linear in the map size for
  701. most implementations.</div>
  702. <dl>
  703. <dt><strong>Specified by:</strong></dt>
  704. <dd><code><a href="../../java/util/Map.html#containsValue(java.lang.Object)">containsValue</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>
  705. <dt><strong>Overrides:</strong></dt>
  706. <dd><code><a href="../../java/util/AbstractMap.html#containsValue(java.lang.Object)">containsValue</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>
  707. <dt><span class="strong">Parameters:</span></dt><dd><code>value</code> - value whose presence in this map is to be tested</dd>
  708. <dt><span class="strong">Returns:</span></dt><dd><code>true</code> if a mapping to <code>value</code> exists;
  709. <code>false</code> otherwise</dd><dt><span class="strong">Since:</span></dt>
  710. <dd>1.2</dd></dl>
  711. </li>
  712. </ul>
  713. <a name="get(java.lang.Object)">
  714. <!-- -->
  715. </a>
  716. <ul class="blockList">
  717. <li class="blockList">
  718. <h4>get</h4>
  719. <pre>public&nbsp;<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>&nbsp;get(<a href="../../java/lang/Object.html" title="class in java.lang">Object</a>&nbsp;key)</pre>
  720. <div class="block">Returns the value to which the specified key is mapped,
  721. or <code>null</code> if this map contains no mapping for the key.
  722. <p>More formally, if this map contains a mapping from a key
  723. <code>k</code> to a value <code>v</code> such that <code>key</code> compares
  724. equal to <code>k</code> according to the map's ordering, then this
  725. method returns <code>v</code>; otherwise it returns <code>null</code>.
  726. (There can be at most one such mapping.)
  727. <p>A return value of <code>null</code> does not <em>necessarily</em>
  728. indicate that the map contains no mapping for the key; it's also
  729. possible that the map explicitly maps the key to <code>null</code>.
  730. The <a href="../../java/util/TreeMap.html#containsKey(java.lang.Object)"><code>containsKey</code></a> operation may be used to
  731. distinguish these two cases.</div>
  732. <dl>
  733. <dt><strong>Specified by:</strong></dt>
  734. <dd><code><a href="../../java/util/Map.html#get(java.lang.Object)">get</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>
  735. <dt><strong>Overrides:</strong></dt>
  736. <dd><code><a href="../../java/util/AbstractMap.html#get(java.lang.Object)">get</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>
  737. <dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - the key whose associated value is to be returned</dd>
  738. <dt><span class="strong">Returns:</span></dt><dd>the value to which the specified key is mapped, or
  739. <code>null</code> if this map contains no mapping for the key</dd>
  740. <dt><span class="strong">Throws:</span></dt>
  741. <dd><code><a href="../../java/lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> - if the specified key cannot be compared
  742. with the keys currently in the map</dd>
  743. <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified key is null
  744. and this map uses natural ordering, or its comparator
  745. does not permit null keys</dd></dl>
  746. </li>
  747. </ul>
  748. <a name="comparator()">
  749. <!-- -->
  750. </a>
  751. <ul class="blockList">
  752. <li class="blockList">
  753. <h4>comparator</h4>
  754. <pre>public&nbsp;<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>
  755. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/SortedMap.html#comparator()">SortedMap</a></code></strong></div>
  756. <div class="block">Returns the comparator used to order the keys in this map, or
  757. <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>
  758. <dl>
  759. <dt><strong>Specified by:</strong></dt>
  760. <dd><code><a href="../../java/util/SortedMap.html#comparator()">comparator</a></code>&nbsp;in interface&nbsp;<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></dd>
  761. <dt><span class="strong">Returns:</span></dt><dd>the comparator used to order the keys in this map,
  762. or <code>null</code> if this map uses the natural ordering
  763. of its keys</dd></dl>
  764. </li>
  765. </ul>
  766. <a name="firstKey()">
  767. <!-- -->
  768. </a>
  769. <ul class="blockList">
  770. <li class="blockList">
  771. <h4>firstKey</h4>
  772. <pre>public&nbsp;<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;firstKey()</pre>
  773. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/SortedMap.html#firstKey()">SortedMap</a></code></strong></div>
  774. <div class="block">Returns the first (lowest) key currently in this map.</div>
  775. <dl>
  776. <dt><strong>Specified by:</strong></dt>
  777. <dd><code><a href="../../java/util/SortedMap.html#firstKey()">firstKey</a></code>&nbsp;in interface&nbsp;<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></dd>
  778. <dt><span class="strong">Returns:</span></dt><dd>the first (lowest) key currently in this map</dd>
  779. <dt><span class="strong">Throws:</span></dt>
  780. <dd><code><a href="../../java/util/NoSuchElementException.html" title="class in java.util">NoSuchElementException</a></code> - if this map is empty</dd></dl>
  781. </li>
  782. </ul>
  783. <a name="lastKey()">
  784. <!-- -->
  785. </a>
  786. <ul class="blockList">
  787. <li class="blockList">
  788. <h4>lastKey</h4>
  789. <pre>public&nbsp;<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;lastKey()</pre>
  790. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/SortedMap.html#lastKey()">SortedMap</a></code></strong></div>
  791. <div class="block">Returns the last (highest) key currently in this map.</div>
  792. <dl>
  793. <dt><strong>Specified by:</strong></dt>
  794. <dd><code><a href="../../java/util/SortedMap.html#lastKey()">lastKey</a></code>&nbsp;in interface&nbsp;<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></dd>
  795. <dt><span class="strong">Returns:</span></dt><dd>the last (highest) key currently in this map</dd>
  796. <dt><span class="strong">Throws:</span></dt>
  797. <dd><code><a href="../../java/util/NoSuchElementException.html" title="class in java.util">NoSuchElementException</a></code> - if this map is empty</dd></dl>
  798. </li>
  799. </ul>
  800. <a name="putAll(java.util.Map)">
  801. <!-- -->
  802. </a>
  803. <ul class="blockList">
  804. <li class="blockList">
  805. <h4>putAll</h4>
  806. <pre>public&nbsp;void&nbsp;putAll(<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)</pre>
  807. <div class="block">Copies all of the mappings from the specified map to this map.
  808. These mappings replace any mappings that this map had for any
  809. of the keys currently in the specified map.</div>
  810. <dl>
  811. <dt><strong>Specified by:</strong></dt>
  812. <dd><code><a href="../../java/util/Map.html#putAll(java.util.Map)">putAll</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>
  813. <dt><strong>Overrides:</strong></dt>
  814. <dd><code><a href="../../java/util/AbstractMap.html#putAll(java.util.Map)">putAll</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>
  815. <dt><span class="strong">Parameters:</span></dt><dd><code>map</code> - mappings to be stored in this map</dd>
  816. <dt><span class="strong">Throws:</span></dt>
  817. <dd><code><a href="../../java/lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> - if the class of a key or value in
  818. the specified map prevents it from being stored in this map</dd>
  819. <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified map is null or
  820. the specified map contains a null key and this map does not
  821. permit null keys</dd></dl>
  822. </li>
  823. </ul>
  824. <a name="put(java.lang.Object,java.lang.Object)">
  825. <!-- -->
  826. </a><a name="put(K, V)">
  827. <!-- -->
  828. </a>
  829. <ul class="blockList">
  830. <li class="blockList">
  831. <h4>put</h4>
  832. <pre>public&nbsp;<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>&nbsp;put(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;key,
  833. <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>&nbsp;value)</pre>
  834. <div class="block">Associates the specified value with the specified key in this map.
  835. If the map previously contained a mapping for the key, the old
  836. value is replaced.</div>
  837. <dl>
  838. <dt><strong>Specified by:</strong></dt>
  839. <dd><code><a href="../../java/util/Map.html#put(K,%20V)">put</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>
  840. <dt><strong>Overrides:</strong></dt>
  841. <dd><code><a href="../../java/util/AbstractMap.html#put(K,%20V)">put</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>
  842. <dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - key with which the specified value is to be associated</dd><dd><code>value</code> - value to be associated with the specified key</dd>
  843. <dt><span class="strong">Returns:</span></dt><dd>the previous value associated with <code>key</code>, or
  844. <code>null</code> if there was no mapping for <code>key</code>.
  845. (A <code>null</code> return can also indicate that the map
  846. previously associated <code>null</code> with <code>key</code>.)</dd>
  847. <dt><span class="strong">Throws:</span></dt>
  848. <dd><code><a href="../../java/lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> - if the specified key cannot be compared
  849. with the keys currently in the map</dd>
  850. <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified key is null
  851. and this map uses natural ordering, or its comparator
  852. does not permit null keys</dd></dl>
  853. </li>
  854. </ul>
  855. <a name="remove(java.lang.Object)">
  856. <!-- -->
  857. </a>
  858. <ul class="blockList">
  859. <li class="blockList">
  860. <h4>remove</h4>
  861. <pre>public&nbsp;<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">V</a>&nbsp;remove(<a href="../../java/lang/Object.html" title="class in java.lang">Object</a>&nbsp;key)</pre>
  862. <div class="block">Removes the mapping for this key from this TreeMap if present.</div>
  863. <dl>
  864. <dt><strong>Specified by:</strong></dt>
  865. <dd><code><a href="../../java/util/Map.html#remove(java.lang.Object)">remove</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>
  866. <dt><strong>Overrides:</strong></dt>
  867. <dd><code><a href="../../java/util/AbstractMap.html#remove(java.lang.Object)">remove</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>
  868. <dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - key for which mapping should be removed</dd>
  869. <dt><span class="strong">Returns:</span></dt><dd>the previous value associated with <code>key</code>, or
  870. <code>null</code> if there was no mapping for <code>key</code>.
  871. (A <code>null</code> return can also indicate that the map
  872. previously associated <code>null</code> with <code>key</code>.)</dd>
  873. <dt><span class="strong">Throws:</span></dt>
  874. <dd><code><a href="../../java/lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> - if the specified key cannot be compared
  875. with the keys currently in the map</dd>
  876. <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified key is null
  877. and this map uses natural ordering, or its comparator
  878. does not permit null keys</dd></dl>
  879. </li>
  880. </ul>
  881. <a name="clear()">
  882. <!-- -->
  883. </a>
  884. <ul class="blockList">
  885. <li class="blockList">
  886. <h4>clear</h4>
  887. <pre>public&nbsp;void&nbsp;clear()</pre>
  888. <div class="block">Removes all of the mappings from this map.
  889. The map will be empty after this call returns.</div>
  890. <dl>
  891. <dt><strong>Specified by:</strong></dt>
  892. <dd><code><a href="../../java/util/Map.html#clear()">clear</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>
  893. <dt><strong>Overrides:</strong></dt>
  894. <dd><code><a href="../../java/util/AbstractMap.html#clear()">clear</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>
  895. </dl>
  896. </li>
  897. </ul>
  898. <a name="clone()">
  899. <!-- -->
  900. </a>
  901. <ul class="blockList">
  902. <li class="blockList">
  903. <h4>clone</h4>
  904. <pre>public&nbsp;<a href="../../java/lang/Object.html" title="class in java.lang">Object</a>&nbsp;clone()</pre>
  905. <div class="block">Returns a shallow copy of this <code>TreeMap</code> instance. (The keys and
  906. values themselves are not cloned.)</div>
  907. <dl>
  908. <dt><strong>Overrides:</strong></dt>
  909. <dd><code><a href="../../java/util/AbstractMap.html#clone()">clone</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>
  910. <dt><span class="strong">Returns:</span></dt><dd>a shallow copy of this map</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../java/lang/Cloneable.html" title="interface in java.lang"><code>Cloneable</code></a></dd></dl>
  911. </li>
  912. </ul>
  913. <a name="firstEntry()">
  914. <!-- -->
  915. </a>
  916. <ul class="blockList">
  917. <li class="blockList">
  918. <h4>firstEntry</h4>
  919. <pre>public&nbsp;<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;&nbsp;firstEntry()</pre>
  920. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/NavigableMap.html#firstEntry()">NavigableMap</a></code></strong></div>
  921. <div class="block">Returns a key-value mapping associated with the least
  922. key in this map, or <code>null</code> if the map is empty.</div>
  923. <dl>
  924. <dt><strong>Specified by:</strong></dt>
  925. <dd><code><a href="../../java/util/NavigableMap.html#firstEntry()">firstEntry</a></code>&nbsp;in interface&nbsp;<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></dd>
  926. <dt><span class="strong">Returns:</span></dt><dd>an entry with the least key,
  927. or <code>null</code> if this map is empty</dd><dt><span class="strong">Since:</span></dt>
  928. <dd>1.6</dd></dl>
  929. </li>
  930. </ul>
  931. <a name="lastEntry()">
  932. <!-- -->
  933. </a>
  934. <ul class="blockList">
  935. <li class="blockList">
  936. <h4>lastEntry</h4>
  937. <pre>public&nbsp;<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;&nbsp;lastEntry()</pre>
  938. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/NavigableMap.html#lastEntry()">NavigableMap</a></code></strong></div>
  939. <div class="block">Returns a key-value mapping associated with the greatest
  940. key in this map, or <code>null</code> if the map is empty.</div>
  941. <dl>
  942. <dt><strong>Specified by:</strong></dt>
  943. <dd><code><a href="../../java/util/NavigableMap.html#lastEntry()">lastEntry</a></code>&nbsp;in interface&nbsp;<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></dd>
  944. <dt><span class="strong">Returns:</span></dt><dd>an entry with the greatest key,
  945. or <code>null</code> if this map is empty</dd><dt><span class="strong">Since:</span></dt>
  946. <dd>1.6</dd></dl>
  947. </li>
  948. </ul>
  949. <a name="pollFirstEntry()">
  950. <!-- -->
  951. </a>
  952. <ul class="blockList">
  953. <li class="blockList">
  954. <h4>pollFirstEntry</h4>
  955. <pre>public&nbsp;<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;&nbsp;pollFirstEntry()</pre>
  956. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/NavigableMap.html#pollFirstEntry()">NavigableMap</a></code></strong></div>
  957. <div class="block">Removes and returns a key-value mapping associated with
  958. the least key in this map, or <code>null</code> if the map is empty.</div>
  959. <dl>
  960. <dt><strong>Specified by:</strong></dt>
  961. <dd><code><a href="../../java/util/NavigableMap.html#pollFirstEntry()">pollFirstEntry</a></code>&nbsp;in interface&nbsp;<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></dd>
  962. <dt><span class="strong">Returns:</span></dt><dd>the removed first entry of this map,
  963. or <code>null</code> if this map is empty</dd><dt><span class="strong">Since:</span></dt>
  964. <dd>1.6</dd></dl>
  965. </li>
  966. </ul>
  967. <a name="pollLastEntry()">
  968. <!-- -->
  969. </a>
  970. <ul class="blockList">
  971. <li class="blockList">
  972. <h4>pollLastEntry</h4>
  973. <pre>public&nbsp;<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;&nbsp;pollLastEntry()</pre>
  974. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/NavigableMap.html#pollLastEntry()">NavigableMap</a></code></strong></div>
  975. <div class="block">Removes and returns a key-value mapping associated with
  976. the greatest key in this map, or <code>null</code> if the map is empty.</div>
  977. <dl>
  978. <dt><strong>Specified by:</strong></dt>
  979. <dd><code><a href="../../java/util/NavigableMap.html#pollLastEntry()">pollLastEntry</a></code>&nbsp;in interface&nbsp;<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></dd>
  980. <dt><span class="strong">Returns:</span></dt><dd>the removed last entry of this map,
  981. or <code>null</code> if this map is empty</dd><dt><span class="strong">Since:</span></dt>
  982. <dd>1.6</dd></dl>
  983. </li>
  984. </ul>
  985. <a name="lowerEntry(java.lang.Object)">
  986. <!-- -->
  987. </a><a name="lowerEntry(K)">
  988. <!-- -->
  989. </a>
  990. <ul class="blockList">
  991. <li class="blockList">
  992. <h4>lowerEntry</h4>
  993. <pre>public&nbsp;<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;&nbsp;lowerEntry(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;key)</pre>
  994. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/NavigableMap.html#lowerEntry(K)">NavigableMap</a></code></strong></div>
  995. <div class="block">Returns a key-value mapping associated with the greatest key
  996. strictly less than the given key, or <code>null</code> if there is
  997. no such key.</div>
  998. <dl>
  999. <dt><strong>Specified by:</strong></dt>
  1000. <dd><code><a href="../../java/util/NavigableMap.html#lowerEntry(K)">lowerEntry</a></code>&nbsp;in interface&nbsp;<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></dd>
  1001. <dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - the key</dd>
  1002. <dt><span class="strong">Returns:</span></dt><dd>an entry with the greatest key less than <code>key</code>,
  1003. or <code>null</code> if there is no such key</dd>
  1004. <dt><span class="strong">Throws:</span></dt>
  1005. <dd><code><a href="../../java/lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> - if the specified key cannot be compared
  1006. with the keys currently in the map</dd>
  1007. <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified key is null
  1008. and this map uses natural ordering, or its comparator
  1009. does not permit null keys</dd><dt><span class="strong">Since:</span></dt>
  1010. <dd>1.6</dd></dl>
  1011. </li>
  1012. </ul>
  1013. <a name="lowerKey(java.lang.Object)">
  1014. <!-- -->
  1015. </a><a name="lowerKey(K)">
  1016. <!-- -->
  1017. </a>
  1018. <ul class="blockList">
  1019. <li class="blockList">
  1020. <h4>lowerKey</h4>
  1021. <pre>public&nbsp;<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;lowerKey(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;key)</pre>
  1022. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/NavigableMap.html#lowerKey(K)">NavigableMap</a></code></strong></div>
  1023. <div class="block">Returns the greatest key strictly less than the given key, or
  1024. <code>null</code> if there is no such key.</div>
  1025. <dl>
  1026. <dt><strong>Specified by:</strong></dt>
  1027. <dd><code><a href="../../java/util/NavigableMap.html#lowerKey(K)">lowerKey</a></code>&nbsp;in interface&nbsp;<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></dd>
  1028. <dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - the key</dd>
  1029. <dt><span class="strong">Returns:</span></dt><dd>the greatest key less than <code>key</code>,
  1030. or <code>null</code> if there is no such key</dd>
  1031. <dt><span class="strong">Throws:</span></dt>
  1032. <dd><code><a href="../../java/lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> - if the specified key cannot be compared
  1033. with the keys currently in the map</dd>
  1034. <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified key is null
  1035. and this map uses natural ordering, or its comparator
  1036. does not permit null keys</dd><dt><span class="strong">Since:</span></dt>
  1037. <dd>1.6</dd></dl>
  1038. </li>
  1039. </ul>
  1040. <a name="floorEntry(java.lang.Object)">
  1041. <!-- -->
  1042. </a><a name="floorEntry(K)">
  1043. <!-- -->
  1044. </a>
  1045. <ul class="blockList">
  1046. <li class="blockList">
  1047. <h4>floorEntry</h4>
  1048. <pre>public&nbsp;<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;&nbsp;floorEntry(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;key)</pre>
  1049. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/NavigableMap.html#floorEntry(K)">NavigableMap</a></code></strong></div>
  1050. <div class="block">Returns a key-value mapping associated with the greatest key
  1051. less than or equal to the given key, or <code>null</code> if there
  1052. is no such key.</div>
  1053. <dl>
  1054. <dt><strong>Specified by:</strong></dt>
  1055. <dd><code><a href="../../java/util/NavigableMap.html#floorEntry(K)">floorEntry</a></code>&nbsp;in interface&nbsp;<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></dd>
  1056. <dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - the key</dd>
  1057. <dt><span class="strong">Returns:</span></dt><dd>an entry with the greatest key less than or equal to
  1058. <code>key</code>, or <code>null</code> if there is no such key</dd>
  1059. <dt><span class="strong">Throws:</span></dt>
  1060. <dd><code><a href="../../java/lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> - if the specified key cannot be compared
  1061. with the keys currently in the map</dd>
  1062. <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified key is null
  1063. and this map uses natural ordering, or its comparator
  1064. does not permit null keys</dd><dt><span class="strong">Since:</span></dt>
  1065. <dd>1.6</dd></dl>
  1066. </li>
  1067. </ul>
  1068. <a name="floorKey(java.lang.Object)">
  1069. <!-- -->
  1070. </a><a name="floorKey(K)">
  1071. <!-- -->
  1072. </a>
  1073. <ul class="blockList">
  1074. <li class="blockList">
  1075. <h4>floorKey</h4>
  1076. <pre>public&nbsp;<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;floorKey(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;key)</pre>
  1077. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/NavigableMap.html#floorKey(K)">NavigableMap</a></code></strong></div>
  1078. <div class="block">Returns the greatest key less than or equal to the given key,
  1079. or <code>null</code> if there is no such key.</div>
  1080. <dl>
  1081. <dt><strong>Specified by:</strong></dt>
  1082. <dd><code><a href="../../java/util/NavigableMap.html#floorKey(K)">floorKey</a></code>&nbsp;in interface&nbsp;<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></dd>
  1083. <dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - the key</dd>
  1084. <dt><span class="strong">Returns:</span></dt><dd>the greatest key less than or equal to <code>key</code>,
  1085. or <code>null</code> if there is no such key</dd>
  1086. <dt><span class="strong">Throws:</span></dt>
  1087. <dd><code><a href="../../java/lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> - if the specified key cannot be compared
  1088. with the keys currently in the map</dd>
  1089. <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified key is null
  1090. and this map uses natural ordering, or its comparator
  1091. does not permit null keys</dd><dt><span class="strong">Since:</span></dt>
  1092. <dd>1.6</dd></dl>
  1093. </li>
  1094. </ul>
  1095. <a name="ceilingEntry(java.lang.Object)">
  1096. <!-- -->
  1097. </a><a name="ceilingEntry(K)">
  1098. <!-- -->
  1099. </a>
  1100. <ul class="blockList">
  1101. <li class="blockList">
  1102. <h4>ceilingEntry</h4>
  1103. <pre>public&nbsp;<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;&nbsp;ceilingEntry(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;key)</pre>
  1104. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/NavigableMap.html#ceilingEntry(K)">NavigableMap</a></code></strong></div>
  1105. <div class="block">Returns a key-value mapping associated with the least key
  1106. greater than or equal to the given key, or <code>null</code> if
  1107. there is no such key.</div>
  1108. <dl>
  1109. <dt><strong>Specified by:</strong></dt>
  1110. <dd><code><a href="../../java/util/NavigableMap.html#ceilingEntry(K)">ceilingEntry</a></code>&nbsp;in interface&nbsp;<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></dd>
  1111. <dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - the key</dd>
  1112. <dt><span class="strong">Returns:</span></dt><dd>an entry with the least key greater than or equal to
  1113. <code>key</code>, or <code>null</code> if there is no such key</dd>
  1114. <dt><span class="strong">Throws:</span></dt>
  1115. <dd><code><a href="../../java/lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> - if the specified key cannot be compared
  1116. with the keys currently in the map</dd>
  1117. <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified key is null
  1118. and this map uses natural ordering, or its comparator
  1119. does not permit null keys</dd><dt><span class="strong">Since:</span></dt>
  1120. <dd>1.6</dd></dl>
  1121. </li>
  1122. </ul>
  1123. <a name="ceilingKey(java.lang.Object)">
  1124. <!-- -->
  1125. </a><a name="ceilingKey(K)">
  1126. <!-- -->
  1127. </a>
  1128. <ul class="blockList">
  1129. <li class="blockList">
  1130. <h4>ceilingKey</h4>
  1131. <pre>public&nbsp;<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;ceilingKey(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;key)</pre>
  1132. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/NavigableMap.html#ceilingKey(K)">NavigableMap</a></code></strong></div>
  1133. <div class="block">Returns the least key greater than or equal to the given key,
  1134. or <code>null</code> if there is no such key.</div>
  1135. <dl>
  1136. <dt><strong>Specified by:</strong></dt>
  1137. <dd><code><a href="../../java/util/NavigableMap.html#ceilingKey(K)">ceilingKey</a></code>&nbsp;in interface&nbsp;<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></dd>
  1138. <dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - the key</dd>
  1139. <dt><span class="strong">Returns:</span></dt><dd>the least key greater than or equal to <code>key</code>,
  1140. or <code>null</code> if there is no such key</dd>
  1141. <dt><span class="strong">Throws:</span></dt>
  1142. <dd><code><a href="../../java/lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> - if the specified key cannot be compared
  1143. with the keys currently in the map</dd>
  1144. <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified key is null
  1145. and this map uses natural ordering, or its comparator
  1146. does not permit null keys</dd><dt><span class="strong">Since:</span></dt>
  1147. <dd>1.6</dd></dl>
  1148. </li>
  1149. </ul>
  1150. <a name="higherEntry(java.lang.Object)">
  1151. <!-- -->
  1152. </a><a name="higherEntry(K)">
  1153. <!-- -->
  1154. </a>
  1155. <ul class="blockList">
  1156. <li class="blockList">
  1157. <h4>higherEntry</h4>
  1158. <pre>public&nbsp;<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;&nbsp;higherEntry(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;key)</pre>
  1159. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/NavigableMap.html#higherEntry(K)">NavigableMap</a></code></strong></div>
  1160. <div class="block">Returns a key-value mapping associated with the least key
  1161. strictly greater than the given key, or <code>null</code> if there
  1162. is no such key.</div>
  1163. <dl>
  1164. <dt><strong>Specified by:</strong></dt>
  1165. <dd><code><a href="../../java/util/NavigableMap.html#higherEntry(K)">higherEntry</a></code>&nbsp;in interface&nbsp;<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></dd>
  1166. <dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - the key</dd>
  1167. <dt><span class="strong">Returns:</span></dt><dd>an entry with the least key greater than <code>key</code>,
  1168. or <code>null</code> if there is no such key</dd>
  1169. <dt><span class="strong">Throws:</span></dt>
  1170. <dd><code><a href="../../java/lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> - if the specified key cannot be compared
  1171. with the keys currently in the map</dd>
  1172. <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified key is null
  1173. and this map uses natural ordering, or its comparator
  1174. does not permit null keys</dd><dt><span class="strong">Since:</span></dt>
  1175. <dd>1.6</dd></dl>
  1176. </li>
  1177. </ul>
  1178. <a name="higherKey(java.lang.Object)">
  1179. <!-- -->
  1180. </a><a name="higherKey(K)">
  1181. <!-- -->
  1182. </a>
  1183. <ul class="blockList">
  1184. <li class="blockList">
  1185. <h4>higherKey</h4>
  1186. <pre>public&nbsp;<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;higherKey(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;key)</pre>
  1187. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/NavigableMap.html#higherKey(K)">NavigableMap</a></code></strong></div>
  1188. <div class="block">Returns the least key strictly greater than the given key, or
  1189. <code>null</code> if there is no such key.</div>
  1190. <dl>
  1191. <dt><strong>Specified by:</strong></dt>
  1192. <dd><code><a href="../../java/util/NavigableMap.html#higherKey(K)">higherKey</a></code>&nbsp;in interface&nbsp;<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></dd>
  1193. <dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - the key</dd>
  1194. <dt><span class="strong">Returns:</span></dt><dd>the least key greater than <code>key</code>,
  1195. or <code>null</code> if there is no such key</dd>
  1196. <dt><span class="strong">Throws:</span></dt>
  1197. <dd><code><a href="../../java/lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> - if the specified key cannot be compared
  1198. with the keys currently in the map</dd>
  1199. <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the specified key is null
  1200. and this map uses natural ordering, or its comparator
  1201. does not permit null keys</dd><dt><span class="strong">Since:</span></dt>
  1202. <dd>1.6</dd></dl>
  1203. </li>
  1204. </ul>
  1205. <a name="keySet()">
  1206. <!-- -->
  1207. </a>
  1208. <ul class="blockList">
  1209. <li class="blockList">
  1210. <h4>keySet</h4>
  1211. <pre>public&nbsp;<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;&nbsp;keySet()</pre>
  1212. <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.
  1213. The set's iterator returns the keys in ascending order.
  1214. The set is backed by the map, so changes to the map are
  1215. reflected in the set, and vice-versa. If the map is modified
  1216. while an iteration over the set is in progress (except through
  1217. the iterator's own <code>remove</code> operation), the results of
  1218. the iteration are undefined. The set supports element removal,
  1219. which removes the corresponding mapping from the map, via the
  1220. <code>Iterator.remove</code>, <code>Set.remove</code>,
  1221. <code>removeAll</code>, <code>retainAll</code>, and <code>clear</code>
  1222. operations. It does not support the <code>add</code> or <code>addAll</code>
  1223. operations.</div>
  1224. <dl>
  1225. <dt><strong>Specified by:</strong></dt>
  1226. <dd><code><a href="../../java/util/Map.html#keySet()">keySet</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>
  1227. <dt><strong>Specified by:</strong></dt>
  1228. <dd><code><a href="../../java/util/SortedMap.html#keySet()">keySet</a></code>&nbsp;in interface&nbsp;<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></dd>
  1229. <dt><strong>Overrides:</strong></dt>
  1230. <dd><code><a href="../../java/util/AbstractMap.html#keySet()">keySet</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>
  1231. <dt><span class="strong">Returns:</span></dt><dd>a set view of the keys contained in this map</dd></dl>
  1232. </li>
  1233. </ul>
  1234. <a name="navigableKeySet()">
  1235. <!-- -->
  1236. </a>
  1237. <ul class="blockList">
  1238. <li class="blockList">
  1239. <h4>navigableKeySet</h4>
  1240. <pre>public&nbsp;<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;&nbsp;navigableKeySet()</pre>
  1241. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/NavigableMap.html#navigableKeySet()">NavigableMap</a></code></strong></div>
  1242. <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.
  1243. The set's iterator returns the keys in ascending order.
  1244. The set is backed by the map, so changes to the map are reflected in
  1245. the set, and vice-versa. If the map is modified while an iteration
  1246. over the set is in progress (except through the iterator's own <code>remove</code> operation), the results of the iteration are undefined. The
  1247. set supports element removal, which removes the corresponding mapping
  1248. from the map, via the <code>Iterator.remove</code>, <code>Set.remove</code>,
  1249. <code>removeAll</code>, <code>retainAll</code>, and <code>clear</code> operations.
  1250. It does not support the <code>add</code> or <code>addAll</code> operations.</div>
  1251. <dl>
  1252. <dt><strong>Specified by:</strong></dt>
  1253. <dd><code><a href="../../java/util/NavigableMap.html#navigableKeySet()">navigableKeySet</a></code>&nbsp;in interface&nbsp;<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></dd>
  1254. <dt><span class="strong">Returns:</span></dt><dd>a navigable set view of the keys in this map</dd><dt><span class="strong">Since:</span></dt>
  1255. <dd>1.6</dd></dl>
  1256. </li>
  1257. </ul>
  1258. <a name="descendingKeySet()">
  1259. <!-- -->
  1260. </a>
  1261. <ul class="blockList">
  1262. <li class="blockList">
  1263. <h4>descendingKeySet</h4>
  1264. <pre>public&nbsp;<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;&nbsp;descendingKeySet()</pre>
  1265. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/NavigableMap.html#descendingKeySet()">NavigableMap</a></code></strong></div>
  1266. <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.
  1267. The set's iterator returns the keys in descending order.
  1268. The set is backed by the map, so changes to the map are reflected in
  1269. the set, and vice-versa. If the map is modified while an iteration
  1270. over the set is in progress (except through the iterator's own <code>remove</code> operation), the results of the iteration are undefined. The
  1271. set supports element removal, which removes the corresponding mapping
  1272. from the map, via the <code>Iterator.remove</code>, <code>Set.remove</code>,
  1273. <code>removeAll</code>, <code>retainAll</code>, and <code>clear</code> operations.
  1274. It does not support the <code>add</code> or <code>addAll</code> operations.</div>
  1275. <dl>
  1276. <dt><strong>Specified by:</strong></dt>
  1277. <dd><code><a href="../../java/util/NavigableMap.html#descendingKeySet()">descendingKeySet</a></code>&nbsp;in interface&nbsp;<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></dd>
  1278. <dt><span class="strong">Returns:</span></dt><dd>a reverse order navigable set view of the keys in this map</dd><dt><span class="strong">Since:</span></dt>
  1279. <dd>1.6</dd></dl>
  1280. </li>
  1281. </ul>
  1282. <a name="values()">
  1283. <!-- -->
  1284. </a>
  1285. <ul class="blockList">
  1286. <li class="blockList">
  1287. <h4>values</h4>
  1288. <pre>public&nbsp;<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;&nbsp;values()</pre>
  1289. <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.
  1290. The collection's iterator returns the values in ascending order
  1291. of the corresponding keys.
  1292. The collection is backed by the map, so changes to the map are
  1293. reflected in the collection, and vice-versa. If the map is
  1294. modified while an iteration over the collection is in progress
  1295. (except through the iterator's own <code>remove</code> operation),
  1296. the results of the iteration are undefined. The collection
  1297. supports element removal, which removes the corresponding
  1298. mapping from the map, via the <code>Iterator.remove</code>,
  1299. <code>Collection.remove</code>, <code>removeAll</code>,
  1300. <code>retainAll</code> and <code>clear</code> operations. It does not
  1301. support the <code>add</code> or <code>addAll</code> operations.</div>
  1302. <dl>
  1303. <dt><strong>Specified by:</strong></dt>
  1304. <dd><code><a href="../../java/util/Map.html#values()">values</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>
  1305. <dt><strong>Specified by:</strong></dt>
  1306. <dd><code><a href="../../java/util/SortedMap.html#values()">values</a></code>&nbsp;in interface&nbsp;<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></dd>
  1307. <dt><strong>Overrides:</strong></dt>
  1308. <dd><code><a href="../../java/util/AbstractMap.html#values()">values</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>
  1309. <dt><span class="strong">Returns:</span></dt><dd>a collection view of the values contained in this map</dd></dl>
  1310. </li>
  1311. </ul>
  1312. <a name="entrySet()">
  1313. <!-- -->
  1314. </a>
  1315. <ul class="blockList">
  1316. <li class="blockList">
  1317. <h4>entrySet</h4>
  1318. <pre>public&nbsp;<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;&nbsp;entrySet()</pre>
  1319. <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.
  1320. The set's iterator returns the entries in ascending key order.
  1321. The set is backed by the map, so changes to the map are
  1322. reflected in the set, and vice-versa. If the map is modified
  1323. while an iteration over the set is in progress (except through
  1324. the iterator's own <code>remove</code> operation, or through the
  1325. <code>setValue</code> operation on a map entry returned by the
  1326. iterator) the results of the iteration are undefined. The set
  1327. supports element removal, which removes the corresponding
  1328. mapping from the map, via the <code>Iterator.remove</code>,
  1329. <code>Set.remove</code>, <code>removeAll</code>, <code>retainAll</code> and
  1330. <code>clear</code> operations. It does not support the
  1331. <code>add</code> or <code>addAll</code> operations.</div>
  1332. <dl>
  1333. <dt><strong>Specified by:</strong></dt>
  1334. <dd><code><a href="../../java/util/Map.html#entrySet()">entrySet</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>
  1335. <dt><strong>Specified by:</strong></dt>
  1336. <dd><code><a href="../../java/util/SortedMap.html#entrySet()">entrySet</a></code>&nbsp;in interface&nbsp;<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></dd>
  1337. <dt><strong>Specified by:</strong></dt>
  1338. <dd><code><a href="../../java/util/AbstractMap.html#entrySet()">entrySet</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>
  1339. <dt><span class="strong">Returns:</span></dt><dd>a set view of the mappings contained in this map</dd></dl>
  1340. </li>
  1341. </ul>
  1342. <a name="descendingMap()">
  1343. <!-- -->
  1344. </a>
  1345. <ul class="blockList">
  1346. <li class="blockList">
  1347. <h4>descendingMap</h4>
  1348. <pre>public&nbsp;<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;&nbsp;descendingMap()</pre>
  1349. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/NavigableMap.html#descendingMap()">NavigableMap</a></code></strong></div>
  1350. <div class="block">Returns a reverse order view of the mappings contained in this map.
  1351. The descending map is backed by this map, so changes to the map are
  1352. reflected in the descending map, and vice-versa. If either map is
  1353. modified while an iteration over a collection view of either map
  1354. is in progress (except through the iterator's own <code>remove</code>
  1355. operation), the results of the iteration are undefined.
  1356. <p>The returned map has an ordering equivalent to
  1357. <tt><a href="../../java/util/Collections.html#reverseOrder(java.util.Comparator)"><code>Collections.reverseOrder</code></a>(comparator())</tt>.
  1358. The expression <code>m.descendingMap().descendingMap()</code> returns a
  1359. view of <code>m</code> essentially equivalent to <code>m</code>.</div>
  1360. <dl>
  1361. <dt><strong>Specified by:</strong></dt>
  1362. <dd><code><a href="../../java/util/NavigableMap.html#descendingMap()">descendingMap</a></code>&nbsp;in interface&nbsp;<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></dd>
  1363. <dt><span class="strong">Returns:</span></dt><dd>a reverse order view of this map</dd><dt><span class="strong">Since:</span></dt>
  1364. <dd>1.6</dd></dl>
  1365. </li>
  1366. </ul>
  1367. <a name="subMap(java.lang.Object,boolean,java.lang.Object,boolean)">
  1368. <!-- -->
  1369. </a><a name="subMap(K, boolean, K, boolean)">
  1370. <!-- -->
  1371. </a>
  1372. <ul class="blockList">
  1373. <li class="blockList">
  1374. <h4>subMap</h4>
  1375. <pre>public&nbsp;<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;&nbsp;subMap(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;fromKey,
  1376. boolean&nbsp;fromInclusive,
  1377. <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;toKey,
  1378. boolean&nbsp;toInclusive)</pre>
  1379. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/NavigableMap.html#subMap(K,%20boolean,%20K,%20boolean)">NavigableMap</a></code></strong></div>
  1380. <div class="block">Returns a view of the portion of this map whose keys range from
  1381. <code>fromKey</code> to <code>toKey</code>. If <code>fromKey</code> and
  1382. <code>toKey</code> are equal, the returned map is empty unless
  1383. <code>fromInclusive</code> and <code>toInclusive</code> are both true. The
  1384. returned map is backed by this map, so changes in the returned map are
  1385. reflected in this map, and vice-versa. The returned map supports all
  1386. optional map operations that this map supports.
  1387. <p>The returned map will throw an <code>IllegalArgumentException</code>
  1388. on an attempt to insert a key outside of its range, or to construct a
  1389. submap either of whose endpoints lie outside its range.</div>
  1390. <dl>
  1391. <dt><strong>Specified by:</strong></dt>
  1392. <dd><code><a href="../../java/util/NavigableMap.html#subMap(K,%20boolean,%20K,%20boolean)">subMap</a></code>&nbsp;in interface&nbsp;<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></dd>
  1393. <dt><span class="strong">Parameters:</span></dt><dd><code>fromKey</code> - low endpoint of the keys in the returned map</dd><dd><code>fromInclusive</code> - <code>true</code> if the low endpoint
  1394. is to be included in the returned view</dd><dd><code>toKey</code> - high endpoint of the keys in the returned map</dd><dd><code>toInclusive</code> - <code>true</code> if the high endpoint
  1395. is to be included in the returned view</dd>
  1396. <dt><span class="strong">Returns:</span></dt><dd>a view of the portion of this map whose keys range from
  1397. <code>fromKey</code> to <code>toKey</code></dd>
  1398. <dt><span class="strong">Throws:</span></dt>
  1399. <dd><code><a href="../../java/lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> - if <code>fromKey</code> and <code>toKey</code>
  1400. cannot be compared to one another using this map's comparator
  1401. (or, if the map has no comparator, using natural ordering).
  1402. Implementations may, but are not required to, throw this
  1403. exception if <code>fromKey</code> or <code>toKey</code>
  1404. cannot be compared to keys currently in the map.</dd>
  1405. <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if <code>fromKey</code> or <code>toKey</code> is
  1406. null and this map uses natural ordering, or its comparator
  1407. does not permit null keys</dd>
  1408. <dd><code><a href="../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - if <code>fromKey</code> is greater than
  1409. <code>toKey</code>; or if this map itself has a restricted
  1410. range, and <code>fromKey</code> or <code>toKey</code> lies
  1411. outside the bounds of the range</dd><dt><span class="strong">Since:</span></dt>
  1412. <dd>1.6</dd></dl>
  1413. </li>
  1414. </ul>
  1415. <a name="headMap(java.lang.Object,boolean)">
  1416. <!-- -->
  1417. </a><a name="headMap(K, boolean)">
  1418. <!-- -->
  1419. </a>
  1420. <ul class="blockList">
  1421. <li class="blockList">
  1422. <h4>headMap</h4>
  1423. <pre>public&nbsp;<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;&nbsp;headMap(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;toKey,
  1424. boolean&nbsp;inclusive)</pre>
  1425. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/NavigableMap.html#headMap(K,%20boolean)">NavigableMap</a></code></strong></div>
  1426. <div class="block">Returns a view of the portion of this map whose keys are less than (or
  1427. equal to, if <code>inclusive</code> is true) <code>toKey</code>. The returned
  1428. map is backed by this map, so changes in the returned map are reflected
  1429. in this map, and vice-versa. The returned map supports all optional
  1430. map operations that this map supports.
  1431. <p>The returned map will throw an <code>IllegalArgumentException</code>
  1432. on an attempt to insert a key outside its range.</div>
  1433. <dl>
  1434. <dt><strong>Specified by:</strong></dt>
  1435. <dd><code><a href="../../java/util/NavigableMap.html#headMap(K,%20boolean)">headMap</a></code>&nbsp;in interface&nbsp;<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></dd>
  1436. <dt><span class="strong">Parameters:</span></dt><dd><code>toKey</code> - high endpoint of the keys in the returned map</dd><dd><code>inclusive</code> - <code>true</code> if the high endpoint
  1437. is to be included in the returned view</dd>
  1438. <dt><span class="strong">Returns:</span></dt><dd>a view of the portion of this map whose keys are less than
  1439. (or equal to, if <code>inclusive</code> is true) <code>toKey</code></dd>
  1440. <dt><span class="strong">Throws:</span></dt>
  1441. <dd><code><a href="../../java/lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> - if <code>toKey</code> is not compatible
  1442. with this map's comparator (or, if the map has no comparator,
  1443. if <code>toKey</code> does not implement <a href="../../java/lang/Comparable.html" title="interface in java.lang"><code>Comparable</code></a>).
  1444. Implementations may, but are not required to, throw this
  1445. exception if <code>toKey</code> cannot be compared to keys
  1446. currently in the map.</dd>
  1447. <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if <code>toKey</code> is null
  1448. and this map uses natural ordering, or its comparator
  1449. does not permit null keys</dd>
  1450. <dd><code><a href="../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - if this map itself has a
  1451. restricted range, and <code>toKey</code> lies outside the
  1452. bounds of the range</dd><dt><span class="strong">Since:</span></dt>
  1453. <dd>1.6</dd></dl>
  1454. </li>
  1455. </ul>
  1456. <a name="tailMap(java.lang.Object,boolean)">
  1457. <!-- -->
  1458. </a><a name="tailMap(K, boolean)">
  1459. <!-- -->
  1460. </a>
  1461. <ul class="blockList">
  1462. <li class="blockList">
  1463. <h4>tailMap</h4>
  1464. <pre>public&nbsp;<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;&nbsp;tailMap(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;fromKey,
  1465. boolean&nbsp;inclusive)</pre>
  1466. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/NavigableMap.html#tailMap(K,%20boolean)">NavigableMap</a></code></strong></div>
  1467. <div class="block">Returns a view of the portion of this map whose keys are greater than (or
  1468. equal to, if <code>inclusive</code> is true) <code>fromKey</code>. The returned
  1469. map is backed by this map, so changes in the returned map are reflected
  1470. in this map, and vice-versa. The returned map supports all optional
  1471. map operations that this map supports.
  1472. <p>The returned map will throw an <code>IllegalArgumentException</code>
  1473. on an attempt to insert a key outside its range.</div>
  1474. <dl>
  1475. <dt><strong>Specified by:</strong></dt>
  1476. <dd><code><a href="../../java/util/NavigableMap.html#tailMap(K,%20boolean)">tailMap</a></code>&nbsp;in interface&nbsp;<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></dd>
  1477. <dt><span class="strong">Parameters:</span></dt><dd><code>fromKey</code> - low endpoint of the keys in the returned map</dd><dd><code>inclusive</code> - <code>true</code> if the low endpoint
  1478. is to be included in the returned view</dd>
  1479. <dt><span class="strong">Returns:</span></dt><dd>a view of the portion of this map whose keys are greater than
  1480. (or equal to, if <code>inclusive</code> is true) <code>fromKey</code></dd>
  1481. <dt><span class="strong">Throws:</span></dt>
  1482. <dd><code><a href="../../java/lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> - if <code>fromKey</code> is not compatible
  1483. with this map's comparator (or, if the map has no comparator,
  1484. if <code>fromKey</code> does not implement <a href="../../java/lang/Comparable.html" title="interface in java.lang"><code>Comparable</code></a>).
  1485. Implementations may, but are not required to, throw this
  1486. exception if <code>fromKey</code> cannot be compared to keys
  1487. currently in the map.</dd>
  1488. <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if <code>fromKey</code> is null
  1489. and this map uses natural ordering, or its comparator
  1490. does not permit null keys</dd>
  1491. <dd><code><a href="../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - if this map itself has a
  1492. restricted range, and <code>fromKey</code> lies outside the
  1493. bounds of the range</dd><dt><span class="strong">Since:</span></dt>
  1494. <dd>1.6</dd></dl>
  1495. </li>
  1496. </ul>
  1497. <a name="subMap(java.lang.Object,java.lang.Object)">
  1498. <!-- -->
  1499. </a><a name="subMap(K, K)">
  1500. <!-- -->
  1501. </a>
  1502. <ul class="blockList">
  1503. <li class="blockList">
  1504. <h4>subMap</h4>
  1505. <pre>public&nbsp;<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;&nbsp;subMap(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;fromKey,
  1506. <a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;toKey)</pre>
  1507. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/NavigableMap.html#subMap(K,%20K)">NavigableMap</a></code></strong></div>
  1508. <div class="block">Returns a view of the portion of this map whose keys range from
  1509. <code>fromKey</code>, inclusive, to <code>toKey</code>, exclusive. (If
  1510. <code>fromKey</code> and <code>toKey</code> are equal, the returned map
  1511. is empty.) The returned map is backed by this map, so changes
  1512. in the returned map are reflected in this map, and vice-versa.
  1513. The returned map supports all optional map operations that this
  1514. map supports.
  1515. <p>The returned map will throw an <code>IllegalArgumentException</code>
  1516. on an attempt to insert a key outside its range.
  1517. <p>Equivalent to <code>subMap(fromKey, true, toKey, false)</code>.</div>
  1518. <dl>
  1519. <dt><strong>Specified by:</strong></dt>
  1520. <dd><code><a href="../../java/util/NavigableMap.html#subMap(K,%20K)">subMap</a></code>&nbsp;in interface&nbsp;<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></dd>
  1521. <dt><strong>Specified by:</strong></dt>
  1522. <dd><code><a href="../../java/util/SortedMap.html#subMap(K,%20K)">subMap</a></code>&nbsp;in interface&nbsp;<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></dd>
  1523. <dt><span class="strong">Parameters:</span></dt><dd><code>fromKey</code> - low endpoint (inclusive) of the keys in the returned map</dd><dd><code>toKey</code> - high endpoint (exclusive) of the keys in the returned map</dd>
  1524. <dt><span class="strong">Returns:</span></dt><dd>a view of the portion of this map whose keys range from
  1525. <code>fromKey</code>, inclusive, to <code>toKey</code>, exclusive</dd>
  1526. <dt><span class="strong">Throws:</span></dt>
  1527. <dd><code><a href="../../java/lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> - if <code>fromKey</code> and <code>toKey</code>
  1528. cannot be compared to one another using this map's comparator
  1529. (or, if the map has no comparator, using natural ordering).
  1530. Implementations may, but are not required to, throw this
  1531. exception if <code>fromKey</code> or <code>toKey</code>
  1532. cannot be compared to keys currently in the map.</dd>
  1533. <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if <code>fromKey</code> or <code>toKey</code> is
  1534. null and this map uses natural ordering, or its comparator
  1535. does not permit null keys</dd>
  1536. <dd><code><a href="../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - if <code>fromKey</code> is greater than
  1537. <code>toKey</code>; or if this map itself has a restricted
  1538. range, and <code>fromKey</code> or <code>toKey</code> lies
  1539. outside the bounds of the range</dd></dl>
  1540. </li>
  1541. </ul>
  1542. <a name="headMap(java.lang.Object)">
  1543. <!-- -->
  1544. </a><a name="headMap(K)">
  1545. <!-- -->
  1546. </a>
  1547. <ul class="blockList">
  1548. <li class="blockList">
  1549. <h4>headMap</h4>
  1550. <pre>public&nbsp;<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;&nbsp;headMap(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;toKey)</pre>
  1551. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/NavigableMap.html#headMap(K)">NavigableMap</a></code></strong></div>
  1552. <div class="block">Returns a view of the portion of this map whose keys are
  1553. strictly less than <code>toKey</code>. The returned map is backed
  1554. by this map, so changes in the returned map are reflected in
  1555. this map, and vice-versa. The returned map supports all
  1556. optional map operations that this map supports.
  1557. <p>The returned map will throw an <code>IllegalArgumentException</code>
  1558. on an attempt to insert a key outside its range.
  1559. <p>Equivalent to <code>headMap(toKey, false)</code>.</div>
  1560. <dl>
  1561. <dt><strong>Specified by:</strong></dt>
  1562. <dd><code><a href="../../java/util/NavigableMap.html#headMap(K)">headMap</a></code>&nbsp;in interface&nbsp;<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></dd>
  1563. <dt><strong>Specified by:</strong></dt>
  1564. <dd><code><a href="../../java/util/SortedMap.html#headMap(K)">headMap</a></code>&nbsp;in interface&nbsp;<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></dd>
  1565. <dt><span class="strong">Parameters:</span></dt><dd><code>toKey</code> - high endpoint (exclusive) of the keys in the returned map</dd>
  1566. <dt><span class="strong">Returns:</span></dt><dd>a view of the portion of this map whose keys are strictly
  1567. less than <code>toKey</code></dd>
  1568. <dt><span class="strong">Throws:</span></dt>
  1569. <dd><code><a href="../../java/lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> - if <code>toKey</code> is not compatible
  1570. with this map's comparator (or, if the map has no comparator,
  1571. if <code>toKey</code> does not implement <a href="../../java/lang/Comparable.html" title="interface in java.lang"><code>Comparable</code></a>).
  1572. Implementations may, but are not required to, throw this
  1573. exception if <code>toKey</code> cannot be compared to keys
  1574. currently in the map.</dd>
  1575. <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if <code>toKey</code> is null
  1576. and this map uses natural ordering, or its comparator
  1577. does not permit null keys</dd>
  1578. <dd><code><a href="../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - if this map itself has a
  1579. restricted range, and <code>toKey</code> lies outside the
  1580. bounds of the range</dd></dl>
  1581. </li>
  1582. </ul>
  1583. <a name="tailMap(java.lang.Object)">
  1584. <!-- -->
  1585. </a><a name="tailMap(K)">
  1586. <!-- -->
  1587. </a>
  1588. <ul class="blockListLast">
  1589. <li class="blockList">
  1590. <h4>tailMap</h4>
  1591. <pre>public&nbsp;<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;&nbsp;tailMap(<a href="../../java/util/TreeMap.html" title="type parameter in TreeMap">K</a>&nbsp;fromKey)</pre>
  1592. <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../java/util/NavigableMap.html#tailMap(K)">NavigableMap</a></code></strong></div>
  1593. <div class="block">Returns a view of the portion of this map whose keys are
  1594. greater than or equal to <code>fromKey</code>. The returned map is
  1595. backed by this map, so changes in the returned map are
  1596. reflected in this map, and vice-versa. The returned map
  1597. supports all optional map operations that this map supports.
  1598. <p>The returned map will throw an <code>IllegalArgumentException</code>
  1599. on an attempt to insert a key outside its range.
  1600. <p>Equivalent to <code>tailMap(fromKey, true)</code>.</div>
  1601. <dl>
  1602. <dt><strong>Specified by:</strong></dt>
  1603. <dd><code><a href="../../java/util/NavigableMap.html#tailMap(K)">tailMap</a></code>&nbsp;in interface&nbsp;<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></dd>
  1604. <dt><strong>Specified by:</strong></dt>
  1605. <dd><code><a href="../../java/util/SortedMap.html#tailMap(K)">tailMap</a></code>&nbsp;in interface&nbsp;<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></dd>
  1606. <dt><span class="strong">Parameters:</span></dt><dd><code>fromKey</code> - low endpoint (inclusive) of the keys in the returned map</dd>
  1607. <dt><span class="strong">Returns:</span></dt><dd>a view of the portion of this map whose keys are greater
  1608. than or equal to <code>fromKey</code></dd>
  1609. <dt><span class="strong">Throws:</span></dt>
  1610. <dd><code><a href="../../java/lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> - if <code>fromKey</code> is not compatible
  1611. with this map's comparator (or, if the map has no comparator,
  1612. if <code>fromKey</code> does not implement <a href="../../java/lang/Comparable.html" title="interface in java.lang"><code>Comparable</code></a>).
  1613. Implementations may, but are not required to, throw this
  1614. exception if <code>fromKey</code> cannot be compared to keys
  1615. currently in the map.</dd>
  1616. <dd><code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if <code>fromKey</code> is null
  1617. and this map uses natural ordering, or its comparator
  1618. does not permit null keys</dd>
  1619. <dd><code><a href="../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - if this map itself has a
  1620. restricted range, and <code>fromKey</code> lies outside the
  1621. bounds of the range</dd></dl>
  1622. </li>
  1623. </ul>
  1624. </li>
  1625. </ul>
  1626. </li>
  1627. </ul>
  1628. </div>
  1629. </div>
  1630. <!-- ========= END OF CLASS DATA ========= -->
  1631. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  1632. <div class="bottomNav"><a name="navbar_bottom">
  1633. <!-- -->
  1634. </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
  1635. <!-- -->
  1636. </a>
  1637. <ul class="navList" title="Navigation">
  1638. <li><a href="../../overview-summary.html">Overview</a></li>
  1639. <li><a href="package-summary.html">Package</a></li>
  1640. <li class="navBarCell1Rev">Class</li>
  1641. <li><a href="class-use/TreeMap.html">Use</a></li>
  1642. <li><a href="package-tree.html">Tree</a></li>
  1643. <li><a href="../../deprecated-list.html">Deprecated</a></li>
  1644. <li><a href="../../index-files/index-1.html">Index</a></li>
  1645. <li><a href="../../help-doc.html">Help</a></li>
  1646. </ul>
  1647. <div class="aboutLanguage"><em><strong>Java&trade;&nbsp;Platform<br>Standard&nbsp;Ed.&nbsp;7</strong></em></div>
  1648. </div>
  1649. <div class="subNav">
  1650. <ul class="navList">
  1651. <li><a href="../../java/util/TooManyListenersException.html" title="class in java.util"><span class="strong">Prev Class</span></a></li>
  1652. <li><a href="../../java/util/TreeSet.html" title="class in java.util"><span class="strong">Next Class</span></a></li>
  1653. </ul>
  1654. <ul class="navList">
  1655. <li><a href="../../index.html?java/util/TreeMap.html" target="_top">Frames</a></li>
  1656. <li><a href="TreeMap.html" target="_top">No Frames</a></li>
  1657. </ul>
  1658. <ul class="navList" id="allclasses_navbar_bottom">
  1659. <li><a href="../../allclasses-noframe.html">All Classes</a></li>
  1660. </ul>
  1661. <div>
  1662. <script type="text/javascript"><!--
  1663. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  1664. if(window==top) {
  1665. allClassesLink.style.display = "block";
  1666. }
  1667. else {
  1668. allClassesLink.style.display = "none";
  1669. }
  1670. //-->
  1671. </script>
  1672. </div>
  1673. <div>
  1674. <ul class="subNavList">
  1675. <li>Summary:&nbsp;</li>
  1676. <li><a href="#nested_classes_inherited_from_class_java.util.AbstractMap">Nested</a>&nbsp;|&nbsp;</li>
  1677. <li>Field&nbsp;|&nbsp;</li>
  1678. <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
  1679. <li><a href="#method_summary">Method</a></li>
  1680. </ul>
  1681. <ul class="subNavList">
  1682. <li>Detail:&nbsp;</li>
  1683. <li>Field&nbsp;|&nbsp;</li>
  1684. <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
  1685. <li><a href="#method_detail">Method</a></li>
  1686. </ul>
  1687. </div>
  1688. <a name="skip-navbar_bottom">
  1689. <!-- -->
  1690. </a></div>
  1691. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  1692. <p class="legalCopy"><small><font size="-1"> <a href="http://bugreport.sun.com/bugreport/">Submit a bug or feature</a> <br>For further API reference and developer documentation, see <a href="http://docs.oracle.com/javase/7/docs/index.html" target="_blank">Java SE Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.<br> <a href="../../../legal/cpyr.html">Copyright</a> &#x00a9; 1993, 2015, Oracle and/or its affiliates. All rights reserved. </font></small></p>
  1693. </body>
  1694. </html>