⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 treemap.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="size()"><!-- --></A><H3>size</H3><PRE>public int <B>size</B>()</PRE><DL><DD>Returns the number of key-value mappings in this map.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Map.html#size()">size</A></CODE> in interface <CODE><A HREF="../../java/util/Map.html">Map</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/AbstractMap.html#size()">size</A></CODE> in class <CODE><A HREF="../../java/util/AbstractMap.html">AbstractMap</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of key-value mappings in this map.</DL></DD></DL><HR><A NAME="containsKey(java.lang.Object)"><!-- --></A><H3>containsKey</H3><PRE>public boolean <B>containsKey</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;key)</PRE><DL><DD>Returns <tt>true</tt> if this map contains a mapping for the specified key.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Map.html#containsKey(java.lang.Object)">containsKey</A></CODE> in interface <CODE><A HREF="../../java/util/Map.html">Map</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/AbstractMap.html#containsKey(java.lang.Object)">containsKey</A></CODE> in class <CODE><A HREF="../../java/util/AbstractMap.html">AbstractMap</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - key whose presence in this map is to be tested.<DT><B>Returns:</B><DD><tt>true</tt> if this map contains a mapping for the            specified key.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/ClassCastException.html">ClassCastException</A></CODE> - if the key cannot be compared with the keys		  currently in the map.<DD><CODE><A HREF="../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - key is <tt>null</tt> and this map uses		  natural ordering, or its comparator does not tolerate            <tt>null</tt> keys.</DL></DD></DL><HR><A NAME="containsValue(java.lang.Object)"><!-- --></A><H3>containsValue</H3><PRE>public boolean <B>containsValue</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;value)</PRE><DL><DD>Returns <tt>true</tt> if this map maps one or more keys to the specified value.  More formally, returns <tt>true</tt> if and only if this map contains at least one mapping to a value <tt>v</tt> such that <tt>(value==null ? v==null : value.equals(v))</tt>.  This operation will probably require time linear in the Map size for most implementations of Map.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Map.html#containsValue(java.lang.Object)">containsValue</A></CODE> in interface <CODE><A HREF="../../java/util/Map.html">Map</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/AbstractMap.html#containsValue(java.lang.Object)">containsValue</A></CODE> in class <CODE><A HREF="../../java/util/AbstractMap.html">AbstractMap</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>value</CODE> - value whose presence in this Map is to be tested.<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="get(java.lang.Object)"><!-- --></A><H3>get</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>get</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;key)</PRE><DL><DD>Returns the value to which this map maps the specified key.  Returns <tt>null</tt> if the map contains no mapping for this key.  A return value of <tt>null</tt> does not <i>necessarily</i> indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to <tt>null</tt>.  The <tt>containsKey</tt> operation may be used to distinguish these two cases.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Map.html#get(java.lang.Object)">get</A></CODE> in interface <CODE><A HREF="../../java/util/Map.html">Map</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/AbstractMap.html#get(java.lang.Object)">get</A></CODE> in class <CODE><A HREF="../../java/util/AbstractMap.html">AbstractMap</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - key whose associated value is to be returned.<DT><B>Returns:</B><DD>the value to which this map maps the specified key, or	       <tt>null</tt> if the map contains no mapping for the key.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/ClassCastException.html">ClassCastException</A></CODE> - key cannot be compared with the keys		  currently in the map.<DD><CODE><A HREF="../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - key is <tt>null</tt> and this map uses		  natural ordering, or its comparator does not tolerate		  <tt>null</tt> keys.<DT><B>See Also: </B><DD><A HREF="../../java/util/TreeMap.html#containsKey(java.lang.Object)"><CODE>containsKey(Object)</CODE></A></DL></DD></DL><HR><A NAME="comparator()"><!-- --></A><H3>comparator</H3><PRE>public <A HREF="../../java/util/Comparator.html">Comparator</A> <B>comparator</B>()</PRE><DL><DD>Returns the comparator used to order this map, or <tt>null</tt> if this map uses its keys' natural order.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/SortedMap.html#comparator()">comparator</A></CODE> in interface <CODE><A HREF="../../java/util/SortedMap.html">SortedMap</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the comparator associated with this sorted map, or 	       <tt>null</tt> if it uses its keys' natural sort method.</DL></DD></DL><HR><A NAME="firstKey()"><!-- --></A><H3>firstKey</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>firstKey</B>()</PRE><DL><DD>Returns the first (lowest) key currently in this sorted map.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/SortedMap.html#firstKey()">firstKey</A></CODE> in interface <CODE><A HREF="../../java/util/SortedMap.html">SortedMap</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the first (lowest) key currently in this sorted map.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/util/NoSuchElementException.html">NoSuchElementException</A></CODE> - Map is empty.</DL></DD></DL><HR><A NAME="lastKey()"><!-- --></A><H3>lastKey</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>lastKey</B>()</PRE><DL><DD>Returns the last (highest) key currently in this sorted map.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/SortedMap.html#lastKey()">lastKey</A></CODE> in interface <CODE><A HREF="../../java/util/SortedMap.html">SortedMap</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the last (highest) key currently in this sorted map.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/util/NoSuchElementException.html">NoSuchElementException</A></CODE> - Map is empty.</DL></DD></DL><HR><A NAME="putAll(java.util.Map)"><!-- --></A><H3>putAll</H3><PRE>public void <B>putAll</B>(<A HREF="../../java/util/Map.html">Map</A>&nbsp;map)</PRE><DL><DD>Copies all of the mappings from the specified map to this map.  These mappings replace any mappings that this map had for any of the keys currently in the specified map.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Map.html#putAll(java.util.Map)">putAll</A></CODE> in interface <CODE><A HREF="../../java/util/Map.html">Map</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/AbstractMap.html#putAll(java.util.Map)">putAll</A></CODE> in class <CODE><A HREF="../../java/util/AbstractMap.html">AbstractMap</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>map</CODE> - mappings to be stored in this map.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/ClassCastException.html">ClassCastException</A></CODE> - class of a key or value in the specified 	          map prevents it from being stored in this map.<DD><CODE><A HREF="../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - this map does not permit <tt>null</tt>            keys and a specified key is <tt>null</tt>.</DL></DD></DL><HR><A NAME="put(java.lang.Object, java.lang.Object)"><!-- --></A><H3>put</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>put</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;key,                  <A HREF="../../java/lang/Object.html">Object</A>&nbsp;value)</PRE><DL><DD>Associates the specified value with the specified key in this map. If the map previously contained a mapping for this key, the old value is replaced.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Map.html#put(java.lang.Object, java.lang.Object)">put</A></CODE> in interface <CODE><A HREF="../../java/util/Map.html">Map</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/AbstractMap.html#put(java.lang.Object, java.lang.Object)">put</A></CODE> in class <CODE><A HREF="../../java/util/AbstractMap.html">AbstractMap</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - key with which the specified value is to be associated.<DD><CODE>value</CODE> - value to be associated with the specified key.<DT><B>Returns:</B><DD>previous value associated with specified key, or <tt>null</tt>	       if there was no mapping for key.  A <tt>null</tt> return can	       also indicate that the map previously associated <tt>null</tt>	       with the specified key.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/ClassCastException.html">ClassCastException</A></CODE> - key cannot be compared with the keys		  currently in the map.<DD><CODE><A HREF="../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - key is <tt>null</tt> and this map uses		  natural order, or its comparator does not tolerate		  <tt>null</tt> keys.</DL></DD></DL><HR><A NAME="remove(java.lang.Object)"><!-- --></A><H3>remove</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>remove</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;key)</PRE><DL><DD>Removes the mapping for this key from this TreeMap if present.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Map.html#remove(java.lang.Object)">remove</A></CODE> in interface <CODE><A HREF="../../java/util/Map.html">Map</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/AbstractMap.html#remove(java.lang.Object)">remove</A></CODE> in class <CODE><A HREF="../../java/util/AbstractMap.html">AbstractMap</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>previous value associated with specified key, or <tt>null</tt>	       if there was no mapping for key.  A <tt>null</tt> return can	       also indicate that the map previously associated	       <tt>null</tt> with the specified key.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/ClassCastException.html">ClassCastException</A></CODE> - key cannot be compared with the keys		  currently in the map.<DD><CODE><A HREF="../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - key is <tt>null</tt> and this map uses		  natural order, or its comparator does not tolerate		  <tt>null</tt> keys.</DL></DD></DL><HR><A NAME="clear()"><!-- --></A><H3>clear</H3><PRE>public void <B>clear</B>()</PRE><DL><DD>Removes all mappings from this TreeMap.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Map.html#clear()">clear</A></CODE> in interface <CODE><A HREF="../../java/util/Map.html">Map</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/AbstractMap.html#clear()">clear</A></CODE> in class <CODE><A HREF="../../java/util/AbstractMap.html">AbstractMap</A></CODE></DL></DD><DD>Following copied from interface: <CODE>java.util.Map</CODE></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/UnsupportedOperationException.html">UnsupportedOperationException</A></CODE> - clear is not supported by this 		  map.</DL></DD></DL><HR><A NAME="clone()"><!-- --></A><H3>clone</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>clone</B>()</PRE><DL><DD>Returns a shallow copy of this <tt>TreeMap</tt> instance. (The keys and values themselves are not cloned.)<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#clone()">clone</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a shallow copy of this Map.</DL></DD></DL><HR><A NAME="keySet()"><!-- --></A><H3>keySet</H3><PRE>public <A HREF="../../java/util/Set.html">Set</A> <B>keySet</B>()</PRE><DL><DD>Returns a Set view of the keys contained in this map.  The set's iterator will return the keys in ascending order.  The map is backed by this <tt>TreeMap</tt> instance, so changes to this map are reflected in the Set, and vice-versa.  The Set supports element removal, which removes the corresponding mapping from the map, via the

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -