edu.gwu.csd.algorithm.util
Class ArrayHelper

java.lang.Object
  |
  +--edu.gwu.csd.algorithm.util.ArrayHelper

public class ArrayHelper
extends java.lang.Object

This class provides array functions.

Author:
borchert
, hwajung lee , cgallo

Constructor Summary
ArrayHelper()
           
 
Method Summary
static int[][] cloneArray(int[][] sourceArray)
          Creates a one by one copy of the given 2-dim array.
static void fillArray(int[][][] array, int defaultValue)
          Fills the given 3-dim array with the spezified value.
static void fillArray(int[][] array, int defaultValue)
          Fills the given 2-dim array with the spezified value.
static void fillArray(int[] array, int defaultValue)
          Fills the given 1-dim array with the spezified value.
static void printArray(int[][][] array, java.lang.String varName)
          Fills the given array with the spezified value.
static void printArray(int[][] array, java.lang.String varName)
          Fills the given array with the spezified value.
static void printArray(int[] array, java.lang.String varName)
          Fills the given array with the spezified value.
static void printArray(java.lang.Object[] array, java.lang.String varName)
          Fills the given array with the spezified value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayHelper

public ArrayHelper()
Method Detail

fillArray

public static void fillArray(int[][][] array,
                             int defaultValue)
Fills the given 3-dim array with the spezified value.

Parameters:
array - The 3-dim array that has to be filled.
defaultValue - The given default value.

fillArray

public static void fillArray(int[][] array,
                             int defaultValue)
Fills the given 2-dim array with the spezified value.

Parameters:
array - The 2-dim array that has to be filled.
defaultValue - The given default value.

fillArray

public static void fillArray(int[] array,
                             int defaultValue)
Fills the given 1-dim array with the spezified value.

Parameters:
array - The 1-dim array that has to be filled.
defaultValue - The given default value.

printArray

public static void printArray(int[][][] array,
                              java.lang.String varName)
Fills the given array with the spezified value.

Parameters:
array - The array that has to be filled.

printArray

public static void printArray(int[][] array,
                              java.lang.String varName)
Fills the given array with the spezified value.

Parameters:
array - The array that has to be filled.

printArray

public static void printArray(int[] array,
                              java.lang.String varName)
Fills the given array with the spezified value.

Parameters:
array - The array that has to be filled.

printArray

public static void printArray(java.lang.Object[] array,
                              java.lang.String varName)
Fills the given array with the spezified value.

Parameters:
array - The array that has to be filled.
Since:
1.2

cloneArray

public static int[][] cloneArray(int[][] sourceArray)
Creates a one by one copy of the given 2-dim array.

Parameters:
sourceArray - The 2-dim source array.
Returns:
thecopy of the 2-dim array.