📄 chainedhashtable.html
字号:
</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="data"><!-- --></A><H3>data</H3><PRE>protected <A HREF="../structure/List.html">List</A>[] <B>data</B></PRE><DL><DD>The array of chains used to store values.</DL><HR><A NAME="count"><!-- --></A><H3>count</H3><PRE>protected int <B>count</B></PRE><DL><DD>The number of key-value pairs stored within the table.</DL><HR><A NAME="capacity"><!-- --></A><H3>capacity</H3><PRE>protected int <B>capacity</B></PRE><DL><DD>The length 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="ChainedHashtable(int)"><!-- --></A><H3>ChainedHashtable</H3><PRE>public <B>ChainedHashtable</B>(int size)</PRE><DL><DD>Constructs a hashtable with capacity for at size elements before chaining is absolutely required.<DD><DL><DT><B>Parameters:</B><DD><CODE>size</CODE> - The number of entries initially allocated.</DL></DD></DL><HR><A NAME="ChainedHashtable()"><!-- --></A><H3>ChainedHashtable</H3><PRE>public <B>ChainedHashtable</B>()</PRE><DL><DD>Constructs a reasonably large hashtable.</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>Removes the values from the 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 the elements from the ChainedHashtable</DL></DD></DL><HR><A NAME="size()"><!-- --></A><H3>size</H3><PRE>public int <B>size</B>()</PRE><DL><DD>Computes the number of elements stored within the hashtable.<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 elements within the hash table.</DL></DD></DL><HR><A NAME="isEmpty()"><!-- --></A><H3>isEmpty</H3><PRE>public boolean <B>isEmpty</B>()</PRE><DL><DD>Returns true if no elements are stored within the table.<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 iff size() == 0.</DL></DD></DL><HR><A NAME="locate(java.lang.Object)"><!-- --></A><H3>locate</H3><PRE>protected <A HREF="../structure/List.html">List</A> <B>locate</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> key)</PRE><DL><DD><DL></DL></DD></DL><HR><A NAME="containsValue(java.lang.Object)"><!-- --></A><H3>containsValue</H3><PRE>public boolean <B>containsValue</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> value)</PRE><DL><DD>Returns true if a specific value appears within the table.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../structure/Map.html#containsValue(java.lang.Object)">containsValue</A></CODE> in interface <CODE><A HREF="../structure/Map.html">Map</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>value</CODE> - The value sought.<DT><B>Precondition:</B><DD>value is non-null Object<DT><B>Postcondition:</B><DD>returns true iff hash table contains value<DT><B>Returns:</B><DD>True iff the value appears within the table.</DL></DD></DL><HR><A NAME="containsKey(java.lang.Object)"><!-- --></A><H3>containsKey</H3><PRE>public boolean <B>containsKey</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> key)</PRE><DL><DD>Returns true iff a specific key appears within the table.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../structure/Map.html#containsKey(java.lang.Object)">containsKey</A></CODE> in interface <CODE><A HREF="../structure/Map.html">Map</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - The key sought.<DT><B>Precondition:</B><DD>value is non-null key<DT><B>Postcondition:</B><DD>returns true if key appears in hash table<DT><B>Returns:</B><DD>True iff the key sought appears within table.</DL></DD></DL><HR><A NAME="iterator()"><!-- --></A><H3>iterator</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html">Iterator</A> <B>iterator</B>()</PRE><DL><DD>Returns an iterator that traverses over the values of the hashtable.<DD><DL></DL></DD><DD><DL><DT><B>Postcondition:</B><DD>returns iterator to traverse hash table<DT><B>Returns:</B><DD>A value iterator, over the values of the table.</DL></DD></DL><HR><A NAME="keySet()"><!-- --></A><H3>keySet</H3><PRE>public <A HREF="../structure/Set.html">Set</A> <B>keySet</B>()</PRE><DL><DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../structure/Map.html#keySet()">keySet</A></CODE> in interface <CODE><A HREF="../structure/Map.html">Map</A></CODE></DL></DD></DL><HR><A NAME="entrySet()"><!-- --></A><H3>entrySet</H3><PRE>public <A HREF="../structure/Set.html">Set</A> <B>entrySet</B>()</PRE><DL><DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../structure/Map.html#entrySet()">entrySet</A></CODE> in interface <CODE><A HREF="../structure/Map.html">Map</A></CODE></DL></DD></DL><HR><A NAME="values()"><!-- --></A><H3>values</H3><PRE>public <A HREF="../structure/Structure.html">Structure</A> <B>values</B>()</PRE><DL><DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../structure/Map.html#values()">values</A></CODE> in interface <CODE><A HREF="../structure/Map.html">Map</A></CODE></DL></DD></DL><HR><A NAME="get(java.lang.Object)"><!-- --></A><H3>get</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> <B>get</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> key)</PRE><DL><DD>Get the value associated with a key.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../structure/Map.html#get(java.lang.Object)">get</A></CODE> in interface <CODE><A HREF="../structure/Map.html">Map</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - The key used to find the desired value.<DT><B>Precondition:</B><DD>key is non-null Object<DT><B>Postcondition:</B><DD>returns value associated with key, or null<DT><B>Returns:</B><DD>The value associated with the desired key.</DL></DD></DL><HR><A NAME="keys()"><!-- --></A><H3>keys</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html">Iterator</A> <B>keys</B>()</PRE><DL><DD>Get an iterator over the keys of the hashtable.<DD><DL></DL></DD><DD><DL><DT><B>Postcondition:</B><DD>returns iterator to traverse the keys of hash table<DT><B>Returns:</B><DD>An iterator over the key values appearing within table.</DL></DD></DL><HR><A NAME="put(java.lang.Object, java.lang.Object)"><!-- --></A><H3>put</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> <B>put</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)</PRE><DL><DD>Place a key-value pair within the table.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../structure/Map.html#put(java.lang.Object, java.lang.Object)">put</A></CODE> in interface <CODE><A HREF="../structure/Map.html">Map</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - The key to be added to table.<DD><CODE>value</CODE> - The value associated with key.<DT><B>Precondition:</B><DD>key is non-null object<DT><B>Postcondition:</B><DD>key-value pair is added to hash table<DT><B>Returns:</B><DD>The old value associated with key if previously present.</DL></DD></DL><HR><A NAME="remove(java.lang.Object)"><!-- --></A><H3>remove</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> <B>remove</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> key)</PRE><DL><DD>Remove a key-value pair from the table.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../structure/Map.html#remove(java.lang.Object)">remove</A></CODE> in interface <CODE><A HREF="../structure/Map.html">Map</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - The key of the key-value pair to be removed.<DT><B>Precondition:</B><DD>key is non-null object<DT><B>Postcondition:</B><DD>removes key-value pair associated with key<DT><B>Returns:</B><DD>The value associated with the removed key.</DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A> <B>toString</B>()</PRE><DL><DD>Generate a string representation of the chained hash table.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#toString()">toString</A></CODE> in class <CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Postcondition:</B><DD>returns a string representation of hash table<DT><B>Returns:</B><DD>The string representing the table.</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="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="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-all.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><a href=../copyright.html target=_top>© 1998-2002 McGraw-Hill</a></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../structure/BTPreorderIterator.html"><B>PREV CLASS</B></A> <A HREF="../structure/ChainedHashtableIterator.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="ChainedHashtable.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -