jvanzyl 00/10/12 08:00:15
Modified: src/java/org/apache/velocity/util ArrayIterator.java
Log:
- update javadoc.
Revision Changes Path
1.2 +15 -8
jakarta-velocity/src/java/org/apache/velocity/util/ArrayIterator.java
Index: ArrayIterator.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/util/ArrayIterator.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ArrayIterator.java 2000/10/12 14:56:21 1.1
+++ ArrayIterator.java 2000/10/12 15:00:15 1.2
@@ -1,9 +1,9 @@
package org.apache.velocity.util;
/*
- * $Header:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/util/ArrayIterator.java,v 1.1
2000/10/12 14:56:21 jvanzyl Exp $
- * $Revision: 1.1 $
- * $Date: 2000/10/12 14:56:21 $
+ * $Header:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/util/ArrayIterator.java,v 1.2
2000/10/12 15:00:15 jvanzyl Exp $
+ * $Revision: 1.2 $
+ * $Date: 2000/10/12 15:00:15 $
*
* ====================================================================
*
@@ -66,21 +66,26 @@
import java.util.Iterator;
import java.util.NoSuchElementException;
-// Added to avoid the conversion of [] to Vector - reduce garbage + cleaner
-// code is similar to VectorEnumeration in java.util.Vector
-
+/**
+ * An Iterator wrapper for an Object[]. This will
+ * allow us to deal with all array like structures
+ * in a consistent manner.
+ */
public class ArrayIterator implements Iterator
{
-
+ /** Object[] to place an iterator wrapper around */
Object array[];
+ /** Current position in the array */
int pos;
+ /** Default constructor */
public ArrayIterator(Object array[])
{
this.array = array;
pos = 0;
}
+ /** Move to next element in the array. */
public Object next()
{
synchronized (array)
@@ -92,12 +97,14 @@
" / " + array.length);
}
-
+
+ /** Check to see if there is another element in the array. */
public boolean hasNext()
{
return pos < array.length;
}
+ /** NOT USED: Merely added to satify the Iterator interface. */
public void remove()
{
}