public static int indexOf ( List < Node > list , int value ) { for ( int i = 0 ; i < list . size ( ) ; i ++ ) { if ( list . get ( i ) . which == value ) return i ; } return - 1 ; }
Finds the node with the index of value