protected int indexOf ( final Object o ) { final int size = dataModel . getSize ( ) ; for ( int i = 0 ; i < size ; i ++ ) { if ( comparator == null ) { if ( o . equals ( dataModel . getElementAt ( i ) ) ) { return i ; } } else if ( comparator . compare ( o , dataModel . getElementAt ( i ) ) == 0 ) { return i ; } } return - 1 ; }
Get the index of a given object in the underlying data model .