📄 hashtable.html
字号:
containsKey</H3><PRE>public boolean <B>containsKey</B>(<A HREF="../../java/lang/Object.html">Object</A> key)</PRE><DL><DD>Tests if the specified object is a key in this hashtable.<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></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - possible key.<DT><B>Returns:</B><DD><code>true</code> if and only if the specified object is a key in this hashtable, as determined by the <tt>equals</tt> method; <code>false</code> otherwise.<DT><B>See Also: </B><DD><A HREF="../../java/util/Hashtable.html#contains(java.lang.Object)"><CODE>contains(Object)</CODE></A></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> key)</PRE><DL><DD>Returns the value to which the specified key is mapped in this hashtable.<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/Dictionary.html#get(java.lang.Object)">get</A></CODE> in class <CODE><A HREF="../../java/util/Dictionary.html">Dictionary</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - a key in the hashtable.<DT><B>Returns:</B><DD>the value to which the key is mapped in this hashtable; <code>null</code> if the key is not mapped to any value in this hashtable.<DT><B>See Also: </B><DD><A HREF="../../java/util/Hashtable.html#put(java.lang.Object, java.lang.Object)"><CODE>put(Object, Object)</CODE></A></DL></DD></DL><HR><A NAME="rehash()"><!-- --></A><H3>rehash</H3><PRE>protected void <B>rehash</B>()</PRE><DL><DD>Increases the capacity of and internally reorganizes this hashtable, in order to accommodate and access its entries more efficiently. This method is called automatically when the number of keys in the hashtable exceeds this hashtable's capacity and load factor.<DD><DL></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> key, <A HREF="../../java/lang/Object.html">Object</A> value)</PRE><DL><DD>Maps the specified <code>key</code> to the specified <code>value</code> in this hashtable. Neither the key nor the value can be <code>null</code>. <p> The value can be retrieved by calling the <code>get</code> method with a key that is equal to the original key.<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/Dictionary.html#put(java.lang.Object, java.lang.Object)">put</A></CODE> in class <CODE><A HREF="../../java/util/Dictionary.html">Dictionary</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - the hashtable key.<DD><CODE>value</CODE> - the value.<DT><B>Returns:</B><DD>the previous value of the specified key in this hashtable, or <code>null</code> if it did not have one.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if the key or value is <code>null</code>.<DT><B>See Also: </B><DD><A HREF="../../java/lang/Object.html#equals(java.lang.Object)"><CODE>Object.equals(Object)</CODE></A>, <A HREF="../../java/util/Hashtable.html#get(java.lang.Object)"><CODE>get(Object)</CODE></A></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> key)</PRE><DL><DD>Removes the key (and its corresponding value) from this hashtable. This method does nothing if the key is not in the hashtable.<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/Dictionary.html#remove(java.lang.Object)">remove</A></CODE> in class <CODE><A HREF="../../java/util/Dictionary.html">Dictionary</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - the key that needs to be removed.<DT><B>Returns:</B><DD>the value to which the key had been mapped in this hashtable, or <code>null</code> if the key did not have a mapping.</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> t)</PRE><DL><DD>Copies all of the mappings from the specified Map to this Hashtable These mappings will replace any mappings that this Hashtable 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></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>t</CODE> - Mappings to be stored in this map.<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="clear()"><!-- --></A><H3>clear</H3><PRE>public void <B>clear</B>()</PRE><DL><DD>Clears this hashtable so that it contains no keys.<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></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>Creates a shallow copy of this hashtable. All the structure of the hashtable itself is copied, but the keys and values are not cloned. This is a relatively expensive operation.<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 clone of the hashtable.</DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>toString</B>()</PRE><DL><DD>Returns a string representation of this <tt>Hashtable</tt> object in the form of a set of entries, enclosed in braces and separated by the ASCII characters "<tt>, </tt>" (comma and space). Each entry is rendered as the key, an equals sign <tt>=</tt>, and the associated element, where the <tt>toString</tt> method is used to convert the key and element to strings. <p>Overrides to <tt>toString</tt> method of <tt>Object</tt>.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#toString()">toString</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a string representation of this hashtable.</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 Hashtable. The Set is backed by the Hashtable, so changes to the Hashtable are reflected in the Set, and vice-versa. The Set supports element removal (which removes the corresponding entry from the Hashtable), but not element addition.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Map.html#keySet()">keySet</A></CODE> in interface <CODE><A HREF="../../java/util/Map.html">Map</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a set view of the keys contained in this map.<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="entrySet()"><!-- --></A><H3>entrySet</H3><PRE>public <A HREF="../../java/util/Set.html">Set</A> <B>entrySet</B>()</PRE><DL><DD>Returns a Set view of the entries contained in this Hashtable. Each element in this collection is a Map.Entry. The Set is backed by the Hashtable, so changes to the Hashtable are reflected in the Set, and vice-versa. The Set supports element removal (which removes the corresponding entry from the Hashtable), but not element addition.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Map.html#entrySet()">entrySet</A></CODE> in interface <CODE><A HREF="../../java/util/Map.html">Map</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a set view of the mappings contained in this map.<DT><B>Since: </B><DD>1.2</DD><DT><B>See Also: </B><DD><A HREF="../../java/util/Map.Entry.html"><CODE>Map.Entry</CODE></A></DL></DD></DL><HR><A NAME="values()"><!-- --></A><H3>values</H3><PRE>public <A HREF="../../java/util/Collection.html">Collection</A> <B>values</B>()</PRE><DL><DD>Returns a Collection view of the values contained in this Hashtable. The Collection is backed by the Hashtable, so changes to the Hashtable are reflected in the Collection, and vice-versa. The Collection supports element removal (which removes the corresponding entry from the Hashtable), but not element addition.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Map.html#values()">values</A></CODE> in interface <CODE><A HREF="../../java/util/Map.html">Map</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a collection view of the values contained in this map.<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="equals(java.lang.Object)"><!-- --></A><H3>equals</H3><PRE>public boolean <B>equals</B>(<A HREF="../../java/lang/Object.html">Object</A> o)</PRE><DL><DD>Compares the specified Object with this Map for equality, as per the definition in the Map interface.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Map.html#equals(java.lang.Object)">equals</A></CODE> in interface <CODE><A HREF="../../java/util/Map.html">Map</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if the specified Object is equal to this Map.<DT><B>Since: </B><DD>1.2</DD><DT><B>See Also: </B><DD><A HREF="../../java/util/Map.html#equals(java.lang.Object)"><CODE>Map.equals(Object)</CODE></A></DL></DD></DL><HR><A NAME="hashCode()"><!-- --></A><H3>hashCode</H3><PRE>public int <B>hashCode</B>()</PRE><DL><DD>Returns the hash code value for this Map as per the definition in the Map interface.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Map.html#hashCode()">hashCode</A></CODE> in interface <CODE><A HREF="../../java/util/Map.html">Map</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#hashCode()">hashCode</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Since: </B><DD>1.2</DD><DT><B>See Also: </B><DD><A HREF="../../java/util/Map.html#hashCode()"><CODE>Map.hashCode()</CODE></A></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Hashtable.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../java/util/HashSet.html"><B>PREV CLASS</B></A> <A HREF="../../java/util/LinkedList.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="Hashtable.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A. All Rights Reserved.</font></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -