All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.unit16.z.indexed.IteratorIndexed Maven / Gradle / Ivy

package com.unit16.z.indexed;

import com.google.common.collect.UnmodifiableIterator;

final class IteratorIndexed extends UnmodifiableIterator {

	private int index_ = 0;
	private final Indexed indexed_;
	
	public IteratorIndexed(Indexed i) {
		indexed_ = i;
	}
	
	@Override
	public boolean hasNext() { return index_ < indexed_.size(); }

	@Override
	public B next() {
		final B b = indexed_.get(index_);
		index_++;
		return b;
	}
}