An implementation of the
java.util.Stack API that is based on an
ArrayList instead of a Vector , so it is not
synchronized to protect against multi-threaded access. The implementation
is therefore operates faster in environments where you do not need to
worry about multiple thread contention.
The removal order of an ArrayStack is based on insertion
order: The most recently added element is removed first. The iteration
order is not the same as the removal order. The iterator returns
elements from the bottom up, whereas the
ArrayStack.remove() method removes
them from the top down.
Unlike Stack , ArrayStack accepts null entries.
Note: this class should be bytecode-identical to the
version in commons collections. This is required to allow backwards
compability with both previous versions of BeanUtils and also allow
coexistance with both collections 2.1 and 3.0.
See Also: java.util.Stack since: Commons Collections 1.0 version: $Revision: 555824 $ $Date: 2007-07-13 01:27:15 +0100 (Fri, 13 Jul 2007) $ author: Craig R. McClanahan author: Paul Jack author: Stephen Colebourne |