MCPcopy Create free account
hub / github.com/davidgiven/luje / indexOf

Method indexOf

lib/java/util/ArrayList.java:432–450  ·  view source on GitHub ↗
(Object object)

Source from the content-addressed store, hash-verified

430 }
431
432 @Override
433 public int indexOf(Object object) {
434 // REVIEW: should contains call this method?
435 int lastIndex = firstIndex + size;
436 if (object != null) {
437 for (int i = firstIndex; i < lastIndex; i++) {
438 if (object.equals(array[i])) {
439 return i - firstIndex;
440 }
441 }
442 } else {
443 for (int i = firstIndex; i < lastIndex; i++) {
444 if (array[i] == null) {
445 return i - firstIndex;
446 }
447 }
448 }
449 return -1;
450 }
451
452 @Override
453 public boolean isEmpty() {

Callers 1

removeMethod · 0.95

Calls 1

equalsMethod · 0.65

Tested by

no test coverage detected