Class IndexedHelper

java.lang.Object
org.javimmutable.collections.indexed.IndexedHelper

public class IndexedHelper extends Object
Provides a number of static utility methods for producing Indexed objects from raw values. Useful when you need an Indexed but don't have or want to create an array just to get an Indexed of them.
  • Method Details

    • empty

      @Nonnull public static <T> Indexed<T> empty()
    • indexed

      @Nonnull public static <T, V extends T> Indexed<T> indexed(V a)
      Returns an Indexed containing a single value. Note that the type of the Indexed may be a subclass of the type of the value.
    • indexed

      @Nonnull public static <T, V extends T> Indexed<T> indexed(V a, V b)
      Returns an Indexed containing two values. Note that the type of the Indexed may be a subclass of the type of the value.
    • indexed

      @Nonnull public static <T, V extends T> Indexed<T> indexed(V a, V b, V c)
      Returns an Indexed containing three values. Note that the type of the Indexed may be a subclass of the type of the value.
    • indexed

      @Nonnull public static <T, V extends T> Indexed<T> indexed(V a, V b, V c, V... others)
      Returns an Indexed containing three values. Note that the type of the Indexed may be a subclass of the type of the value.
    • repeating

      @Nonnull public static <T> Indexed<T> repeating(T value, int count)
    • range

      @Nonnull public static Indexed<Integer> range(int low, int high)
    • asList

      @Nonnull public static <T> List<T> asList(@Nonnull Indexed<T> indexed)
      Creates a mutable List containing all values from the Indexed.