📄 datastructures.stackar.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Sun Sep 27 09:53:42 EDT 1998
-->
<title>
Class DataStructures.StackAr
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a> <a href="tree.html">Class Hierarchy</a> <a href="Package-DataStructures.html">This Package</a> <a href="DataStructures.SplayTree.html">Previous</a> <a href="DataStructures.StackLi.html">Next</a> <a href="Index.html">Index</a> </pre>
<hr>
<h1>
Class DataStructures.StackAr
</h1>
<pre>
java.lang.Object
|
+----DataStructures.StackAr
</pre>
<hr>
<dl>
<dt>public class <b>StackAr</b>
<dt>extends Object</dl>
Array-based implementation of the stack.
<p>
<hr>
<a name="index"></a><h2>
<img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
<dt><img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#StackAr()"><b>StackAr</b></a>()
<dd>Construct the stack.
<dt><img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#StackAr(int)"><b>StackAr</b></a>(int)
<dd>Construct the stack.
</dl>
<h2>
<img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
<dt><img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#isEmpty()"><b>isEmpty</b></a>()
<dd>Test if the stack is logically empty.
<dt><img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#isFull()"><b>isFull</b></a>()
<dd>Test if the stack is logically full.
<dt><img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#main(java.lang.String[])"><b>main</b></a>(String[])
<dd>
<dt><img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#makeEmpty()"><b>makeEmpty</b></a>()
<dd>Make the stack logically empty.
<dt><img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#pop()"><b>pop</b></a>()
<dd>Remove the most recently inserted item from the stack.
<dt><img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#push(java.lang.Object)"><b>push</b></a>(Object)
<dd>Insert a new item into the stack, if not already full.
<dt><img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#top()"><b>top</b></a>()
<dd>Get the most recently inserted item in the stack.
<dt><img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#topAndPop()"><b>topAndPop</b></a>()
<dd>Return and remove most recently inserted item from the stack.
</dl>
<a name="constructors"></a><h2>
<img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="StackAr"></a><a name="StackAr"></a><a name="StackAr()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o ">
</a><b>StackAr</b>
<pre>
public StackAr()</pre>
<dl>
<dd>Construct the stack.
<p>
</dl>
<a name="StackAr"></a><a name="StackAr(int)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o ">
</a><b>StackAr</b>
<pre>
public StackAr(int capacity)</pre>
<dl>
<dd>Construct the stack.
<p>
<dd><dl>
<dt><b>Parameters:</b>
<dd>capacity - the capacity.
</dl>
</dd>
</dl>
<a name="methods"></a><h2>
<img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="isEmpty"></a><a name="isEmpty()"><img src="images/red-ball.gif" width=12 height=12 alt=" o ">
</a><b>isEmpty</b>
<pre>
public boolean isEmpty()</pre>
<dl>
<dd>Test if the stack is logically empty.
<p>
<dd><dl>
<dt><b>Returns:</b>
<dd>true if empty, false otherwise.</dl>
</dd>
</dl>
<a name="isFull"></a><a name="isFull()"><img src="images/red-ball.gif" width=12 height=12 alt=" o ">
</a><b>isFull</b>
<pre>
public boolean isFull()</pre>
<dl>
<dd>Test if the stack is logically full.
<p>
<dd><dl>
<dt><b>Returns:</b>
<dd>true if full, false otherwise.</dl>
</dd>
</dl>
<a name="makeEmpty"></a><a name="makeEmpty()"><img src="images/red-ball.gif" width=12 height=12 alt=" o ">
</a><b>makeEmpty</b>
<pre>
public void makeEmpty()</pre>
<dl>
<dd>Make the stack logically empty.
<p>
</dl>
<a name="top"></a><a name="top()"><img src="images/red-ball.gif" width=12 height=12 alt=" o ">
</a><b>top</b>
<pre>
public Object top()</pre>
<dl>
<dd>Get the most recently inserted item in the stack.Does not alter the stack.
<p>
<dd><dl>
<dt><b>Returns:</b>
<dd>the most recently inserted item in the stack, or null, if empty.</dl>
</dd>
</dl>
<a name="pop"></a><a name="pop()"><img src="images/red-ball.gif" width=12 height=12 alt=" o ">
</a><b>pop</b>
<pre>
public void pop() throws <a href="DataStructures.Underflow.html">Underflow</a></pre>
<dl>
<dd>Remove the most recently inserted item from the stack.
<p>
<dd><dl>
<dt><b>Throws:</b>
<a href="DataStructures.Underflow.html">Underflow</a><dd>if stack is already empty.</dl>
</dd>
</dl>
<a name="push"></a><a name="push(java.lang.Object)"><img src="images/red-ball.gif" width=12 height=12 alt=" o ">
</a><b>push</b>
<pre>
public void push(Object x) throws <a href="DataStructures.Overflow.html">Overflow</a></pre>
<dl>
<dd>Insert a new item into the stack, if not already full.
<p>
<dd><dl>
<dt><b>Parameters:</b>
<dd>x - the item to insert.
<dt><b>Throws:</b>
<a href="DataStructures.Overflow.html">Overflow</a><dd>if stack is already full.</dl>
</dd>
</dl>
<a name="topAndPop"></a><a name="topAndPop()"><img src="images/red-ball.gif" width=12 height=12 alt=" o ">
</a><b>topAndPop</b>
<pre>
public Object topAndPop()</pre>
<dl>
<dd>Return and remove most recently inserted item from the stack.
<p>
<dd><dl>
<dt><b>Returns:</b>
<dd>most recently inserted item, or null, if stack is empty.</dl>
</dd>
</dl>
<a name="main"></a><a name="main(java.lang.String[])"><img src="images/green-ball.gif" width=12 height=12 alt=" o ">
</a><b>main</b>
<pre>
public static void main(String[] args)</pre>
<dl>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a> <a href="tree.html">Class Hierarchy</a> <a href="Package-DataStructures.html">This Package</a> <a href="DataStructures.SplayTree.html">Previous</a> <a href="DataStructures.StackLi.html">Next</a> <a href="Index.html">Index</a> </pre>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -