private static int findIndex(ArrayList list,Object o){
  int n=list.size();
  for (int i=0; i < n; i++) {
    if (list.get(i) == o)     return i;
  }
  return -1;
}

private static int findIndex ( ArrayList list , Object o ) { int n = list . size ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( list . get ( i ) == o ) return i ; } return - 1 ; }
finds a object in a list . should be much faster than indexof
