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

Method find

chapter15/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 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