Overrides toString and equals methods of the relative block vector to make it testable
This commit is contained in:
parent
a475e8d8b1
commit
c422cb9ea9
@ -54,4 +54,19 @@ public class RelativeBlockVector {
|
|||||||
return distance;
|
return distance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return String.format("right = %d, depth = %d, distance = %d", right, depth, distance);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object other) {
|
||||||
|
if (!(other instanceof RelativeBlockVector)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
RelativeBlockVector otherVector = (RelativeBlockVector) other;
|
||||||
|
return this.right == otherVector.right && this.depth == otherVector.depth &&
|
||||||
|
this.distance == otherVector.distance;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user