this.locationIndexByColumnName = new HashMap<String, Integer>();
this.columnIndexByPropertyNameBySelectorName = new HashMap<String, Map<String, Integer>>();
this.selectorNames = new ArrayList<String>(columns.size());
List<String> names = new ArrayList<String>(columns.size());
for (int i = 0, max = this.columns.size(); i != max; ++i) {
Column column = this.columns.get(i);
assert column != null;
String columnName = column.getColumnName();
assert columnName != null;
if (columnsByName.put(columnName, column) != null) {
assert false : "Column names must be unique";
}
names.add(columnName);
Integer columnIndex = new Integer(wrappedAround.getColumnIndexForName(columnName));
columnIndexByColumnName.put(columnName, columnIndex);
String selectorName = column.getSelectorName().getName();
if (!selectorNames.contains(selectorName)) selectorNames.add(selectorName);
Integer selectorIndex = new Integer(wrappedAround.getLocationIndex(selectorName));
locationIndexBySelectorName.put(selectorName, selectorIndex);
locationIndexByColumnIndex.put(new Integer(0), selectorIndex);
locationIndexByColumnName.put(columnName, selectorIndex);
// Insert the entry by selector name and property name ...
Map<String, Integer> byPropertyName = columnIndexByPropertyNameBySelectorName.get(selectorName);
if (byPropertyName == null) {
byPropertyName = new HashMap<String, Integer>();
columnIndexByPropertyNameBySelectorName.put(selectorName, byPropertyName);
}
byPropertyName.put(column.getPropertyName(), columnIndex);
}
if (selectorNames.isEmpty()) {
String selectorName = DEFAULT_SELECTOR_NAME;
selectorNames.add(selectorName);
locationIndexBySelectorName.put(selectorName, 0);