📄 hashtable.html
字号:
<BR> Determine if table is empty.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html">Iterator</A></CODE></FONT></TD><TD><CODE><B><A HREF="../structure/Hashtable.html#iterator()">iterator</A></B>()</CODE><BR> Returns a traversal that traverses over the values of the hashtable.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html">Iterator</A></CODE></FONT></TD><TD><CODE><B><A HREF="../structure/Hashtable.html#keys()">keys</A></B>()</CODE><BR> Get a traversal over the keys of the hashtable.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../structure/Set.html">Set</A></CODE></FONT></TD><TD><CODE><B><A HREF="../structure/Hashtable.html#keySet()">keySet</A></B>()</CODE><BR> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected int</CODE></FONT></TD><TD><CODE><B><A HREF="../structure/Hashtable.html#locate(java.lang.Object)">locate</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> key)</CODE><BR> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../structure/Hashtable.html#put(java.lang.Object, java.lang.Object)">put</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> key, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> value)</CODE><BR> Place a key-value pair within the table.</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="../structure/Hashtable.html#putAll(structure.Map)">putAll</A></B>(<A HREF="../structure/Map.html">Map</A> other)</CODE><BR> Put all of the values found in another map into this map, overriding previous key-value associations.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../structure/Hashtable.html#remove(java.lang.Object)">remove</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> key)</CODE><BR> Remove a key-value pair from the table.</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="../structure/Hashtable.html#size()">size</A></B>()</CODE><BR> Return the number of key-value pairs within the table.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../structure/Hashtable.html#toString()">toString</A></B>()</CODE><BR> Generate a string representation of the hash table.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../structure/Structure.html">Structure</A></CODE></FONT></TD><TD><CODE><B><A HREF="../structure/Hashtable.html#values()">values</A></B>()</CODE><BR> </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="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#<clinit>()"><clinit></A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#clone()">clone</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#finalize()">finalize</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#getClass()">getClass</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#notify()">notify</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#registerNatives()">registerNatives</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait()">wait</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait(long)">wait</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_structure.Map"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from interface structure.<A HREF="../structure/Map.html">Map</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../structure/Map.html#equals(java.lang.Object)">equals</A>, <A HREF="../structure/Map.html#hashCode()">hashCode</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="reserved"><!-- --></A><H3>reserved</H3><PRE>protected static <A HREF="../structure/Association.html">Association</A> <B>reserved</B></PRE><DL><DD>A single key-value pair to be used as a token indicating a reserved location in the hashtable. Reserved locations are available for insertion, but cause collisions on lookup.</DL><HR><A NAME="data"><!-- --></A><H3>data</H3><PRE>protected <A HREF="../structure/Association.html">Association</A>[] <B>data</B></PRE><DL><DD>The data associated with the hashtable.</DL><HR><A NAME="count"><!-- --></A><H3>count</H3><PRE>protected int <B>count</B></PRE><DL><DD>The number of key-value pairs in table.</DL><HR><A NAME="capacity"><!-- --></A><H3>capacity</H3><PRE>protected int <B>capacity</B></PRE><DL><DD>The size of the hashtable</DL><HR><A NAME="loadFactor"><!-- --></A><H3>loadFactor</H3><PRE>protected final double <B>loadFactor</B></PRE><DL><DD>Load factor that causes rehashing of the table.</DL><!-- ========= 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)"><!-- --></A><H3>Hashtable</H3><PRE>public <B>Hashtable</B>(int initialCapacity)</PRE><DL><DD>Construct a hash table that is capable of holding at least initialCapacity values. If that value is approached, it will be expanded appropriately. It is probably best if the capacity is prime. Table is initially empty.<DD><DL><DT><B>Parameters:</B><DD><CODE>initialCapacity</CODE> - The initial capacity of the hash table.</DL></DD></DL><HR><A NAME="Hashtable()"><!-- --></A><H3>Hashtable</H3><PRE>public <B>Hashtable</B>()</PRE><DL><DD>Construct a hash table that is initially empty.</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="clear()"><!-- --></A><H3>clear</H3><PRE>public void <B>clear</B>()</PRE><DL><DD>Remove all key-value pairs from hashtable.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../structure/Map.html#clear()">clear</A></CODE> in interface <CODE><A HREF="../structure/Map.html">Map</A></CODE></DL></DD><DD><DL><DT><B>Postcondition:</B><DD>removes all elements from Hashtable</DL></DD></DL><HR><A NAME="size()"><!-- --></A><H3>size</H3><PRE>public int <B>size</B>()</PRE><DL><DD>Return the number of key-value pairs within the table.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../structure/Map.html#size()">size</A></CODE> in interface <CODE><A HREF="../structure/Map.html">Map</A></CODE></DL></DD><DD><DL><DT><B>Postcondition:</B><DD>returns number of elements in hash table<DT><B>Returns:</B><DD>The number of key-value pairs currently in table.</DL></DD></DL><HR><A NAME="isEmpty()"><!-- --></A><H3>isEmpty</H3><PRE>public boolean <B>isEmpty</B>()</PRE><DL><DD>Determine if table is empty.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../structure/Map.html#isEmpty()">isEmpty</A></CODE> in interface <CODE><A HREF="../structure/Map.html">Map</A></CODE></DL></DD><DD><DL><DT><B>Postcondition:</B><DD>returns true iff hash table has 0 elements<DT><B>Returns:</B><DD>True if table is empty.</DL></DD></DL><HR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -