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

com.jd.blockchain.utils.ArrayIterator Maven / Gradle / Ivy

The newest version!
package com.jd.blockchain.utils;

import java.util.Iterator;

public class ArrayIterator implements Iterator {

	private E[] array;

	private int cursor;

	public ArrayIterator(E[] array) {
		this.array = array;
	}

	@Override
	public boolean hasNext() {
		return cursor < array.length;
	}

	@Override
	public E next() {
		if (cursor < array.length) {
			return array[cursor++];
		}
		return null;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy