edu.bsu.cs.jive.util
Class UnmodifiableStack<T>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector<E>
java.util.Stack<T>
edu.bsu.cs.jive.util.UnmodifiableStack<T>
- Type Parameters:
T
- data element for the stack
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<T>, Collection<T>, List<T>, RandomAccess
public class UnmodifiableStack<T>
- extends Stack<T>
An unmodifiable view of a stack.
- See Also:
- Serialized Form
Methods inherited from class java.util.Vector |
add, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, isEmpty, lastElement, lastIndexOf, lastIndexOf, size, subList, toArray, toArray, toString, trimToSize |
UnmodifiableStack
public UnmodifiableStack()
- Create a new empty unmodifiable stack.
UnmodifiableStack
public UnmodifiableStack(Stack<T> source)
- Copy constructor
- Parameters:
source
-
pop
public T pop()
- Overrides:
pop
in class Stack<T>
push
public T push(T item)
- Overrides:
push
in class Stack<T>
add
public boolean add(T o)
- Specified by:
add
in interface Collection<T>
- Specified by:
add
in interface List<T>
- Overrides:
add
in class Vector<T>
addAll
public boolean addAll(Collection<? extends T> c)
- Specified by:
addAll
in interface Collection<T>
- Specified by:
addAll
in interface List<T>
- Overrides:
addAll
in class Vector<T>
addAll
public boolean addAll(int index,
Collection<? extends T> c)
- Specified by:
addAll
in interface List<T>
- Overrides:
addAll
in class Vector<T>
addElement
public void addElement(T obj)
- Overrides:
addElement
in class Vector<T>
insertElementAt
public void insertElementAt(T obj,
int index)
- Overrides:
insertElementAt
in class Vector<T>
remove
public T remove(int index)
- Specified by:
remove
in interface List<T>
- Overrides:
remove
in class Vector<T>
remove
public boolean remove(Object o)
- Specified by:
remove
in interface Collection<T>
- Specified by:
remove
in interface List<T>
- Overrides:
remove
in class Vector<T>
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAll
in interface Collection<T>
- Specified by:
removeAll
in interface List<T>
- Overrides:
removeAll
in class Vector<T>
removeAllElements
public void removeAllElements()
- Overrides:
removeAllElements
in class Vector<T>
removeElement
public boolean removeElement(Object obj)
- Overrides:
removeElement
in class Vector<T>
removeElementAt
public void removeElementAt(int index)
- Overrides:
removeElementAt
in class Vector<T>
removeRange
protected void removeRange(int fromIndex,
int toIndex)
- Overrides:
removeRange
in class Vector<T>
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAll
in interface Collection<T>
- Specified by:
retainAll
in interface List<T>
- Overrides:
retainAll
in class Vector<T>
set
public T set(int index,
T element)
- Specified by:
set
in interface List<T>
- Overrides:
set
in class Vector<T>
setElementAt
public void setElementAt(T obj,
int index)
- Overrides:
setElementAt
in class Vector<T>
setSize
public void setSize(int newSize)
- Overrides:
setSize
in class Vector<T>