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

com.mmnaseri.utils.tuples.FixedTuple Maven / Gradle / Ivy

There is a newer version: 1.1.2
Show newest version
package com.mmnaseri.utils.tuples;

import com.mmnaseri.utils.tuples.impl.EmptyTuple;

import java.util.function.Function;

/**
 * Base interface for a tuple that has a size within the range of 1-12.
 *
 * @author Milad Naseri ([email protected])
 */
public interface FixedTuple> extends Tuple {

  /** Returns an {@link EmptyTuple}. */
  @Override
  default EmptyTuple clear() {
    return EmptyTuple.of();
  }

  /**
   * Extends the current tuple by applying the provided function to it and appending the resulting
   * value to the end of this tuple.
   */
   Tuple extend(Function function);

  /**
   * Returns a new tuple that changes the value of the element at the given index by applying the
   * provided function to the current tuple.
   */
  Tuple change(int index, Function function);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy