コード例 #1
0
 @Override
 public boolean equals(Object obj) {
   if (this == obj) return true;
   if (obj == null) return false;
   if (getClass() != obj.getClass()) return false;
   BinarySearchNode other = (BinarySearchNode) obj;
   if (left == null) {
     if (other.left != null) return false;
   } else if (!left.equals(other.left)) return false;
   if (right == null) {
     if (other.right != null) return false;
   } else if (!right.equals(other.right)) return false;
   if (value == null) {
     if (other.value != null) return false;
   } else if (!value.equals(other.value)) return false;
   return true;
 }