jncc20
Class ArrayUtils

java.lang.Object
  extended by jncc20.ArrayUtils

public final class ArrayUtils
extends java.lang.Object

Methods for conversions between Arrays and ArraysList (and vice-versa), and for computing average and standard deviation of arrays, ignoring missing data (denoted as -9999).


Constructor Summary
ArrayUtils()
           
 
Method Summary
(package private) static double arrayAvg(double[] ProvidedArray)
          Computes the average of the array, ignoring missing data (denoted as -9999); if all data are missing, returns -9999.
(package private) static double arrayAvg(int[] ProvidedArray)
          Computes the average of the array, ignoring missing data (denoted as -9999).
(package private) static double arrayStDev(double[] ProvidedArray)
          Computes the StdDev of the array, ignoring missing data (denoted as -9999); if all data are missing, returns -9999.
(package private) static double arrayStDev(int[] ProvidedArray)
          Computes the StdDev of the array, ignoring missing data (denoted as -9999).
(package private) static double[] arraySum(double[] ProvidedArray)
          Computes the sum of the array, ignoring missing data (dentoed as -9999).
(package private) static int[] arraySum(int[] ProvidedArray)
          Computes the sum of the array, ignoring missing data (denoted as -9999).
(package private) static double[] arraySumProduct(double[] Array1, double[] Array2)
          Computes Sum_i(Arr1[i]*Arr2[i]); term Arr1[j]*Arr2[j] is not included in the computation if Arr1[j] or Arr2[j] are -9999.
(package private) static int[] arraySumProduct(int[] Array1, int[] Array2)
          Computes Sum_i(Arr1[i]*Arr2[i]); term Arr1[j]*Arr2[j] is not included in the computation if Arr1[j] or Arr2[j] are -9999.
(package private) static double[] arrList2Array(java.util.ArrayList<java.lang.Double> ProvidedArrayList)
          Converts an ArrayList into an array.
(package private) static int[] arrList2Array(java.util.ArrayList<java.lang.Integer> ProvidedArrayList)
          Converts an ArrayList into an array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayUtils

public ArrayUtils()
Method Detail

arrayAvg

static double arrayAvg(double[] ProvidedArray)
Computes the average of the array, ignoring missing data (denoted as -9999); if all data are missing, returns -9999.


arrayAvg

static double arrayAvg(int[] ProvidedArray)
Computes the average of the array, ignoring missing data (denoted as -9999).


arrayStDev

static double arrayStDev(double[] ProvidedArray)
Computes the StdDev of the array, ignoring missing data (denoted as -9999); if all data are missing, returns -9999.


arrayStDev

static double arrayStDev(int[] ProvidedArray)
Computes the StdDev of the array, ignoring missing data (denoted as -9999).


arraySum

static double[] arraySum(double[] ProvidedArray)
Computes the sum of the array, ignoring missing data (dentoed as -9999). Returns an array of two values: the sum (pos. 0) and number of data used for the computation (pos. 1).


arraySum

static int[] arraySum(int[] ProvidedArray)
Computes the sum of the array, ignoring missing data (denoted as -9999). Returns an array of two values: the sum (pos. 0) and number of data used for the computation (pos. 1).


arraySumProduct

static double[] arraySumProduct(double[] Array1,
                                double[] Array2)
Computes Sum_i(Arr1[i]*Arr2[i]); term Arr1[j]*Arr2[j] is not included in the computation if Arr1[j] or Arr2[j] are -9999. Returns the computed value [pos.0 in the returned array] and the number of data used [pos 1].


arraySumProduct

static int[] arraySumProduct(int[] Array1,
                             int[] Array2)
Computes Sum_i(Arr1[i]*Arr2[i]); term Arr1[j]*Arr2[j] is not included in the computation if Arr1[j] or Arr2[j] are -9999. Values -9999 in position j of either Arr1 or Arr2 prevents term Arr1[j]*Arr2[j] to be included. Returns the computed value [pos.0 in the returned array] and the number of data used [pos 1].


arrList2Array

static double[] arrList2Array(java.util.ArrayList<java.lang.Double> ProvidedArrayList)
Converts an ArrayList into an array.


arrList2Array

static int[] arrList2Array(java.util.ArrayList<java.lang.Integer> ProvidedArrayList)
Converts an ArrayList into an array.