📄 stack.html
字号:
<TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../structure/Structure.html#clear()">clear</A>, <A HREF="../structure/Structure.html#contains(java.lang.Object)">contains</A>, <A HREF="../structure/Structure.html#elements()">elements</A>, <A HREF="../structure/Structure.html#isEmpty()">isEmpty</A>, <A HREF="../structure/Structure.html#iterator()">iterator</A>, <A HREF="../structure/Structure.html#remove(java.lang.Object)">remove</A>, <A HREF="../structure/Structure.html#values()">values</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ 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="add(java.lang.Object)"><!-- --></A><H3>add</H3><PRE>public void <B>add</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> item)</PRE><DL><DD>Add an element from the top of the stack.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../structure/Linear.html#add(java.lang.Object)">add</A></CODE> in interface <CODE><A HREF="../structure/Linear.html">Linear</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>item</CODE> - The element to be added to the stack top.<DT><B>Postcondition:</B><DD>item is added to stack will be popped next if no intervening add<DT><B>See Also: </B><DD><A HREF="../structure/Stack.html#push(java.lang.Object)"><CODE>push(java.lang.Object)</CODE></A></DL></DD></DL><HR><A NAME="push(java.lang.Object)"><!-- --></A><H3>push</H3><PRE>public void <B>push</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> item)</PRE><DL><DD>Add an element to top of stack.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>item</CODE> - The value to be added to the top of the stack.<DT><B>Postcondition:</B><DD>item is added to stack will be popped next if no intervening push</DL></DD></DL><HR><A NAME="remove()"><!-- --></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>()</PRE><DL><DD>Remove an element from the top of the stack.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../structure/Linear.html#remove()">remove</A></CODE> in interface <CODE><A HREF="../structure/Linear.html">Linear</A></CODE></DL></DD><DD><DL><DT><B>Precondition:</B><DD>stack is not empty<DT><B>Postcondition:</B><DD>most recently added item is removed and returned<DT><B>Returns:</B><DD>The item removed from the top of the stack.<DT><B>See Also: </B><DD><A HREF="../structure/Stack.html#pop()"><CODE>pop()</CODE></A></DL></DD></DL><HR><A NAME="pop()"><!-- --></A><H3>pop</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> <B>pop</B>()</PRE><DL><DD>Remove an element from the top of the stack.<DD><DL></DL></DD><DD><DL><DT><B>Precondition:</B><DD>stack is not empty<DT><B>Postcondition:</B><DD>most recently pushed item is removed and returned<DT><B>Returns:</B><DD>A reference to the removed element.</DL></DD></DL><HR><A NAME="get()"><!-- --></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>()</PRE><DL><DD>Fetch a reference to the top element of the stack.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../structure/Linear.html#get()">get</A></CODE> in interface <CODE><A HREF="../structure/Linear.html">Linear</A></CODE></DL></DD><DD><DL><DT><B>Precondition:</B><DD>stack is not empty<DT><B>Postcondition:</B><DD>top value (next to be popped) is returned<DT><B>Returns:</B><DD>A reference to the top element of the stack.</DL></DD></DL><HR><A NAME="getFirst()"><!-- --></A><H3>getFirst</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> <B>getFirst</B>()</PRE><DL><DD>Fetch a reference to the top element of the stack.<DD><DL></DL></DD><DD><DL><DT><B>Precondition:</B><DD>stack is not empty<DT><B>Postcondition:</B><DD>top value (next to be popped) is returned<DT><B>Returns:</B><DD>A reference to the top element of the stack.</DL></DD></DL><HR><A NAME="peek()"><!-- --></A><H3>peek</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> <B>peek</B>()</PRE><DL><DD>Fetch a reference to the top element of the stack.<DD><DL></DL></DD><DD><DL><DT><B>Precondition:</B><DD>stack is not empty<DT><B>Postcondition:</B><DD>top value (next to be popped) is returned<DT><B>Returns:</B><DD>A reference to the top element of the stack.</DL></DD></DL><HR><A NAME="empty()"><!-- --></A><H3>empty</H3><PRE>public boolean <B>empty</B>()</PRE><DL><DD>Returns true iff the stack is empty. Provided for compatibility with java.util.Vector.empty.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../structure/Linear.html#empty()">empty</A></CODE> in interface <CODE><A HREF="../structure/Linear.html">Linear</A></CODE></DL></DD><DD><DL><DT><B>Postcondition:</B><DD>returns true if and only if the stack is empty<DT><B>Returns:</B><DD>True iff the stack is empty.</DL></DD></DL><HR><A NAME="size()"><!-- --></A><H3>size</H3><PRE>public int <B>size</B>()</PRE><DL><DD>Returns the number of elements in the stack.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../structure/Linear.html#size()">size</A></CODE> in interface <CODE><A HREF="../structure/Linear.html">Linear</A></CODE></DL></DD><DD><DL><DT><B>Postcondition:</B><DD>returns the number of elements in the stack<DT><B>Returns:</B><DD>number of elements in stack.</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/Set.html"><B>PREV CLASS</B></A> <A HREF="../structure/Structure.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="Stack.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <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 + -