public class Int extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Int.ReduceBy
Public interface for a very fast reduce by.
|
| Constructor and Description |
|---|
Int() |
| Modifier and Type | Method and Description |
|---|---|
static int[] |
add(int[] array,
int v)
Adds an int to the array.
|
static int[] |
add(int[] array,
int[] array2)
adds two array together and returns the results.
|
static int[] |
array(int... array) |
static int[] |
arrayOfInt(int size)
Creates an array of bytes
|
static int |
atIndex(int[] array,
int index)
Returns the value at the given index.
|
static void |
atIndex(int[] array,
int index,
int value)
Sets the value at the given index.
|
static long |
bigSum(int[] values)
Sum
Provides overflow protection.
|
static long |
bigSum(int[] values,
int length)
Sum
Provides overflow protection.
|
static long |
bigSum(int[] values,
int start,
int length)
Big Sum
|
static int[] |
compact(int[] array)
Takes out all of the 0s
|
static int[] |
copy(int[] array)
Copies an array.
|
static int[] |
endSliceOf(int[] array,
int endIndex)
Grabs a slice of this array
|
static boolean |
equals(int[] expected,
int[] got)
Checks to see if two arrays are equals
|
static boolean |
equals(int expected,
int got)
Compares two values
|
static boolean |
equals(int start,
int end,
int[] expected,
int[] got)
Checks to see if two arrays are equals
|
static boolean |
equalsOrDie(int[] expected,
int[] got)
Checks to see if two arrays are equals
|
static boolean |
equalsOrDie(int expected,
int got)
Checks to see if two values are the same
|
static int[] |
grow(int[] array)
Double the size of an array.
|
static int[] |
grow(int[] array,
int size)
Grown an array
|
static int |
hashCode(int[] array) |
static int |
hashCode(int start,
int end,
int[] array) |
static int |
idx(int[] array,
int index)
Returns the value at the given index.
|
static void |
idx(int[] array,
int index,
int value)
Sets the value at the given index.
|
static boolean |
in(int value,
int[] array)
Checks to see if a value is in the array.
|
static int[] |
insert(int[] array,
int idx,
int v)
Inserts a value in the midst of another array.
|
static int[] |
insert(int[] array,
int fromIndex,
int[] values)
Inserts an array in the midst of another array.
|
static int |
len(int[] array)
Returns the lengthOf an array.
|
static int |
lengthOf(int[] array)
Returns the lengthOf an array.
|
static int |
max(int[] values)
max
|
static int |
max(int[] values,
int length)
max
|
static int |
max(int[] values,
int start,
int length)
Max
|
static int |
mean(int[] values)
Average
|
static int |
mean(int[] values,
int length)
Average
|
static int |
mean(int[] values,
int start,
int length)
Average
|
static int |
median(Collection<?> inputList,
String propertyPath)
Calculate standard deviation.
|
static int |
median(int[] values)
Calculate Median
|
static int |
median(int[] values,
int length)
Calculate Median
|
static int |
median(int[] values,
int start,
int length)
Calculate Median
|
static int |
min(int[] values)
Min
|
static int |
min(int[] values,
int length)
Min
|
static int |
min(int[] values,
int start,
int length)
Min
|
static long |
reduceBy(int[] array,
Int.ReduceBy reduceBy)
A very fast reduce by.
|
static long |
reduceBy(int[] array,
int length,
Int.ReduceBy reduceBy) |
static long |
reduceBy(int[] array,
int start,
int length,
Int.ReduceBy reduceBy) |
static long |
reduceBy(int[] array,
int start,
int length,
Object object)
Reduce By
|
static long |
reduceBy(int[] array,
int length,
Object object)
Reduce By
|
static long |
reduceBy(int[] array,
int length,
Object function,
String functionName)
Reduce By
|
static <T> long |
reduceBy(int[] array,
T object)
Reduce by functional support for int arrays.
|
static <T> long |
reduceBy(int[] array,
T object,
String methodName)
Reduce by functional support for int arrays.
|
static int |
roundUpToPowerOf2(int number)
Round up to the nearest power of 2
|
static int[] |
shrink(int[] array,
int size)
Shrink an array
|
static int[] |
slc(int[] array,
int startIndex)
Grabs a slice of this array
|
static int[] |
slc(int[] array,
int startIndex,
int endIndex)
Grabs a slice of this array
|
static int[] |
slcEnd(int[] array,
int endIndex)
Grabs a slice of this array
|
static int[] |
sliceOf(int[] array,
int startIndex)
Grabs a slice of this array
|
static int[] |
sliceOf(int[] array,
int startIndex,
int endIndex)
Grabs a slice of this array
|
static double |
standardDeviation(Collection<?> inputList,
String propertyPath)
Calculate standard deviation.
|
static int |
standardDeviation(int[] values)
Calculate standard deviation.
|
static int |
standardDeviation(int[] values,
int length)
Calculate standard deviation.
|
static int |
standardDeviation(int[] values,
int start,
int length)
Calculate standard deviation.
|
static long |
sum(Collection<?> inputList,
String propertyPath)
Calculate a sum of a property from a list.
|
static int |
sum(int[] values)
Sum
Provides overflow protection.
|
static int |
sum(int[] values,
int length)
Sum
Provides overflow protection.
|
static int |
sum(int[] values,
int start,
int length)
Sum
Provides overflow protection.
|
static double |
variance(Collection<?> inputList,
String propertyPath) |
static int |
variance(int[] values)
Calculate Variance.
|
static int |
variance(int[] values,
int length)
Calculate Variance.
|
static int |
variance(int[] values,
int start,
int length)
Calculate Variance.
|
static double |
varianceDouble(int[] values,
int start,
int length)
Calculate Variance.
|
public static int[] grow(int[] array,
int size)
array - array of items to growsize - size you would like to grow the array topublic static int[] grow(int[] array)
array - the array you are going to doublepublic static int[] shrink(int[] array,
int size)
array - the array you want to shrinksize - what size do you want the new arraypublic static int[] compact(int[] array)
array - array to compactpublic static int[] arrayOfInt(int size)
size - size of the array you want to makepublic static int[] array(int... array)
array - public static int lengthOf(int[] array)
array - the array you are getting the length from.public static int len(int[] array)
array - the array you are getting the length from.public static int idx(int[] array,
int index)
array - the array you are getting the from.public static int atIndex(int[] array,
int index)
array - the array you are getting the from.public static void idx(int[] array,
int index,
int value)
array - the array you are getting the from.public static void atIndex(int[] array,
int index,
int value)
array - the array you are setting the value to.value - the new value.public static int[] slc(int[] array,
int startIndex,
int endIndex)
array - the array you are getting slice fromstartIndex - the start index of the sliceendIndex - the end index of the slicepublic static int[] sliceOf(int[] array,
int startIndex,
int endIndex)
array - the array you are getting slice fromstartIndex - the start index of the sliceendIndex - the end index of the slicepublic static int[] slc(int[] array,
int startIndex)
array - the array you are getting slice fromstartIndex - the start index of the slicepublic static int[] sliceOf(int[] array,
int startIndex)
array - the array you are getting slice fromstartIndex - the start index of the slicepublic static int[] slcEnd(int[] array,
int endIndex)
array - the array you are getting slice fromendIndex - the end index of the slicepublic static int[] endSliceOf(int[] array,
int endIndex)
array - the array you are getting slice fromendIndex - the end index of the slicepublic static boolean in(int value,
int[] array)
array - the array you are getting slice frompublic static int[] copy(int[] array)
array - the array you want to copypublic static int[] add(int[] array,
int v)
array - the arrayv - the value you are adding to the end.public static int[] add(int[] array,
int[] array2)
array - first arrayarray2 - second arraypublic static int[] insert(int[] array,
int idx,
int v)
array - idx - v - public static int[] insert(int[] array,
int fromIndex,
int[] values)
array - public static long reduceBy(int[] array,
Int.ReduceBy reduceBy)
array - array of items to reduce byreduceBy - reduceBy interfacepublic static long reduceBy(int[] array,
int start,
int length,
Int.ReduceBy reduceBy)
array - array of items to reduce bystart - where to start in the arraylength - where to end in the arrayreduceBy - the function to do the reduce bypublic static long reduceBy(int[] array,
int length,
Int.ReduceBy reduceBy)
array - array of items to reduce bylength - where to end in the arrayreduceBy - the function to do the reduce bypublic static <T> long reduceBy(int[] array,
T object)
T - the type of objectarray - array of items to reduce byobject - object that contains the reduce by functionpublic static <T> long reduceBy(int[] array,
T object,
String methodName)
T - the type of objectarray - array of items to reduce byobject - object that contains the reduce by functionpublic static long reduceBy(int[] array,
int length,
Object object)
array - array of items to reduce bylength - where to end in the arrayobject - functionpublic static long reduceBy(int[] array,
int length,
Object function,
String functionName)
array - array of items to reduce bylength - where to end in the arrayfunction - functionfunction - functionNamepublic static long reduceBy(int[] array,
int start,
int length,
Object object)
array - array of items to reduce bylength - where to end in the arrayobject - functionpublic static boolean equalsOrDie(int expected,
int got)
expected - expected valuegot - got valuepublic static boolean equalsOrDie(int[] expected,
int[] got)
expected - expected arraygot - got arraypublic static boolean equals(int expected,
int got)
expected - expected valuegot - got valuepublic static boolean equals(int[] expected,
int[] got)
expected - expected arraygot - got arraypublic static int sum(int[] values)
values - values in intpublic static int sum(int[] values,
int length)
values - values in intpublic static int sum(int[] values,
int start,
int length)
values - values in intpublic static long bigSum(int[] values)
values - values in intpublic static long bigSum(int[] values,
int length)
values - values in intpublic static long bigSum(int[] values,
int start,
int length)
values - values in intpublic static int max(int[] values,
int start,
int length)
values - values in intpublic static int max(int[] values)
values - values in intpublic static int max(int[] values,
int length)
values - values in intpublic static int min(int[] values,
int start,
int length)
values - values in intpublic static int min(int[] values)
values - values in intpublic static int min(int[] values,
int length)
values - values in intpublic static int mean(int[] values,
int start,
int length)
values - values in intpublic static int mean(int[] values,
int length)
values - values in intpublic static int mean(int[] values)
values - values in intpublic static int variance(int[] values,
int start,
int length)
values - valuesstart - startlength - lengthpublic static double varianceDouble(int[] values,
int start,
int length)
values - valuesstart - startlength - lengthpublic static int variance(int[] values,
int length)
values - valueslength - lengthpublic static int variance(int[] values)
values - valuespublic static int standardDeviation(int[] values,
int start,
int length)
values - valuesstart - startlength - lengthpublic static int standardDeviation(int[] values,
int length)
values - valueslength - lengthpublic static int standardDeviation(int[] values)
values - valuespublic static int median(int[] values,
int start,
int length)
start - startvalues - valueslength - lengthpublic static int median(int[] values,
int length)
values - valueslength - lengthpublic static int median(int[] values)
values - valuespublic static boolean equals(int start,
int end,
int[] expected,
int[] got)
expected - expected arraygot - got arraypublic static int hashCode(int[] array)
public static int hashCode(int start,
int end,
int[] array)
public static long sum(Collection<?> inputList, String propertyPath)
inputList - propertyPath - to item we want to sumpublic static double variance(Collection<?> inputList, String propertyPath)
public static double standardDeviation(Collection<?> inputList, String propertyPath)
public static int median(Collection<?> inputList, String propertyPath)
public static int roundUpToPowerOf2(int number)
number - number you want to round up to.Copyright © 2014. All rights reserved.