📄 hashtable.html
字号:
<TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/util/Hashtable.html#hashCode()">hashCode</A></B>()</CODE><BR> Returns the hash code value for this Map as per the definition in the Map interface.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/util/Hashtable.html#isEmpty()">isEmpty</A></B>()</CODE><BR> Tests if this hashtable maps no keys to values.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/util/Enumeration.html">Enumeration</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/util/Hashtable.html#keys()">keys</A></B>()</CODE><BR> Returns an enumeration of the keys in this hashtable.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/util/Set.html">Set</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/util/Hashtable.html#keySet()">keySet</A></B>()</CODE><BR> Returns a Set view of the keys contained in this Hashtable.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/util/Hashtable.html#put(java.lang.Object, java.lang.Object)">put</A></B>(<A HREF="../../java/lang/Object.html">Object</A> key, <A HREF="../../java/lang/Object.html">Object</A> value)</CODE><BR> Maps the specified <code>key</code> to the specified <code>value</code> in this hashtable.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/util/Hashtable.html#putAll(java.util.Map)">putAll</A></B>(<A HREF="../../java/util/Map.html">Map</A> t)</CODE><BR> 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.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/util/Hashtable.html#rehash()">rehash</A></B>()</CODE><BR> Increases the capacity of and internally reorganizes this hashtable, in order to accommodate and access its entries more efficiently.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/util/Hashtable.html#remove(java.lang.Object)">remove</A></B>(<A HREF="../../java/lang/Object.html">Object</A> key)</CODE><BR> Removes the key (and its corresponding value) from this hashtable.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/util/Hashtable.html#size()">size</A></B>()</CODE><BR> Returns the number of keys in this hashtable.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/util/Hashtable.html#toString()">toString</A></B>()</CODE><BR> 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).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/util/Collection.html">Collection</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/util/Hashtable.html#values()">values</A></B>()</CODE><BR> Returns a Collection view of the values contained in this Hashtable.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="Hashtable(int, float)"><!-- --></A><H3>Hashtable</H3><PRE>public <B>Hashtable</B>(int initialCapacity, float loadFactor)</PRE><DL><DD>Constructs a new, empty hashtable with the specified initial capacity and the specified load factor.<DD><DL><DT><B>Parameters:</B><DD><CODE>initialCapacity</CODE> - the initial capacity of the hashtable.<DD><CODE>loadFactor</CODE> - the load factor of the hashtable.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the initial capacity is less than zero, or if the load factor is nonpositive.</DL></DD></DL><HR><A NAME="Hashtable(int)"><!-- --></A><H3>Hashtable</H3><PRE>public <B>Hashtable</B>(int initialCapacity)</PRE><DL><DD>Constructs a new, empty hashtable with the specified initial capacity and default load factor, which is <tt>0.75</tt>.<DD><DL><DT><B>Parameters:</B><DD><CODE>initialCapacity</CODE> - the initial capacity of the hashtable.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the initial capacity is less than zero.</DL></DD></DL><HR><A NAME="Hashtable()"><!-- --></A><H3>Hashtable</H3><PRE>public <B>Hashtable</B>()</PRE><DL><DD>Constructs a new, empty hashtable with a default capacity and load factor, which is <tt>0.75</tt>.</DL><HR><A NAME="Hashtable(java.util.Map)"><!-- --></A><H3>Hashtable</H3><PRE>public <B>Hashtable</B>(<A HREF="../../java/util/Map.html">Map</A> t)</PRE><DL><DD>Constructs a new hashtable with the same mappings as the given Map. The hashtable is created with a capacity of twice the number of entries in the given Map or 11 (whichever is greater), and a default load factor, which is <tt>0.75</tt>.<DD><DL><DT><B>Parameters:</B><DD><CODE>t</CODE> - the map whose mappings are to be placed in this map.<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><!-- ============ METHOD DETAIL ========== --><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 keys in this hashtable.<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/Dictionary.html#size()">size</A></CODE> in class <CODE><A HREF="../../java/util/Dictionary.html">Dictionary</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of keys in this hashtable.</DL></DD></DL><HR><A NAME="isEmpty()"><!-- --></A><H3>isEmpty</H3><PRE>public boolean <B>isEmpty</B>()</PRE><DL><DD>Tests if this hashtable maps no keys to values.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/util/Map.html#isEmpty()">isEmpty</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#isEmpty()">isEmpty</A></CODE> in class <CODE><A HREF="../../java/util/Dictionary.html">Dictionary</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD><code>true</code> if this hashtable maps no keys to values; <code>false</code> otherwise.</DL></DD></DL><HR><A NAME="keys()"><!-- --></A><H3>keys</H3><PRE>public <A HREF="../../java/util/Enumeration.html">Enumeration</A> <B>keys</B>()</PRE><DL><DD>Returns an enumeration of the keys in this hashtable.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/Dictionary.html#keys()">keys</A></CODE> in class <CODE><A HREF="../../java/util/Dictionary.html">Dictionary</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>an enumeration of the keys in this hashtable.<DT><B>See Also: </B><DD><A HREF="../../java/util/Enumeration.html"><CODE>Enumeration</CODE></A>, <A HREF="../../java/util/Hashtable.html#elements()"><CODE>elements()</CODE></A>, <A HREF="../../java/util/Hashtable.html#keySet()"><CODE>keySet()</CODE></A>, <A HREF="../../java/util/Map.html"><CODE>Map</CODE></A></DL></DD></DL><HR><A NAME="elements()"><!-- --></A><H3>elements</H3><PRE>public <A HREF="../../java/util/Enumeration.html">Enumeration</A> <B>elements</B>()</PRE><DL><DD>Returns an enumeration of the values in this hashtable. Use the Enumeration methods on the returned object to fetch the elements sequentially.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/Dictionary.html#elements()">elements</A></CODE> in class <CODE><A HREF="../../java/util/Dictionary.html">Dictionary</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>an enumeration of the values in this hashtable.<DT><B>See Also: </B><DD><A HREF="../../java/util/Enumeration.html"><CODE>Enumeration</CODE></A>, <A HREF="../../java/util/Hashtable.html#keys()"><CODE>keys()</CODE></A>, <A HREF="../../java/util/Hashtable.html#values()"><CODE>values()</CODE></A>, <A HREF="../../java/util/Map.html"><CODE>Map</CODE></A></DL></DD></DL><HR><A NAME="contains(java.lang.Object)"><!-- --></A><H3>contains</H3><PRE>public boolean <B>contains</B>(<A HREF="../../java/lang/Object.html">Object</A> value)</PRE><DL><DD>Tests if some key maps into the specified value in this hashtable. This operation is more expensive than the <code>containsKey</code> method.<p> Note that this method is identical in functionality to containsValue, (which is part of the Map interface in the collections framework).<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>value</CODE> - a value to search for.<DT><B>Returns:</B><DD><code>true</code> if and only if some key maps to the <code>value</code> argument in this hashtable as determined by the <tt>equals</tt> method; <code>false</code> otherwise.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if the value is <code>null</code>.<DT><B>See Also: </B><DD><A HREF="../../java/util/Hashtable.html#containsKey(java.lang.Object)"><CODE>containsKey(Object)</CODE></A>, <A HREF="../../java/util/Hashtable.html#containsValue(java.lang.Object)"><CODE>containsValue(Object)</CODE></A>, <A HREF="../../java/util/Map.html"><CODE>Map</CODE></A></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> value)</PRE><DL><DD>Returns true if this Hashtable maps one or more keys to this value.<p> Note that this method is identical in functionality to contains (which predates the Map interface).<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></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>value</CODE> - value whose presence in this Hashtable is to be tested.<DT><B>Returns:</B><DD><tt>true</tt> if this map maps one or more keys to the specified value.<DT><B>Since: </B><DD>1.2</DD><DT><B>See Also: </B><DD><A HREF="../../java/util/Map.html"><CODE>Map</CODE></A></DL></DD></DL><HR><A NAME="containsKey(java.lang.Object)"><!-- --></A><H3>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -