/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.sis.util.collection;

import java.util.Iterator;
import org.apache.sis.util.Decorator;
import org.apache.sis.util.ObjectConverter;


/**
 * An iterator which performs conversions on the fly using the given converter.
 * If a value is converted into a null value, then this iterator skips that value.
 * Consequently this iterator can not returns null value.
 *
 * @param <B> The type of elements in the backing set.
 * @param <E> The type of elements in this set.
 *
 * @author  Martin Desruisseaux (IRD, Geomatys)
 * @since   0.3 (derived from geotk-2.0)
 * @version 0.3
 * @module
 */
@Decorator(Iterator.class)
final class DerivedIterator<B,E> implements Iterator<E> {
    /**
     * The original iterator to wrap.
     */
    private final Iterator<B> iterator;

    /**
     * The converter from the original values to the converted values.
     */
    private final ObjectConverter<B,E> converter;

    /**
     * The next element to be returned, or {@code null}.
     */
    private transient E next;

    /**
     * Creates a new iterator wrapping the given original iterator and converting the
     * values using the given converter.
     */
    DerivedIterator(final Iterator<B> iterator, ObjectConverter<B,E> converter) {
        this.iterator  = iterator;
        this.converter = converter;
    }

    /**
     * Returns {@code true} if the iteration has more elements.
     */
    @Override
    public boolean hasNext() {
        while (next == null) {
            if (!iterator.hasNext()) {
                return false;
            }
            next = converter.convert(iterator.next());
        }
        return true;
    }

    /**
     * Returns the next element in the iteration.
     */
    @Override
    public E next() {
        E value = next;
        next = null;
        while (value == null) {
            value = converter.convert(iterator.next());
        }
        return value;
    }

    /**
     * Removes from the underlying set the last element returned by the iterator.
     *
     * @throws UnsupportedOperationException if the underlying collection doesn't supports the
     * {@code remove} operation.
     */
    @Override
    public void remove() {
        iterator.remove();
    }
}

@@ -1186,17 +1186,17 @@
 @param %3C
-B
+S
 %3E The ty
@@ -1221,19 +1221,26 @@
 the 
-backing set
+storage collection
 .%0A *
@@ -1463,17 +1463,17 @@
 terator%3C
-B
+S
 ,E%3E impl
@@ -1566,33 +1566,33 @@
  final Iterator%3C
-B
+S
 %3E iterator;%0A%0A   
@@ -1701,33 +1701,33 @@
 ObjectConverter%3C
-B
+S
 ,E%3E converter;%0A%0A
@@ -2008,17 +2008,17 @@
 terator%3C
-B
+S
 %3E iterat
@@ -2037,17 +2037,17 @@
 nverter%3C
-B
+S
 ,E%3E conv

Use consistent symbols (forgot to include this change in the previous commit).