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

Method find

chapter21/src/main/java/com/seaofnodes/simple/Utils.java:28–33  ·  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

26 * @return >= 0 on success, -1 on failure
27 */
28 public static <E> int find( ArrayList<E> ary, E x ) {
29 for( int i=0; i<ary.size(); i++ )
30 if( ary.get(i)==x )
31 return i;
32 return -1;
33 }
34 /**
35 * Search a list for an element by reference
36 *

Callers 1

darkMethod · 0.95

Calls 2

sizeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected