valueEquals implemented for AS1/2

This commit is contained in:
Jindra Petřík
2021-03-12 22:12:39 +01:00
parent 89ea68923c
commit f77d3948df
69 changed files with 1389 additions and 5 deletions
@@ -168,6 +168,24 @@ public abstract class BinaryOpItem extends GraphTargetItem implements BinaryOp {
return (Objects.equals(operator, other.operator));
}
@Override
public boolean valueEquals(GraphTargetItem obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final BinaryOpItem other = (BinaryOpItem) obj;
if (!GraphTargetItem.objectsValueEquals(leftSide, other.leftSide)) {
return false;
}
if (!GraphTargetItem.objectsValueEquals(rightSide, other.rightSide)) {
return false;
}
return GraphTargetItem.objectsValueEquals(operator, other.operator);
}
/*@Override
public boolean toBoolean() {
double val=toNumber();
@@ -123,6 +123,24 @@ public abstract class UnaryOpItem extends GraphTargetItem implements UnaryOp {
return true;
}
@Override
public boolean valueEquals(GraphTargetItem obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final GraphTargetItem other = (GraphTargetItem) obj;
if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;