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

org.incava.ijdk.collect.It Maven / Gradle / Ivy

There is a newer version: 3.9.0
Show newest version
package org.incava.ijdk.collect;

import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

/**
 * An iterator that has a value and an index.
 */
public class It {
    private final T value;
    private final int index;

    public It(T value, int index) {
        this.value = value;
        this.index = index;
    }

    public T value() {
        return this.value;
    }

    public int index() {
        return this.index;
    }

    public String toString() {
        return String.valueOf(this.index) + ": " + String.valueOf(this.value);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy