connectionUtils/src/main/java/com/ge/research/semtk/resultSet/Table.java
public void insertJoinedColumn(String colName, String colType, int pos, String[] joinColNamesAndStrings, String delim) throws Exception {
		
		// error if trying to add a column name that is already in the table
		if(this.hasColumn(colName)){
			throw new Exception("Cannot add column \'" + colName + "\' (already exists)");
		}
		
		// create array containing either Integer (column index) or String (constant) for the join elements
		Object joinColIndicesAndStrings[] = new Object[joinColNamesAndStrings.length];
		for (int i = 0; i < joinColNamesAndStrings.length; i++) {
			String joinElement = joinColNamesAndStrings[i];
			if(this.hasColumn(joinElement)){
				joinColIndicesAndStrings[i] = new Integer(this.getColumnIndex(joinElement));  	// it's a column name
			}else if (joinElement.startsWith("\"") && joinElement.endsWith("\"")){
				joinElement = joinElement.substring(1, joinElement.length() - 1);  				// it's a quoted string (strip off the quotes)
				joinColIndicesAndStrings[i] = joinElement; 
			}else {
				throw new Exception("Cannot add column \'" + colName + "\' (\'" + joinElement + "\' is not a column name or a quoted constant string)");  // it's neither
			}
		}
		
		// add the new column name/type to the table
		this.columnNames = (String[])ArrayUtils.add(this.columnNames, pos, colName);
		this.columnTypes = (String[])ArrayUtils.add(this.columnTypes, pos, colType);
		this.hashColumnPositions();

		// add the new column cells
		for (ArrayList<String> row : this.rows) {
			String [] valsToJoin = new String[joinColIndicesAndStrings.length];
			for (int i = 0; i < joinColIndicesAndStrings.length; i++) {
				if(joinColIndicesAndStrings[i] instanceof Integer){
					valsToJoin[i] = row.get(((Integer)(joinColIndicesAndStrings[i])).intValue());	// a column value
				}else{
					valsToJoin[i] = (String) joinColIndicesAndStrings[i];							// a string
				}
			}
			row.add(pos, String.join(delim, valsToJoin));											// join the values and set as cell contents
		}
	}
/**
	 * Insert a new column that is a concatenation of other column values (and/or constant strings)
	 * @param colName the name of the new column
	 * @param colType the type of the new column
	 * @param joinColNamesAndStrings column names (or quoted String constants) to join to populate the column (e.g. "col1" "\"to\"" "col2")
	 * @param delim use to join the elements
	 */
Insert a new column that is a concatenation of other column values (and/or constant strings)
@param colName the name of the new column
@param colType the type of the new column
@param joinColNamesAndStrings column names (or quoted String constants) to join to populate the column
@param delim use to join the elements
Insert a new column that is a concatenation of other column values ( and / or constant strings ) @param colName the name of the new column @param colType the type of the new column @param joinColNamesAndStrings column names ( or quoted String constants ) to join to populate the column @param delim use to join the elements
public void insertJoinedColumn(String colName, String colType, int pos, String[] joinColNamesAndStrings, String delim) throws Exception {
		if(this.hasColumn(colName)){
			throw new Exception("Cannot add column \'" + colName + "\' (already exists)");
		}
		Object joinColIndicesAndStrings[] = new Object[joinColNamesAndStrings.length];
		for (int i = 0; i < joinColNamesAndStrings.length; i++) {
			String joinElement = joinColNamesAndStrings[i];
			if(this.hasColumn(joinElement)){
				joinColIndicesAndStrings[i] = new Integer(this.getColumnIndex(joinElement));  	
			}else if (joinElement.startsWith("\"") && joinElement.endsWith("\"")){
				joinElement = joinElement.substring(1, joinElement.length() - 1);  				
				joinColIndicesAndStrings[i] = joinElement; 
			}else {
				throw new Exception("Cannot add column \'" + colName + "\' (\'" + joinElement + "\' is not a column name or a quoted constant string)");  
			}
		}
		this.columnNames = (String[])ArrayUtils.add(this.columnNames, pos, colName);
		this.columnTypes = (String[])ArrayUtils.add(this.columnTypes, pos, colType);
		this.hashColumnPositions();
		for (ArrayList<String> row : this.rows) {
			String [] valsToJoin = new String[joinColIndicesAndStrings.length];
			for (int i = 0; i < joinColIndicesAndStrings.length; i++) {
				if(joinColIndicesAndStrings[i] instanceof Integer){
					valsToJoin[i] = row.get(((Integer)(joinColIndicesAndStrings[i])).intValue());	
				}else{
					valsToJoin[i] = (String) joinColIndicesAndStrings[i];							
				}
			}
			row.add(pos, String.join(delim, valsToJoin));											
		}
	}
public void insertJoinedColumn ( String colName , String colType , int pos , String [ ] joinColNamesAndStrings , String delim ) throws Exception { if ( this . hasColumn ( colName ) ) { throw new Exception ( "Cannot add column \'" + colName + "\' (already exists)" ) ; } Object joinColIndicesAndStrings [ ] = new Object [ joinColNamesAndStrings . length ] ; for ( int i = 0 ; i < joinColNamesAndStrings . length ; i ++ ) { String joinElement = joinColNamesAndStrings [ i ] ; if ( this . hasColumn ( joinElement ) ) { joinColIndicesAndStrings [ i ] = new Integer ( this . getColumnIndex ( joinElement ) ) ; } else if ( joinElement . startsWith ( "\"" ) && joinElement . endsWith ( "\"" ) ) { joinElement = joinElement . substring ( 1 , joinElement . length ( ) - 1 ) ; joinColIndicesAndStrings [ i ] = joinElement ; } else { throw new Exception ( "Cannot add column \'" + colName + "\' (\'" + joinElement + "\' is not a column name or a quoted constant string)" ) ; } } this . columnNames = ( String [ ] ) ArrayUtils . add ( this . columnNames , pos , colName ) ; this . columnTypes = ( String [ ] ) ArrayUtils . add ( this . columnTypes , pos , colType ) ; this . hashColumnPositions ( ) ; for ( ArrayList < String > row : this . rows ) { String [ ] valsToJoin = new String [ joinColIndicesAndStrings . length ] ; for ( int i = 0 ; i < joinColIndicesAndStrings . length ; i ++ ) { if ( joinColIndicesAndStrings [ i ] instanceof Integer ) { valsToJoin [ i ] = row . get ( ( ( Integer ) ( joinColIndicesAndStrings [ i ] ) ) . intValue ( ) ) ; } else { valsToJoin [ i ] = ( String ) joinColIndicesAndStrings [ i ] ; } } row . add ( pos , String . join ( delim , valsToJoin ) ) ; } }
Insert a new column that is a concatenation of other column values (and/or constant strings)
 @param colName the name of the new column
 @param colType the type of the new column
 @param joinColNamesAndStrings column names (or quoted String constants) to join to populate the column (e.g.
Insert a new column that is a concatenation of other column values ( and / or constant strings ) @param colName the name of the new column @param colType the type of the new column @param joinColNamesAndStrings column names ( or quoted String constants ) to join to populate the column ( e . g .
// error if trying to add a column name that is already in the table // create array containing either Integer (column index) or String (constant) for the join elements // it's a column name // it's a quoted string (strip off the quotes) // it's neither // add the new column name/type to the table // add the new column cells // a column value // a string // join the values and set as cell contents