MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / search

Method search

vm/JavaAPI/src/java/util/Stack.java:106–123  ·  view source on GitHub ↗

Returns the index of the first occurrence of the object, starting from the top of the stack. @return the index of the first occurrence of the object, assuming that the topmost object on the stack has a distance of one. @param o the object to be searched.

(Object o)

Source from the content-addressed store, hash-verified

104 * the object to be searched.
105 */
106 public synchronized int search(Object o) {
107 final Object[] dumpArray = elementData;
108 final int size = elementCount;
109 if (o != null) {
110 for (int i = size - 1; i >= 0; i--) {
111 if (o.equals(dumpArray[i])) {
112 return size - i;
113 }
114 }
115 } else {
116 for (int i = size - 1; i >= 0; i--) {
117 if (dumpArray[i] == null) {
118 return size - i;
119 }
120 }
121 }
122 return -1;
123 }
124}

Callers 15

invoke2Method · 0.45
invoke6Method · 0.45
mainFunction · 0.45
parse_phone_pageFunction · 0.45
has_notchFunction · 0.45
has_islandFunction · 0.45
normaliseFunction · 0.45
_search_valueFunction · 0.45
post_authorFunction · 0.45
check_caseFunction · 0.45

Calls 1

equalsMethod · 0.65

Tested by 1

check_caseFunction · 0.36