haifa.global
Class HaifaArrays

java.lang.Object
  |
  +--haifa.global.HaifaArrays

public class HaifaArrays
extends java.lang.Object

Containts some usefull array methods (static).


Constructor Summary
HaifaArrays()
           
 
Method Summary
static void main(java.lang.String[] args)
          For testing.
static int[] makeUniqueArray(int[] array)
          Gets an array of integers and returns an array smaller or equal in size such that each integer appears only once.
static double maxInArray(double[] array)
          Returns the maximal element in an array.
static int[] maxIndexesInArray(double[] array)
          Returns an array of the indexes of the maximal values in the array.
static java.lang.String toStringArray(double[] array)
          Uses a "," for a delimiter
static java.lang.String toStringArray(double[] array, java.lang.String delim)
          Returns a string of this sort: (155.34,2.35,33.0) if delim is ",".
static java.lang.String toStringArray(double[] array, java.lang.String delim, java.lang.String endLeft, java.lang.String endRight)
          Returns a string of this sort: (155.34,2.35,33.0) if delim is "," nad ends are "{" and "}".
static java.lang.String toStringArray(int[] array)
          Uses a "," for a delimiter
static java.lang.String toStringArray(int[] array, java.lang.String delim)
          Returns a string of this sort: (155,2,33) if delim is ",".
static java.lang.String toStringArray(int[] array, java.lang.String delim, java.lang.String endLeft, java.lang.String endRight)
          Returns a string of this sort: (155.34,2.35,33.0) if delim is "," nad ends are "{" and "}".
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

HaifaArrays

public HaifaArrays()
Method Detail

toStringArray

public static java.lang.String toStringArray(int[] array,
                                             java.lang.String delim)
Returns a string of this sort: (155,2,33) if delim is ",".

toStringArray

public static java.lang.String toStringArray(int[] array,
                                             java.lang.String delim,
                                             java.lang.String endLeft,
                                             java.lang.String endRight)
Returns a string of this sort: (155.34,2.35,33.0) if delim is "," nad ends are "{" and "}".

toStringArray

public static java.lang.String toStringArray(int[] array)
Uses a "," for a delimiter

toStringArray

public static java.lang.String toStringArray(double[] array,
                                             java.lang.String delim)
Returns a string of this sort: (155.34,2.35,33.0) if delim is ",".

toStringArray

public static java.lang.String toStringArray(double[] array,
                                             java.lang.String delim,
                                             java.lang.String endLeft,
                                             java.lang.String endRight)
Returns a string of this sort: (155.34,2.35,33.0) if delim is "," nad ends are "{" and "}".

toStringArray

public static java.lang.String toStringArray(double[] array)
Uses a "," for a delimiter

makeUniqueArray

public static int[] makeUniqueArray(int[] array)
Gets an array of integers and returns an array smaller or equal in size such that each integer appears only once. Does not guarenty anything regarding the order of the elements in the array.

maxInArray

public static double maxInArray(double[] array)
Returns the maximal element in an array.

maxIndexesInArray

public static int[] maxIndexesInArray(double[] array)
Returns an array of the indexes of the maximal values in the array. The return array will be of length 1 if the the input array has a single maximal index.

main

public static void main(java.lang.String[] args)
For testing.