Class ArrayHelpers

java.lang.Object
top.girlkisser.lazuli.api.collections.ArrayHelpers

public final class ArrayHelpers extends Object
Provides a handful of helpers for arrays.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    contains(int[] array, int entry)
    Check if an array contains a given value.
    static <T> boolean
    contains(T[] array, T entry)
    Check if an array contains a given value.
    static int[]
    rangeOf(int max)
    Creates an array using the provided range where the starting value is 0.
    static int[]
    rangeOf(int min, int max)
    Creates an array using the provided range.
    static int[]
    rangeOf(int min, int max, int step)
    Creates an array using the provided range.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • rangeOf

      public static int[] rangeOf(int min, int max, int step)
      Creates an array using the provided range.
      Parameters:
      min - The initial value (inclusive).
      max - The ending value (exclusive).
      step - The step between values.
      Returns:
      An array containing the range of integers.
    • rangeOf

      public static int[] rangeOf(int min, int max)
      Creates an array using the provided range.
      Parameters:
      min - The initial value (inclusive).
      max - The ending value (exclusive).
      Returns:
      An array containing the range of integers.
    • rangeOf

      public static int[] rangeOf(int max)
      Creates an array using the provided range where the starting value is 0.
      Parameters:
      max - The ending value (exclusive).
      Returns:
      An array containing the range of integers.
    • contains

      public static <T> boolean contains(T[] array, T entry)
      Check if an array contains a given value.
      Type Parameters:
      T - The array's type.
      Parameters:
      array - The array to check.
      entry - The entry to check for.
      Returns:
      Whether the array contains the given entry.
    • contains

      public static boolean contains(int[] array, int entry)
      Check if an array contains a given value.
      Parameters:
      array - The array to check.
      entry - The entry to check for.
      Returns:
      Whether the array contains the given entry.