com.davidbracewell.tuple.NTuple Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mango Show documentation
Show all versions of mango Show documentation
A set of utilities and tools to speed up and ease programming in Java.
package com.davidbracewell.tuple;
import com.google.common.base.Joiner;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
import java.util.Arrays;
import java.util.Iterator;
/**
* @author David B. Bracewell
*/
@EqualsAndHashCode
public class NTuple implements Tuple {
private final Object[] array;
public NTuple(@NonNull Object[] other) {
array = new Object[other.length];
System.arraycopy(other, 0, array, 0, other.length);
}
@SafeVarargs
public static NTuple of(@NonNull T... items) {
return new NTuple(items);
}
@Override
public Object get(int index) {
return array[index];
}
@Override
public Iterator © 2015 - 2025 Weber Informatics LLC | Privacy Policy