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

Method equals

chapter16/src/main/java/com/seaofnodes/simple/node/Node.java:491–501  ·  view source on GitHub ↗
( Object o )

Source from the content-addressed store, hash-verified

489 // Two nodes are equal if they have the same inputs and the same "opcode"
490 // which means the same Java class, plus same internal parts.
491 @Override public final boolean equals( Object o ) {
492 if( o==this ) return true;
493 if( o.getClass() != getClass() ) return false;
494 Node n = (Node)o;
495 int len = _inputs.size();
496 if( len != n._inputs.size() ) return false;
497 for( int i=0; i<len; i++ )
498 if( in(i) != n.in(i) )
499 return false;
500 return eq(n);
501 }
502 // Subclasses add extra checks (such as ConstantNodes have same constant),
503 // and can assume "this!=n" and has the same Java class.
504 boolean eq( Node n ) { return true; }

Callers 5

idealizeMethod · 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