public GuidedDTTemplateDataProvider(List<BaseColumn> columns, List<DTCellValue52> rowData) { if ( columns == null ) { throw new NullPointerException( "columns cannot be null" ); } if ( rowData == null ) { throw new NullPointerException( "rowData cannot be null" ); } //rowData does not contain the Analysis column, columns does if ( rowData.size() != columns.size() - 1 ) { throw new IllegalArgumentException( "rowData contains a different number of columns to those provided" ); } //Extract keys and values in constructor rather than on demand for speed for ( int index = 0; index < columns.size(); index++ ) { BaseColumn column = columns.get( index ); if ( column instanceof BRLConditionVariableColumn ) { BRLConditionVariableColumn brlCondition = (BRLConditionVariableColumn) column; templateKeysToValueMap.put( brlCondition.getVarName(), rowData.get( index ) ); } else if ( column instanceof BRLActionVariableColumn ) { BRLActionVariableColumn brlAction = (BRLActionVariableColumn) column; templateKeysToValueMap.put( brlAction.getVarName(), rowData.get( index ) ); } } }
public GuidedDTTemplateDataProvider(List<BaseColumn> columns, List<DTCellValue52> rowData) { if ( columns == null ) { throw new NullPointerException( "columns cannot be null" ); } if ( rowData == null ) { throw new NullPointerException( "rowData cannot be null" ); } //rowData does not contain the Analysis column, columns does if ( rowData.size() != columns.size() - 1 ) { throw new IllegalArgumentException( "rowData contains a different number of columns to those provided" ); } //Extract keys and values in constructor rather than on demand for speed for ( int index = 0; index < columns.size(); index++ ) { BaseColumn column = columns.get( index ); if ( column instanceof BRLConditionVariableColumn ) { BRLConditionVariableColumn brlCondition = (BRLConditionVariableColumn) column; templateKeysToValueMap.put( brlCondition.getVarName(), rowData.get( index ) ); } else if ( column instanceof BRLActionVariableColumn ) { BRLActionVariableColumn brlAction = (BRLActionVariableColumn) column; templateKeysToValueMap.put( brlAction.getVarName(), rowData.get( index ) ); } } }