commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ra...@apache.org
Subject svn commit: r397445 - /jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/util/ArrayIterator.java
Date Thu, 27 Apr 2006 06:46:33 GMT
Author: rahul
Date: Wed Apr 26 23:46:32 2006
New Revision: 397445

URL: http://svn.apache.org/viewcvs?rev=397445&view=rev
Log:
Conform to checkstyle. No functional change.


Modified:
    jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/util/ArrayIterator.java

Modified: jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/util/ArrayIterator.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/util/ArrayIterator.java?rev=397445&r1=397444&r2=397445&view=diff
==============================================================================
--- jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/util/ArrayIterator.java
(original)
+++ jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/util/ArrayIterator.java
Wed Apr 26 23:46:32 2006
@@ -42,10 +42,9 @@
  * @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
  * @version $Id$
  */
-public class ArrayIterator implements Iterator
-{
+public class ArrayIterator implements Iterator {
     /**
-     * The objects to iterate.
+     * The objects to iterate over.
      */
     private final Object array;
 
@@ -53,6 +52,10 @@
      * The current position and size in the array.
      */
     private int pos;
+
+    /**
+     * The size of the array.
+     */
     private final int size;
 
     /**
@@ -60,23 +63,21 @@
      *
      * @param array The array for which an iterator is desired.
      */
-    public ArrayIterator(Object array)
-    {
+    public ArrayIterator(Object array) {
         /*
          * if this isn't an array, then throw.  Note that this is 
          * for internal use - so this should never happen - if it does
          *  we screwed up.
          */
          
-        if ( !array.getClass().isArray() )
-        {   
-            throw new IllegalArgumentException( 
-                "Programmer error : internal ArrayIterator invoked w/o array");
+        if (!array.getClass().isArray()) {
+            throw new IllegalArgumentException("Programmer error :"
+                      + " internal ArrayIterator invoked w/o array");
         }
             
         this.array = array;
         pos = 0;
-        size = Array.getLength( this.array );
+        size = Array.getLength(this.array);
     }
 
     /**
@@ -84,17 +85,17 @@
      *
      * @return The next object in the array.
      */
-    public Object next()
-    {
-        if (pos < size )
-            return Array.get( array, pos++);
+    public Object next() {
+        if (pos < size) {
+            return Array.get(array, pos++);
+        }
                 
         /*
          *  we screwed up...
          */
          
-        throw new NoSuchElementException("No more elements: " + pos +
-                                         " / " + size);
+        throw new NoSuchElementException("No more elements: " + pos
+                                         + " / " + size);
     }
     
     /**
@@ -102,16 +103,14 @@
      *
      * @return Whether there is another element.
      */
-    public boolean hasNext()
-    {
-        return (pos < size );
+    public boolean hasNext() {
+        return (pos < size);
     }
 
     /**
      * No op--merely added to satify the <code>Iterator</code> interface.
      */
-    public void remove()
-    {
+    public void remove() {
         throw new UnsupportedOperationException();
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message