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

org.umlg.runtime.adaptor.ArrayIterator Maven / Gradle / Ivy

There is a newer version: 2.0.15
Show newest version
package org.umlg.runtime.adaptor;


import org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException;

import java.util.Iterator;

/**
 * Date: 2014/07/04
 * Time: 12:07 PM
 */
public class ArrayIterator implements Iterator {
    private final Object[] array;
    private int count = 0;

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

    public void remove() {
        throw new UnsupportedOperationException();
    }

    public Object next() {
        if (count > array.length)
            throw FastNoSuchElementException.instance();

        return array[count++];
    }

    public boolean hasNext() {
        return count < array.length;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy