JAL-3725 restrict mapped virtual feature location to mapped region
[jalview.git] / src / jalview / datamodel / AllColsIterator.java
index c7a0bb1..1ff6a66 100644 (file)
@@ -38,7 +38,8 @@ public class AllColsIterator implements Iterator<Integer>
 
   private int current;
 
-  public AllColsIterator(int firstcol, int lastcol, HiddenColumns hiddenCols)
+  public AllColsIterator(int firstcol, int lastcol,
+          HiddenColumns hiddenCols)
   {
     last = lastcol;
     next = firstcol;
@@ -48,13 +49,13 @@ public class AllColsIterator implements Iterator<Integer>
   @Override
   public boolean hasNext()
   {
-    return current + 1 <= last;
+    return next <= last;
   }
 
   @Override
   public Integer next()
   {
-    if (current + 1 > last)
+    if (next > last)
     {
       throw new NoSuchElementException();
     }
@@ -70,4 +71,3 @@ public class AllColsIterator implements Iterator<Integer>
     throw new UnsupportedOperationException();
   }
 }
-