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

Method equals

chapter18/src/main/java/com/seaofnodes/simple/node/Node.java:508–518  ·  view source on GitHub ↗
( Object o )

Source from the content-addressed store, hash-verified

506 // Two nodes are equal if they have the same inputs and the same "opcode"
507 // which means the same Java class, plus same internal parts.
508 @Override public final boolean equals( Object o ) {
509 if( o==this ) return true;
510 if( o.getClass() != getClass() ) return false;
511 Node n = (Node)o;
512 int len = _inputs.size();
513 if( len != n._inputs.size() ) return false;
514 for( int i=0; i<len; i++ )
515 if( in(i) != n.in(i) )
516 return false;
517 return eq(n);
518 }
519 // Subclasses add extra checks (such as ConstantNodes have same constant),
520 // and can assume "this!=n" and has the same Java class.
521 boolean eq( Node n ) { return true; }

Callers 7

_print1Method · 0.45
idealizeMethod · 0.45
errMethod · 0.45
findMethod · 0.45
defineMethod · 0.45
idealizeMethod · 0.45
mlabelMethod · 0.45

Calls 3

inMethod · 0.95
eqMethod · 0.95
sizeMethod · 0.45

Tested by

no test coverage detected