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

Method find

chapter11/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 /**
40 * Search a list for an element by reference
41 *

Callers 10

buildMethod · 0.95
anti_depMethod · 0.95
delUseMethod · 0.95
iskeepMethod · 0.95
subsumeMethod · 0.95
addDepMethod · 0.95
upcastMethod · 0.95
getFieldIndexMethod · 0.45
doReplacementMethod · 0.45
cleanVariablesMethod · 0.45

Calls 2

sizeMethod · 0.45
getMethod · 0.45

Tested by 4

buildMethod · 0.76
getFieldIndexMethod · 0.36
doReplacementMethod · 0.36
cleanVariablesMethod · 0.36