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

Method equals

chapter19/src/main/java/com/seaofnodes/simple/node/Node.java:499–509  ·  view source on GitHub ↗
( Object o )

Source from the content-addressed store, hash-verified

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

Callers 6

_print1Method · 0.45
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