Package mondrian.util

Class ArrayStack<E>

  • Type Parameters:
    E - Element type
    All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.List<E>, java.util.RandomAccess

    public class ArrayStack<E>
    extends java.util.ArrayList<E>
    Stack implementation based on ArrayList.

    More efficient than Stack, which extends Vector and is therefore synchronized whether you like it or not.

    Author:
    jhyde
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      E peek()
      Analogous to Stack.peek().
      E pop()
      Analogous to Stack.pop().
      E push​(E item)
      Analogous to Stack.push(E).
      • Methods inherited from class java.util.ArrayList

        add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
      • Methods inherited from class java.util.AbstractCollection

        containsAll, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, stream, toArray
      • Methods inherited from interface java.util.List

        containsAll
    • Constructor Detail

      • ArrayStack

        public ArrayStack()
        Default constructor.
      • ArrayStack

        public ArrayStack​(ArrayStack<E> toCopy)
        Copy Constructor
        Parameters:
        toCopy - Instance of ArrayStack to copy.
    • Method Detail

      • push

        public E push​(E item)
        Analogous to Stack.push(E).
      • pop

        public E pop()
        Analogous to Stack.pop().
      • peek

        public E peek()
        Analogous to Stack.peek().