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

Method equals

chapter10/src/main/java/com/seaofnodes/simple/node/Node.java:486–496  ·  view source on GitHub ↗
( Object o )

Source from the content-addressed store, hash-verified

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

Callers 1

ReturnNodeMethod · 0.45

Calls 3

inMethod · 0.95
eqMethod · 0.95
sizeMethod · 0.45

Tested by

no test coverage detected