Class Arys

java.lang.Object
com.esotericpig.jeso.Arys

public final class Arys extends Object
Author:
Jonathan Bradley Whited
  • Field Details

  • Method Details

    • compact

      @SafeVarargs public static <T> T[] compact(T... ary)
    • compactMut

      public static <T> T[] compactMut(T[] ary)
    • join

      @SafeVarargs public static <T> String join(T... ary)
    • joins

      @SafeVarargs public static <T> String joins(char separator, T... ary)
    • joins

      @SafeVarargs public static <T> String joins(CharSequence separator, T... ary)
    • newArray

      public static <T> T[] newArray(T[] ary, int length)
       java.util.Arrays#copyOfRange(...) does the same thing.
      
       This does not modify the ary arg.
       
      Type Parameters:
      T - the type of array to create
      Parameters:
      ary - the array to use for getting the Class data and component type
      length - the length of the new array
      Returns:
      the new array
    • sample

      @SafeVarargs public static <T> T sample(T... ary)
    • sample

      @SafeVarargs public static <T> T sample(Random rand, T... ary)
    • samples

      @SafeVarargs public static <T> T[] samples(int count, T... ary)
    • samples

      @SafeVarargs public static <T> T[] samples(int count, Random rand, T... ary)
    • unique

      @SafeVarargs public static <T> T[] unique(T... ary)
    • uniqueMut

      public static <T> T[] uniqueMut(T[] ary)
    • toArray

      public static <T> T[] toArray(T[] ary, List<T> list)