jds
Interface Stack
- All Known Subinterfaces:
- Deque
- All Known Implementing Classes:
- Vector
- public abstract interface Stack
- extends Collection
Stack - collection with LIFO behavior;
for use with book
Classic Data Structures
in Java
by Timothy A Budd,
published by Addison-Wesley, 2001.
- See Also:
Collection
Fields inherited from class java.io.Serializable |
serialVersionUID |
Method Summary |
void |
addLast(java.lang.Object value)
add a new value to end of the collection |
java.lang.Object |
getLast()
access the last value in collection |
void |
removeLast()
remove last value in collection |
addLast
public void addLast(java.lang.Object value)
- add a new value to end of the collection
- Parameters:
value
- element to be inserted into collection
getLast
public java.lang.Object getLast()
- access the last value in collection
- Returns:
- element at top of collection
- Throws:
- java.util.NoSuchElementException - no matching value
removeLast
public void removeLast()
- remove last value in collection
- Throws:
- java.util.NoSuchElementException - no matching value