jaitools.numeric
Class ArrayUtils

java.lang.Object
  extended by jaitools.numeric.ArrayUtils

public class ArrayUtils
extends Object

Provides a number of array operations not present in the standard Java Arrays class.

Based on methods originally in the "BandCombine" operator ported from the GeoTools library (http://geotools.org) and written by Martin Desruisseaux.

Since:
1.1
Version:
$Id: ArrayUtils.java 1383 2011-02-10 11:22:29Z michael.bedward $
Author:
Michael Bedward, Martin Desruisseaux

Constructor Summary
ArrayUtils()
           
 
Method Summary
static double[] resize(double[] array, int length)
          Resize the given array, truncating or padding with zeroes as necessary.
static float[] resize(float[] array, int length)
          Resize the given array, truncating or padding with zeroes as necessary.
static int[] resize(int[] array, int length)
          Resize the given array, truncating or padding with zeroes as necessary.
 
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

resize

public static double[] resize(double[] array,
                              int length)
Resize the given array, truncating or padding with zeroes as necessary. If the length of the input array equals the requested length it will be returned unchanged, otherwise a new array instance is created.

Parameters:
array - the array to resize
length - requested length
Returns:
a new array of the requested size

resize

public static float[] resize(float[] array,
                             int length)
Resize the given array, truncating or padding with zeroes as necessary. If the length of the input array equals the requested length it will be returned unchanged, otherwise a new array instance is created.

Parameters:
array - the array to resize
length - requested length
Returns:
a new array of the requested size

resize

public static int[] resize(int[] array,
                           int length)
Resize the given array, truncating or padding with zeroes as necessary. If the length of the input array equals the requested length it will be returned unchanged, otherwise a new array instance is created.

Parameters:
array - the array to resize
length - requested length
Returns:
a new array of the requested size


Copyright © 2009-2011. All Rights Reserved.