public class SimpleStack<E> extends Object implements Stack<E>
| 构造器和说明 |
|---|
SimpleStack() |
SimpleStack(Collection<E> list) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
add(E e) |
boolean |
addAll(Collection<? extends E> c) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
boolean |
isEmpty() |
Iterator<E> |
iterator() |
E |
peek()
Looks at the object at the top of this stack without removing it
from the stack.
|
E |
pop()
Removes the object at the top of this stack and returns that
object as the value of this function.
|
E |
push(E item)
Pushes an item onto the top of this stack.
|
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
search(Object o)
Returns the 1-based position where an object is on this stack.
|
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequals, hashCode, parallelStream, removeIf, spliterator, streampublic SimpleStack()
public SimpleStack(Collection<E> list)
public E push(E item)
StackaddElement(item)
push 在接口中 Stack<E>item - the item to be pushed onto this stack.item argument.Vector.addElement(E)public E pop()
Stackpublic E peek()
Stackpublic int search(Object o)
Stackpublic int size()
size 在接口中 Collection<E>public boolean isEmpty()
isEmpty 在接口中 Collection<E>public boolean contains(Object o)
contains 在接口中 Collection<E>public Object[] toArray()
toArray 在接口中 Collection<E>public <T> T[] toArray(T[] a)
toArray 在接口中 Collection<E>public boolean add(E e)
add 在接口中 Collection<E>public boolean remove(Object o)
remove 在接口中 Collection<E>public boolean containsAll(Collection<?> c)
containsAll 在接口中 Collection<E>public boolean addAll(Collection<? extends E> c)
addAll 在接口中 Collection<E>public boolean removeAll(Collection<?> c)
removeAll 在接口中 Collection<E>public boolean retainAll(Collection<?> c)
retainAll 在接口中 Collection<E>public void clear()
clear 在接口中 Collection<E>Copyright © 2020. All rights reserved.