Skip to content

Commit

Permalink
Added API to get column index on the IDataLoaderContext filter for co…
Browse files Browse the repository at this point in the history
…nvenience.
  • Loading branch information
chenson42 committed Jul 8, 2008
1 parent 5b62cb7 commit 90366e0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Expand Up @@ -58,6 +58,16 @@ public void setTableTemplate(TableTemplate tableTemplate) {
tableTemplateMap.put(getTableName(), tableTemplate);
}

public int getColumnIndex(String columnName) {
String[] columnNames = tableTemplate.getColumnNames();
for (int i = 0; i < columnNames.length; i++) {
if (columnNames[i].equals(columnName)) {
return i;
}
}
return -1;
}

public Table[] getAllTablesProcessed() {
Collection<TableTemplate> templates = this.tableTemplateMap.values();
Table[] tables = new Table[templates.size()];
Expand Down
Expand Up @@ -40,6 +40,8 @@ public interface IDataLoaderContext {
public String[] getColumnNames();

public String[] getKeyNames();

public int getColumnIndex(String columnName);

public Table[] getAllTablesProcessed();

Expand Down

0 comments on commit 90366e0

Please sign in to comment.