File tree 1 file changed +31
-0
lines changed
src/java/org/tensorics/core/functional/expressions
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -38,4 +38,35 @@ public FuncN<R> function() {
38
38
return func ;
39
39
}
40
40
41
+ @ Override
42
+ public int hashCode () {
43
+ final int prime = 31 ;
44
+ int result = 1 ;
45
+ result = prime * result + ((children == null ) ? 0 : children .hashCode ());
46
+ result = prime * result + ((func == null ) ? 0 : func .hashCode ());
47
+ return result ;
48
+ }
49
+
50
+ @ Override
51
+ public boolean equals (Object obj ) {
52
+ if (this == obj )
53
+ return true ;
54
+ if (obj == null )
55
+ return false ;
56
+ if (getClass () != obj .getClass ())
57
+ return false ;
58
+ FunctionalExpression <?> other = (FunctionalExpression <?>) obj ;
59
+ if (children == null ) {
60
+ if (other .children != null )
61
+ return false ;
62
+ } else if (!children .equals (other .children ))
63
+ return false ;
64
+ if (func == null ) {
65
+ if (other .func != null )
66
+ return false ;
67
+ } else if (!func .equals (other .func ))
68
+ return false ;
69
+ return true ;
70
+ }
71
+
41
72
}
You can’t perform that action at this time.
0 commit comments