📄 table.html
字号:
<A NAME="data"><!-- --></A><H3>data</H3><PRE>protected <A HREF="../structure/OrderedStructure.html">OrderedStructure</A> <B>data</B></PRE><DL><DD>An ordered structure that maintains the ComparableAssociations that store the key-value pairings.</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="Table()"><!-- --></A><H3>Table</H3><PRE>public <B>Table</B>()</PRE><DL><DD>Construct a new, empty table.</DL><HR><A NAME="Table(structure.Table)"><!-- --></A><H3>Table</H3><PRE>public <B>Table</B>(<A HREF="../structure/Table.html">Table</A> other)</PRE><DL></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="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>Retrieve the value associated with the key provided. Be aware, the value may be null.<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 of the key-value pair sought.<DT><B>Precondition:</B><DD>key is a 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 key.</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>Enter a key-value pair into the table. if the key is already in the table, the old value is returned, and the old key-value pair is replaced. Otherwise null is returned. The user is cautioned that a null value returned may indicate there was no prior key-value pair, or --- if null values are inserted --- that the key was previously associated with a null value.<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 unique key in the table.<DD><CODE>value</CODE> - The (possibly null) 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 table<DT><B>Returns:</B><DD>The prior value, or null if no prior value found.</DL></DD></DL><HR><A NAME="isEmpty()"><!-- --></A><H3>isEmpty</H3><PRE>public boolean <B>isEmpty</B>()</PRE><DL><DD>Determine if the 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 table is empty<DT><B>Returns:</B><DD>True iff the table has no elements.</DL></DD></DL><HR><A NAME="clear()"><!-- --></A><H3>clear</H3><PRE>public void <B>clear</B>()</PRE><DL><DD>Remove all the elements of the table.<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 the table</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>Construct an iterator over the keys of the table. The order of the keys returned is in ascending order. It will be consistent with that of the iterator from elements, provided the table is not modified.<DD><DL></DL></DD><DD><DL><DT><B>Postcondition:</B><DD>returns an iterator for traversing keys of table<DT><B>Returns:</B><DD>An iterator over the keys of the 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>Construct an iterator over the values of the table. The order of the values returned is determined by order of keys. It will be consistent with that of the iterator returned from keys, provided the table is not modified.<DD><DL></DL></DD><DD><DL><DT><B>Postcondition:</B><DD>returns an iterator for traversing values in table<DT><B>Returns:</B><DD>An iterator over the values of 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>Determine if the key is in the table. The key should not be null.<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> - A non-null key sought in the table.<DT><B>Precondition:</B><DD>key is non-null object<DT><B>Postcondition:</B><DD>returns true iff key indexes a value in table<DT><B>Returns:</B><DD>True iff the key is used in association with some value.</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 the value is associated with some key in the table. This is often difficult to implement efficiently.<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 (possibly null).<DT><B>Precondition:</B><DD>value is non-null object<DT><B>Postcondition:</B><DD>returns true iff value in table<DT><B>Returns:</B><DD>True, if the value is associated with some key in table.</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, based on key. The value is returned.<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 value indexed in table<DT><B>Returns:</B><DD>The value associated with key, no longer in table.</DL></DD></DL><HR><A NAME="size()"><!-- --></A><H3>size</H3><PRE>public int <B>size</B>()</PRE><DL><DD>Determine 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 key-value pairs in table<DT><B>Returns:</B><DD>The number of key-value pairs in 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>Return a set containing the keys referenced by this data structure.<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><DD><DL><DT><B>Postcondition:</B><DD>Returns a set containing the keys referenced by this data structure.<DT><B>Returns:</B><DD>a set containing the key referenced by this data structure.</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>Return a structure containing all the values referenced by this data structure.<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><DD><DL><DT><B>Postcondition:</B><DD>Returns a structure containing all the values referenced by this data structure.<DT><B>Returns:</B><DD>a structure containing all the values referenced by this data structure.</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>Return a structure containing all the entries in this Table<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><DD><DL><DT><B>Postcondition:</B><DD>Returns a structure containing all the entries in this Table<DT><B>Returns:</B><DD>a structure containing all the entries in this Table</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>Construct a string representing value of 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 string representation<DT><B>Returns:</B><DD>String representing table.</DL></DD></DL><HR><A NAME="main(java.lang.String[])"><!-- --></A><H3>main</H3><PRE>public static void <B>main</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A>[] argv)</PRE><DL><DD><DL></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/StructCollection.html"><B>PREV CLASS</B></A> <A HREF="../structure/ValueIterator.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="Table.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 + -