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

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

Go to download

A collection of utilities for representing and manipulating time series and such.

There is a newer version: 0.1.6
Show newest version
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;
	}
}