us.ihmc.utilities
Class ArrayTools

java.lang.Object
  extended by us.ihmc.utilities.ArrayTools

public class ArrayTools
extends java.lang.Object


Constructor Summary
ArrayTools()
           
 
Method Summary
static double[] concatentateArrays(double[][] arrayOfArraysToConcatenate)
           
static int[] concatentateArrays(int[][] arrayOfArraysToConcatenate)
           
static java.lang.Object[] concatentateArrays(java.lang.Object[][] arrayOfArraysToConcatenate)
           
static double[] copyArray(double[] array)
          Copys an Array of Doubles
static float[] copyArray(float[] array)
          Copys an Array of Floats
static int[] copyArray(int[] array)
          Copys an Array of intgers
static long[] copyArray(long[] array)
          Copys an Array of Longs
static double[] getReserveredOrderedArrayCopy(double[] arrayToReverseAndCopy)
           
static double[] parseDoubleArray(java.io.BufferedReader bufferedReader)
           
static double[] parseDoubleArray(java.io.DataInputStream dataInputStream)
           
static double[] parseDoubleArray(java.lang.String stringSource)
           
static double[] parseDoubleArrayFromMATLAB(java.io.BufferedReader bufferedReader)
           
static double[] parseDoubleArrayFromMATLAB(java.lang.String stringSource)
           
static int[] parseIntArray(java.io.DataInputStream dataInputStream)
           
static int[] parseIntegerArray(java.io.BufferedReader bufferedReader)
           
static int[] parseIntegerArray(java.lang.String stringSource)
           
static void printArray(java.util.ArrayList<java.lang.Double> doubles, java.io.PrintStream printStream)
           
static void printArray(double[][] doubles, java.io.PrintStream printStream)
           
static void printArray(double[] doubles, java.io.DataOutputStream dataOutputStream)
          Prints an Array of doubles with DataOutputStream
static void printArray(double[] doubles, java.io.PrintStream printStream)
          Prints an Array of doubles with PrintStream
static void printArray(double[] doubles, java.io.PrintWriter printWriter)
          Prints an Array of doubles with PrintWriter
static void printArray(double[] doubles, java.io.StringWriter stringWriter)
          Prints an Array of Doubles with StringWriter
static void printArray(int[] ints, java.io.DataOutputStream dataOutputStream)
          Prints an Array of integers with DataOutputStream
static void printArray(int[] ints, java.io.PrintStream printStream)
          Prints an Array of intergers with PrintStream
static void printArray(int[] ints, java.io.PrintWriter printWriter)
          Prints an Array of integers with PrintWriter
static void printArray(int[] ints, java.io.StringWriter stringWriter)
          Prints an Array of intergers with StringWriter
static void printArray(java.lang.String[] strings, java.io.PrintStream printStream)
          Prints an Array of Stings with PrintStream
static void printArray(java.lang.String[] strings, java.io.PrintWriter printWriter)
          Prints an Array of strings with PrintWriter
static void printArray(java.lang.String[] strings, java.io.StringWriter stringWriter)
          Prints an Array of strings with StringWriter
static void printArrayForMATLAB(double[] doubles, java.io.PrintStream printStream)
          Prints an Array of doubles for MATLAB with PrintStream
static void printArrayForMATLAB(double[] doubles, java.io.PrintWriter printWriter)
          Prints an Array of doubles for MATLAB with PrintWriter
static void printArrayForMATLAB(java.lang.String arrayName, double[] doubles, java.io.PrintStream printStream)
          Prints an Array for MATLAB with PrintStream
static void printArrayForMATLAB(java.lang.String arrayName, double[] doubles, java.io.PrintWriter printWriter)
          Prints an Array of doubles for MATLAB with PrintWriter
static void printArrayOfLongs(long[] longs, java.io.StringWriter stringWriter)
          Prints an Array of Longs with StringWriter
static void printIntArray(int[][] ints, java.io.PrintStream printStream)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayTools

public ArrayTools()
Method Detail

printArrayOfLongs

public static void printArrayOfLongs(long[] longs,
                                     java.io.StringWriter stringWriter)
Prints an Array of Longs with StringWriter

Parameters:
longs - long[]
stringWriter - StringWriter

printArray

public static void printArray(java.lang.String[] strings,
                              java.io.StringWriter stringWriter)
Prints an Array of strings with StringWriter

Parameters:
strings - String[]
stringWriter - StringWriter

printArray

public static void printArray(int[] ints,
                              java.io.StringWriter stringWriter)
Prints an Array of intergers with StringWriter

Parameters:
ints - int[]
stringWriter - StringWriter

printArray

public static void printArray(double[] doubles,
                              java.io.StringWriter stringWriter)
Prints an Array of Doubles with StringWriter

Parameters:
doubles - double[]
stringWriter - StringWriter

printArray

public static void printArray(java.lang.String[] strings,
                              java.io.PrintWriter printWriter)
Prints an Array of strings with PrintWriter

Parameters:
strings - String[]
printWriter - PrintWriter

printArray

public static void printArray(java.lang.String[] strings,
                              java.io.PrintStream printStream)
Prints an Array of Stings with PrintStream

Parameters:
strings - String[]
printStream - PrintStream

printArray

public static void printArray(java.util.ArrayList<java.lang.Double> doubles,
                              java.io.PrintStream printStream)

printArrayForMATLAB

public static void printArrayForMATLAB(double[] doubles,
                                       java.io.PrintWriter printWriter)
Prints an Array of doubles for MATLAB with PrintWriter

Parameters:
doubles - double[]
printWriter - PrintWriter

printArrayForMATLAB

public static void printArrayForMATLAB(double[] doubles,
                                       java.io.PrintStream printStream)
Prints an Array of doubles for MATLAB with PrintStream

Parameters:
doubles - double[]
printStream - PrintStream

printArrayForMATLAB

public static void printArrayForMATLAB(java.lang.String arrayName,
                                       double[] doubles,
                                       java.io.PrintWriter printWriter)
Prints an Array of doubles for MATLAB with PrintWriter

Parameters:
arrayName - String
doubles - double[]
printWriter - PrintWriter

printArrayForMATLAB

public static void printArrayForMATLAB(java.lang.String arrayName,
                                       double[] doubles,
                                       java.io.PrintStream printStream)
Prints an Array for MATLAB with PrintStream

Parameters:
arrayName - String
doubles - double[]
printStream - PrintStream

printArray

public static void printArray(double[] doubles,
                              java.io.DataOutputStream dataOutputStream)
                       throws java.io.IOException
Prints an Array of doubles with DataOutputStream

Parameters:
doubles - double[]
dataOutputStream - DataOutputStream
Throws:
java.io.IOException

printArray

public static void printArray(double[] doubles,
                              java.io.PrintWriter printWriter)
Prints an Array of doubles with PrintWriter

Parameters:
doubles - double[]
printWriter - PrintWriter

printArray

public static void printArray(double[] doubles,
                              java.io.PrintStream printStream)
Prints an Array of doubles with PrintStream

Parameters:
doubles - double[]
printStream - PrintStream

printArray

public static void printArray(double[][] doubles,
                              java.io.PrintStream printStream)
Parameters:
doubles - double[][]
printStream - PrintStream

printArray

public static void printArray(int[] ints,
                              java.io.PrintWriter printWriter)
Prints an Array of integers with PrintWriter

Parameters:
ints - int[]
printWriter - PrintWriter

printArray

public static void printArray(int[] ints,
                              java.io.PrintStream printStream)
Prints an Array of intergers with PrintStream

Parameters:
ints - int[]
printStream - PrintStream

printArray

public static void printArray(int[] ints,
                              java.io.DataOutputStream dataOutputStream)
                       throws java.io.IOException
Prints an Array of integers with DataOutputStream

Parameters:
ints - int[]
dataOutputStream - DataOutputStream
Throws:
java.io.IOException

printIntArray

public static void printIntArray(int[][] ints,
                                 java.io.PrintStream printStream)
Parameters:
ints - int[][]
printStream - PrintStream

parseDoubleArray

public static double[] parseDoubleArray(java.lang.String stringSource)
                                 throws java.io.IOException
Parameters:
stringSource - String
Returns:
double[]
Throws:
java.io.IOException

parseDoubleArray

public static double[] parseDoubleArray(java.io.BufferedReader bufferedReader)
                                 throws java.io.IOException
Parameters:
bufferedReader - BufferedReader
Returns:
double[]
Throws:
java.io.IOException

parseDoubleArrayFromMATLAB

public static double[] parseDoubleArrayFromMATLAB(java.lang.String stringSource)
                                           throws java.io.IOException
Parameters:
stringSource - String
Returns:
double[]
Throws:
java.io.IOException

parseDoubleArrayFromMATLAB

public static double[] parseDoubleArrayFromMATLAB(java.io.BufferedReader bufferedReader)
                                           throws java.io.IOException
Parameters:
bufferedReader - BufferedReader
Returns:
double[]
Throws:
java.io.IOException

parseDoubleArray

public static double[] parseDoubleArray(java.io.DataInputStream dataInputStream)
                                 throws java.io.IOException
Throws:
java.io.IOException

parseIntegerArray

public static int[] parseIntegerArray(java.lang.String stringSource)
                               throws java.io.IOException
Throws:
java.io.IOException

parseIntegerArray

public static int[] parseIntegerArray(java.io.BufferedReader bufferedReader)
                               throws java.io.IOException
Throws:
java.io.IOException

parseIntArray

public static int[] parseIntArray(java.io.DataInputStream dataInputStream)
                           throws java.io.IOException
Throws:
java.io.IOException

copyArray

public static float[] copyArray(float[] array)
Copys an Array of Floats

Parameters:
array - float[]
Returns:
float[]

copyArray

public static double[] copyArray(double[] array)
Copys an Array of Doubles

Parameters:
array - double[]
Returns:
double[]

copyArray

public static int[] copyArray(int[] array)
Copys an Array of intgers

Parameters:
array - int[]
Returns:
int[]

getReserveredOrderedArrayCopy

public static double[] getReserveredOrderedArrayCopy(double[] arrayToReverseAndCopy)

copyArray

public static long[] copyArray(long[] array)
Copys an Array of Longs

Parameters:
array - long[]
Returns:
long[]

concatentateArrays

public static int[] concatentateArrays(int[][] arrayOfArraysToConcatenate)
Parameters:
arrayOfArraysToConcatenate - int[][]
Returns:
int[]

concatentateArrays

public static double[] concatentateArrays(double[][] arrayOfArraysToConcatenate)
Parameters:
arrayOfArraysToConcatenate - double[][]
Returns:
double[]

concatentateArrays

public static java.lang.Object[] concatentateArrays(java.lang.Object[][] arrayOfArraysToConcatenate)
Parameters:
arrayOfArraysToConcatenate - Object[][]
Returns:
Object[]