done
Scott Sanders wrote:
>
> Since I am not a committer yet, this is a patch to get Digester to
> compile using collections instead of Struts ;-)
>
> Index: src/java/org/apache/commons/collections/ArrayStack.java
> ===================================================================
> RCS file:
>
>/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/ArrayStack.java,v
> retrieving revision 1.1
> diff -u -w -u -r1.1 ArrayStack.java
> --- src/java/org/apache/commons/collections/ArrayStack.java
> 2001/04/14 19:32:37 1.1
> +++ src/java/org/apache/commons/collections/ArrayStack.java
> 2001/04/16 22:31:21
> @@ -112,6 +112,26 @@
>
> /**
> + * Return the n'th item down (zero-relative) from the top of this
> + * stack without removing it.
> + *
> + * @param n Number of items down to go
> + *
> + * @exception EmptyStackException if there are not enough items on the
> + * stack to satisfy this request
> + */
> + public Object peek(int n) throws EmptyStackException {
> +
> + int m = (size() - n) - 1;
> + if (m < 0)
> + throw new EmptyStackException();
> + else
> + return (get(m));
> +
> + }
> +
> +
> + /**
> * Pop the top item off of this stack and return it.
> *
> * @exception EmptyStackException if the stack is empty
--
Geir Magnusson Jr. [EMAIL PROTECTED]
Developing for the web? See http://jakarta.apache.org/velocity/