JIVE Platform
Release 0.3.1

edu.bsu.cs.jive.util
Class UnmodifiableStack<T>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector<E>
              extended by java.util.Stack<T>
                  extended by 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

Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
UnmodifiableStack()
          Create a new empty unmodifiable stack.
UnmodifiableStack(Stack<T> source)
          Copy constructor
 
Method Summary
 boolean add(T o)
           
 boolean addAll(Collection<? extends T> c)
           
 boolean addAll(int index, Collection<? extends T> c)
           
 void addElement(T obj)
           
 void insertElementAt(T obj, int index)
           
 T pop()
           
 T push(T item)
           
 T remove(int index)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> c)
           
 void removeAllElements()
           
 boolean removeElement(Object obj)
           
 void removeElementAt(int index)
           
protected  void removeRange(int fromIndex, int toIndex)
           
 boolean retainAll(Collection<?> c)
           
 T set(int index, T element)
           
 void setElementAt(T obj, int index)
           
 void setSize(int newSize)
           
 
Methods inherited from class java.util.Stack
empty, peek, search
 
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
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

UnmodifiableStack

public UnmodifiableStack()
Create a new empty unmodifiable stack.


UnmodifiableStack

public UnmodifiableStack(Stack<T> source)
Copy constructor

Parameters:
source -
Method Detail

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>

JIVE Platform
Release 0.3.1