info.informatica.util
Class TypeUtil

java.lang.Object
  extended by info.informatica.util.TypeUtil

public class TypeUtil
extends Object

Convenience class for data type utility functions

Version:
1.01, agosto 1999
Author:
amengual at informatica dot info

Constructor Summary
TypeUtil()
           
 
Method Summary
static String[] appendArrayAssign(String[] sa, String s)
          Returns an array of Strings that results from appending a String to the end of a pre-existing array of Strings.
static int equalsToCharInArray(char c, char[] ca, int i)
          Returns index j of ca[] that verifies ca[j] == c, or -1 otherwise.
static int indexOfStringInArray(String[] sa, String s)
          Determines the index of a given String in a String array.
static String intToFormattedString(int i, int n)
          Returns a String representing the i number with at least n digits.
static String[] safeArrayAssign(String[] sa, int i, String s)
          Assigns sa[i] = s, safely so if i>=sa.length it creates a new array with enough free space.
static String[] stringArrayTrim(String[] a)
          Trims a String array
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeUtil

public TypeUtil()
Method Detail

stringArrayTrim

public static String[] stringArrayTrim(String[] a)
Trims a String array


appendArrayAssign

public static String[] appendArrayAssign(String[] sa,
                                         String s)
Returns an array of Strings that results from appending a String to the end of a pre-existing array of Strings.


safeArrayAssign

public static String[] safeArrayAssign(String[] sa,
                                       int i,
                                       String s)
Assigns sa[i] = s, safely so if i>=sa.length it creates a new array with enough free space.


equalsToCharInArray

public static int equalsToCharInArray(char c,
                                      char[] ca,
                                      int i)
Returns index j of ca[] that verifies ca[j] == c, or -1 otherwise.


intToFormattedString

public static String intToFormattedString(int i,
                                          int n)
Returns a String representing the i number with at least n digits.

Parameters:
i - integer
n - number of digits
Returns:
formatted string

indexOfStringInArray

public static int indexOfStringInArray(String[] sa,
                                       String s)
Determines the index of a given String in a String array. Does not require the array to be sorted, as in Arrays.binarySearch.