MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / find

Method find

chapter06/src/main/java/com/seaofnodes/simple/Utils.java:33–38  ·  view source on GitHub ↗

Search a list for an element by reference @param ary List to search in @param x Object to be searched @return >= 0 on success, -1 on failure

( ArrayList<E> ary, E x )

Source from the content-addressed store, hash-verified

31 * @return >= 0 on success, -1 on failure
32 */
33 public static <E> int find( ArrayList<E> ary, E x ) {
34 for( int i=0; i<ary.size(); i++ )
35 if( ary.get(i)==x )
36 return i;
37 return -1;
38 }
39}

Callers 1

delUseMethod · 0.95

Calls 2

sizeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected