Add an iterator in the list of iterators.

@param iterator the iterator.
359659
public void addIterator(SizedIterator<? extends M> iterator) {
		if (this.iterators.add(iterator)) {
			this.total += iterator.totalSize();
			this.update = true;
		}
	}
32696
@Override
	@SuppressWarnings("unchecked")
	public Iterator<V> iterator() {
		CacheObjIterator<K, V> copiedIterator = (CacheObjIterator<K, V>) this.cacheObjIterator();
		return new CacheValuesIterator<V>(copiedIterator);
	}
1267038
public static <T> UnmodifiableIterator<T> unmodifiableIterator(
      final Iterator<T> iterator) {
    checkNotNull(iterator);
    if (iterator instanceof UnmodifiableIterator) {
      return (UnmodifiableIterator<T>) iterator;
    }
    return new UnmodifiableIterator<T>() {
      @Override
      public boolean hasNext() {
        return iterator.hasNext();
      }
      @Override
      public T next() {
        return iterator.next();
      }
    };
  }
1014291
public Iterator<T> iterator() {

        if (input == null)
            return null;

        if (outputIterator == null)
            outputIterator = new SinkIterator<T>(input.iterator());

        return outputIterator;
    }
827026
public static <T, R> Iterator<R> map(final Iterator<T> iterator, final IFunction<T, R> mapper) {
        return new Iterator<R>() {
            @Override
            public boolean hasNext() {
                return iterator.hasNext();
            }

            @Override
            public R next() {
                return mapper.apply(iterator.next());
            }

            @Override
            public void remove() {
                iterator.remove();
            }
        };
    }
239800
public static <T> Iterator<T> filteringIterator(
        Iterator<? extends T> iterator, 
        Predicate<? super T> predicate)
    {
        Objects.requireNonNull(iterator, "The iterator is null");
        Objects.requireNonNull(predicate, "The predicate is null");
        return new FilteringIterator<T>(iterator, predicate);
    }
175283
@SuppressWarnings({"unchecked"})
    public static <T> Iterator<T> cast(Iterator<? extends T> itr) {
        return (Iterator)itr;
    }
899691
public static <E, I extends Iterator<E>> Iterator<E> chain(Iterable<I> iterators) {
        dbc.precondition(iterators != null, "cannot chain a null iterable");
        return new ChainIterator<>(iterators.iterator());
    }
830440
protected void addListeningIterator(IClockwiseIterator iterator) {
		if (this.listeningIterators == null) {
			this.listeningIterators = new WeakArrayList<>();
		}
		this.listeningIterators.add(iterator);
	}
218170
protected function _setIterator($iterator)
    {
        if ($iterator !== null && !($iterator instanceof IteratorInterface)) {
            throw $this->_createInvalidArgumentException(
                $this->__('Argument is not an iterator instance'),
                null,
                null,
                $iterator
            );
        }

        $this->iterator = $iterator;
    }
1323878
public static <T> Set<T> asSet(final Iterator<T> iterator)
   {
      Set<T> result = new HashSet<T>();
      while (iterator.hasNext())
      {
         T t = iterator.next();
         result.add(t);
      }
      return result;
   }
651185
public static <E, I extends Iterator<E>> Iterator<E> chain(Iterator<I> iterators) {
        return new ChainIterator<>(iterators);
    }
1140945
private static <T> UnmodifiableIterator<Iterator<? extends T>> iterators(Iterable<? extends CloseableIterable<? extends T>> iterables) {
        final Iterator<? extends Iterable<? extends T>> iterableIterator = iterables.iterator();
        return new UnmodifiableIterator<Iterator<? extends T>>() {
            @Override
            public boolean hasNext() {
                return iterableIterator.hasNext();
            }

            @Override
            public Iterator<? extends T> next() {
                return iterableIterator.next().iterator();
            }
        };
    }
786771
public static <T> Iterable<T> oneTime(Iterator<T> iterator) {
        return new OneTimeIterable<T>(iterator);
    }
631483
private static void writeIterator(Iterator<?> iterator, CharBuf buffer) {
        if (iterator.hasNext()) {
            buffer.addChar('[');
            Object it = iterator.next();
            writeObject(it, buffer);
            while (iterator.hasNext()) {
                it = iterator.next();
                buffer.addChar(',');
                writeObject(it, buffer);
            }
            buffer.addChar(']');
        } else {
            buffer.addChars(EMPTY_LIST_CHARS);
        }
    }
841932
@SuppressWarnings("unchecked")
    protected Iterator _transform(final Iterator iterator) {
        if (iterator == null) return null;
        if (iterator instanceof BeanIterator) return iterator;
        return new BeanIterator(iterator, this);
    }
297648
@SafeVarargs
    public static <T> ElementIterator<T> compositeIterator(Iterator<T>... iterators) {
        Require.nonNull(iterators, "iterators");
        final Iterator<T> result;
        if (iterators.length == 0) {
            result = Collections.emptyIterator();
        } else if (iterators.length == 1) {
            if (iterators[0] instanceof ElementIterator<?>) {
                return (ElementIterator<T>) iterators[0];
            }
            result = iterators[0];
        } else {
            result = new CompoundIterator<>(iterators);
        }
        return ElementIterator.wrap(result);

    }