utils
Class ArrayUtils

java.lang.Object
  extended by utils.ArrayUtils

public final class ArrayUtils
extends java.lang.Object

Singleton class

Version:
1.0
Author:
Oscar Flores

Constructor Summary
ArrayUtils()
           
 
Method Summary
static int highestValueIndex(float[] anArray)
          Returns the index of the highest value found in array, or the index of the first encountered if tie
static int[] indexesOf(boolean[] arr, boolean val)
          Return an array with the indexes of the given array that have the value given or null if nothing is found
static int[] indexesOf(int[] arr, int val)
          Return an array with the indexes of the given array that have the value given or null if nothing is found
static int[] sortedIndexes(float[] arr)
          Return the sorted list of the array indexes ordened by the value they point.
 
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

indexesOf

public static final int[] indexesOf(boolean[] arr,
                                    boolean val)
Return an array with the indexes of the given array that have the value given or null if nothing is found

Parameters:
arr - Array to search in
val - Value to search

indexesOf

public static final int[] indexesOf(int[] arr,
                                    int val)
Return an array with the indexes of the given array that have the value given or null if nothing is found

Parameters:
arr - Array to search in
val - Value to search

sortedIndexes

public static final int[] sortedIndexes(float[] arr)
Return the sorted list of the array indexes ordened by the value they point. (Sorted from hightest values to lowest ones)

Parameters:
arr -
Returns:
Array with the indexes sorted by his value

highestValueIndex

public static final int highestValueIndex(float[] anArray)
Returns the index of the highest value found in array, or the index of the first encountered if tie

Parameters:
anArray - Array to search
Returns:
Index of the highest value or -1 if empty array;