org.incava.ijdk.collect.It Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ijdk Show documentation
Show all versions of ijdk Show documentation
Incava Java Development Kit
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);
}
}