- public Map<String, E> getColumnsAsMap( final int key_col, final int value_col ) throws IllegalArgumentException {
- final Map<String, E> map = new HashMap<String, E>();
+ // Returns -1 if not found, IllegalArgumentException if not unique.
+ public int findRow( final String first_col_value ) throws IllegalArgumentException {
+ int result = -1;
+ for( int i = 0; i < this.getNumberOfRows(); ++i ) {
+ if ( getValueAsString( 0, i ).equals( first_col_value ) ) {
+ if ( result >= 0 ) {
+ throw new IllegalArgumentException( "\"" + first_col_value + "\" is not unique" );
+ }
+ result = i;
+ }
+ }
+ return result;
+ }
+
+ public SortedMap<String, E> getColumnsAsMap( final int key_col, final int value_col ) throws IllegalArgumentException {
+ final SortedMap<String, E> map = new TreeMap<String, E>();