public static int[] string2int( String[] splits ) 
	throws NullPointerException,
	       NumberFormatException {

	if( splits == null )
	    return null;
	int[] arr = new int[ splits.length ];
	for( int i = 0; i < splits.length; i++ ) {

	    if( splits[i] == null )
		throw new NullPointerException( "Token at index " + i + " is null and cannot be converted to int." );
	    
	    try {
		arr[i] = Integer.parseInt( splits[i].trim() );
	    } catch( NumberFormatException e ) {
		throw new NullPointerException( "Token at index " + i + " does not represent an int." );
	    }
	}
	
	return arr;
    }