Code formating and whitespace cleanup
[jpim.git] / src / de / j32 / util / FilteredIterator.java
index 26ad1f0..585a537 100644 (file)
@@ -3,52 +3,48 @@ package de.j32.util;
 import java.util.Iterator;
 import java.util.NoSuchElementException;
 
-
-public class FilteredIterator<E>
-       implements Iterator<E>
+public class FilteredIterator<E> implements Iterator<E>
 {
-       Iterator<E> base_;
-       Filter<E> filter_;
-       E next_;
-       boolean hasNext_ = true;
-
-       public FilteredIterator(Iterator<E> base, Filter<E> filter)
-       {
-               base_ = base;
-               filter_ = filter;
-               advance();
-       }
-       
-       public E next()
-       {
-               if (hasNext_) {
-                       E rv = next_;
-                       advance();
-                       return rv;
-               }
-               else 
-                       throw new NoSuchElementException();
-       }
-       
-       public boolean hasNext()
-       {
-               return hasNext_;
-       }
-       
-       public void remove()
-       {
-               throw new UnsupportedOperationException();
-       }
-       
-       void advance()
-       {
-               while (base_.hasNext()) {
-                       next_ = base_.next();
-                       if (filter_.match(next_))
-                               return;
-               }
-               hasNext_ = false;
-               next_ = null;
-       }
+    Iterator<E> base_;
+    Filter<E> filter_;
+    E next_;
+    boolean hasNext_ = true;
+
+    public FilteredIterator(Iterator<E> base, Filter<E> filter)
+    {
+        base_ = base;
+        filter_ = filter;
+        advance();
+    }
+
+    public E next()
+    {
+        if (hasNext_) {
+            E rv = next_;
+            advance();
+            return rv;
+        }
+        else throw new NoSuchElementException();
+    }
+
+    public boolean hasNext()
+    {
+        return hasNext_;
+    }
+
+    public void remove()
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    void advance()
+    {
+        while (base_.hasNext()) {
+            next_ = base_.next();
+            if (filter_.match(next_)) return;
+        }
+        hasNext_ = false;
+        next_ = null;
+    }
 
 }