* Create a ColumnRecord instance from the specified index record
*/
public Column createColumnRecord(final char[] record) {
final String str = new String(record);
final List<String> tokens = getStrings(str, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
final Column column = new Column();
// Extract the index version information from the record
int indexVersion = getIndexVersion(record);
// The tokens are the standard header values
int tokenIndex = 0;
setRecordHeaderValues(column, tokens.get(tokenIndex++), tokens.get(tokenIndex++),
tokens.get(tokenIndex++), tokens.get(tokenIndex++),
tokens.get(tokenIndex++), tokens.get(tokenIndex++));
// The next token are the supports flags
char[] supportFlags = (tokens.get(tokenIndex++)).toCharArray();
column.setSelectable(getBooleanValue(supportFlags[0]));
column.setUpdatable(getBooleanValue(supportFlags[1]));
column.setAutoIncremented(getBooleanValue(supportFlags[2]));
column.setCaseSensitive(getBooleanValue(supportFlags[3]));
column.setSigned(getBooleanValue(supportFlags[4]));
column.setCurrency(getBooleanValue(supportFlags[5]));
column.setFixedLength(getBooleanValue(supportFlags[6]));
// The next token is the search type
column.setNullType(NullType.values()[Integer.parseInt(tokens.get(tokenIndex++))]);
// The next token is the search type
column.setSearchType(SearchType.values()[3 - Integer.parseInt(tokens.get(tokenIndex++))]);
// The next token is the length
column.setLength( Integer.parseInt(tokens.get(tokenIndex++)) );
// The next token is the scale
column.setScale( Integer.parseInt(tokens.get(tokenIndex++)) );
// The next token is the precision
column.setPrecision( Integer.parseInt(tokens.get(tokenIndex++)) );
// The next token is the precision
column.setPosition( Integer.parseInt(tokens.get(tokenIndex++)) );
// The next token is the charOctetLength
column.setCharOctetLength( Integer.parseInt(tokens.get(tokenIndex++)) );
// The next token is the radix
column.setRadix( Integer.parseInt(tokens.get(tokenIndex++)) );
if (includeColumnNullDistinctValues(indexVersion)) {
// The next token is the distinct value
column.setDistinctValues(Integer.parseInt(tokens.get(tokenIndex++)) );
// The next token is the null value
column.setNullValues(Integer.parseInt(tokens.get(tokenIndex++)) );
}
// The next token is the min value
column.setMinimumValue( getObjectValue(tokens.get(tokenIndex++)) );
// The next token is the max value
column.setMaximumValue( getObjectValue(tokens.get(tokenIndex++)) );
// The next token is the format value
column.setFormat( getObjectValue(tokens.get(tokenIndex++)) );
// The next token is the runtime type
column.setRuntimeType( getObjectValue(tokens.get(tokenIndex++)) );
if(includeColumnNativeType(indexVersion)) {
// The next token is the native type
column.setNativeType( getObjectValue(tokens.get(tokenIndex++)) );
}
// The next token is the datatype ObjectID
column.setDatatypeUUID( getObjectValue(tokens.get(tokenIndex++)) );
// The next token is the default value
column.setDefaultValue( getObjectValue(tokens.get(tokenIndex++)) );
// The next tokens are footer values
setRecordFooterValues(column, tokens, tokenIndex);
return column;