util
Class ArrayTool

java.lang.Object
  extended by util.ArrayTool

public class ArrayTool
extends Object

A class consisting of several static methods used for arrays.


Constructor Summary
ArrayTool()
           
 
Method Summary
static int contains(Object[] container, Object within)
          Test if a given object is within the array.
static boolean equalInts(int[] size)
          Tests, if an integer array has all equal numbers.
static double[] minmax(double[] in)
          Scans the primitve array for the minimum and maximum value.
static Vector2D minMax(double[] in)
          Scans the primitve array for the minimum and maximum value, returns it as a vector2d
static double[] toDouble(float[] f)
          Converts a float[] to a double[]
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayTool

public ArrayTool()
Method Detail

contains

public static int contains(Object[] container,
                           Object within)
Test if a given object is within the array. Uses the equals method of the object. Returns the index of the matching object or -1.


equalInts

public static boolean equalInts(int[] size)
Tests, if an integer array has all equal numbers. Use this to check multiple lists for equal size in ArrayTool.equalInts(new int[]{list1.size(), list2.size(),...})

Returns:
True, if array is null or all elements have the same value.

minmax

public static double[] minmax(double[] in)
Scans the primitve array for the minimum and maximum value.


minMax

public static Vector2D minMax(double[] in)
Scans the primitve array for the minimum and maximum value, returns it as a vector2d


toDouble

public static double[] toDouble(float[] f)
Converts a float[] to a double[]