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

org.ssssssss.script.runtime.lang.KeyValueIterator Maven / Gradle / Ivy

The newest version!
package org.ssssssss.script.runtime.lang;

import java.util.Iterator;

public class KeyValueIterator implements Iterator, KeyIterator {

	private final Iterator iterator;

	private int index = 0;

	public KeyValueIterator(Iterator iterator) {
		this.iterator = iterator;
	}

	@Override
	public boolean hasNext() {
		return iterator.hasNext();
	}

	@Override
	public Object next() {
		return iterator.next();
	}

	@Override
	public Object getKey() {
		return index++;
	}
}