juggernaut.mef
public class Lists extends Object
Method Summary | |
---|---|
static int[] | cumSum(int[] array)
Goes through the array and inserts a the current total of the array to a
new array in the same element. |
static double[] | cumSum(double[] array)
Goes through the array and inserts a the current total of the array to
a new array in the same element. |
static void | fill(int[] array, int x)
Fills an integer array with a specified integer. |
static void | fill(double[] array, double x)
Fills a double array with a specified double. |
static double[] | getArgsDouble(String[] args)
Takes each element in an String array and changes it into a {@code double}
using {@code Double.parseDouble()}. |
static int[] | getArgsInt(String[] args)
Takes each element in an String array and changes it into an {@code int}
using {@code Integer.parseInt()}. |
static int | max(int[] array)
Returns the index of the element with the largest value in the array. |
static double | max(double[] array)
Returns the index of the element with the largest value in the array. |
static double | mean(int[] array)
Returns the arithmetic mean of an array. |
static double | mean(double[] array)
Returns the arithmetic mean of an array. |
static int | min(int[] array)
Returns the index of the element with the smallest value in the array. |
static double | min(double[] array)
Returns the index of the element with the smallest value in the array. |
static int | product(int[] array)
Returns the product of all the elements in the array multiplied together. |
static int | product(double[] array)
Returns the product of all the elements in the array multiplied together. |
static double[] | randDoubleList(int length)
Returns a list of random {@code doubles} between 0 and 1. |
static double[] | randDoubleList(int length, double lower, double upper)
Returns a list of random {@code doubles}. |
static int[] | randIntList(int length, int lower, int upper)
Returns a list of random integers. |
static long[] | randLongList(int length, long lower, long upper)
Returns a list of random {@code longs}. |
static int | search(int[] array, int n, int start)
Searches through an integer array for a specified integer, beginning from
start and returning the index of the first occurrence of that integer. |
static double | search(double[] array, double n, int start)
Searches through a double array for a specified double, beginning from start
and returning the index of the first occurrence of that double. |
static double | stdDev(int[] array)
Returns the standard deviation of an integer array. |
static double | stdDev(double[] array)
Returns the standard deviation of a double array. |
static int | sum(int[] array)
Adds all of the elements of the array together and returns the sum. |
static double | sum(double[] array)
Adds all of the elements of the array together and returns the sum. |
static void | swap(int[] array, int a, int b)
Swaps the element at index a with the element at index b. |
static void | swap(Object[] array, int a, int b)
Swaps the element at index a with the element at index b. |
static boolean[] | testEquals(int[] array, int value) |
static int[] | testEquals(int[] array, int[] array2) |
static int[] | testEquals(double[] array, double value) |
static int[] | testEquals(double[] array, double[] array2) |
static String | toString(Object[] array)
Returns a string version of an array in the following format:
[1, 2, 3, ... |
static String | toString(double[] array)
Returns a string version of an array in the following format:
[1, 2, 3, ... |
static String | toString(int[] array)
Returns a string version of an array in the following format:
[1, 2, 3, ... |
static double | variance(int[] array)
Returns the variance of the array. |
static double | variance(double[] array)
Returns the variance of the array. |
Parameters: array the integer array
Returns: The cumulative sum of the array.
Parameters: array the integer array
Returns: The cumulative sum of the array.
Parameters: array an integer array x what to fill the array with
Parameters: array a double array x what to fill the array with
Parameters: args the array of strings to be converted
Returns: A double array which has the values of the String array.
Parameters: args the array of strings to be converted
Returns: An int array which has the values of the String array.
Parameters: array an integer array
Returns: The index of the element of the largest value in the array.
Parameters: array a double array
Returns: The index of the element of the largest value in the array.
Parameters: array an integer array
Returns: The arithmetic mean of the array.
Parameters: array a double array
Returns: The arithmetic mean of the array.
Parameters: array an int array
Returns: The index of the element of the smallest value in the array.
Parameters: array a double array
Returns: The index of the element of the smallest value in the array.
Parameters: array an integer array
Returns: The product of all the elements.
Parameters: array a double array
Returns: The product of all the elements.
Parameters: length the length of the list.
Returns: The random {@code double} array.
Parameters: length the length of the list. lower the lower bound of the {@code doubles}. upper the upper bound of the {@code doubles}.
Returns: The random {@code double} array.
Parameters: length the length of the list. lower the lower bound of the integers. upper the upper bound of the integers.
Returns: The random {@code int} array.
Parameters: length the length of the list. lower the lower bound of the {@code longs}. upper the upper bound of the {@code longs}.
Returns: The random {@code long} array.
Parameters: array an integer array n the integer to search for start the starting index of the search
Returns: The index of the first element equal to n. If not found, will return 0.
Parameters: array a double array n the double to search for start the starting index of the search
Returns: The index of the first element equal to n. If not found, will return 0.
Parameters: array an integer array
Returns: The standard deviation of the array.
Parameters: array a double array
Returns: The standard deviation of the array.
Parameters: array an integer array
Returns: The sum of the array.
Parameters: array a double array
Returns: The sum of the array.
Parameters: array an integer array a the first index in the array b the second index in the array
Parameters: array an object array a the first index in the array b the second index in the array
Parameters: array an object array.
Returns: The array in string format.
Parameters: array a double array.
Returns: The array in string format.
Parameters: array an int array.
Returns: The array in string format.
Parameters: array an integer array
Returns: The variance of the array.
Parameters: array a double array
Returns: The variance of the array.