MCPcopy Create free account
hub / github.com/Berkeley-CS61B/skeleton-sp23 / equals

Method equals

lab02/src/common/IntList.java:39–52  ·  view source on GitHub ↗
(Object other)

Source from the content-addressed store, hash-verified

37 }
38
39 public boolean equals(Object other) {
40 if (other instanceof IntList oL) {
41 if (first != oL.first) {
42 return false;
43 } else if (rest == null && oL.rest == null) {
44 return true;
45 } else if (rest != null && oL.rest != null) {
46 return rest.equals(oL.rest);
47 } else {
48 return false;
49 }
50 }
51 return false;
52 }
53
54 public String print() {
55 if (rest == null) {

Callers 9

playStageMethod · 0.95
phase1Method · 0.95
isNodeMethod · 0.45
getFieldsMethod · 0.45
playStageMethod · 0.45
phase0Method · 0.45
runUntilStageMethod · 0.45
mainMethod · 0.45
getMethod · 0.45

Calls

no outgoing calls

Tested by 3

isNodeMethod · 0.36
getFieldsMethod · 0.36
runUntilStageMethod · 0.36