public interface Operator
Modifier and Type | Field and Description |
---|---|
static Operator |
ABS_DIFF
Absolute difference operator, for arguments a
|
static Operator |
DIVIDE
Divide operator, for arguments a
|
static Operator |
MINUS
Minus operator, for arguments a
|
static Operator |
MULTIPLY
Multiply operator, for arguments a
|
static Operator |
PLUS
Plus operator, for arguments a
|
static Operator |
POW
Power operator, for arguments a
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDescription()
Should return a description of what the operator does to be shown by the reporter.
|
double |
result(double operand1,
double operand2)
This should return the desired of the result or the operation, depending on the operands.
|
static final Operator PLUS
a and b
returning a+b
.
-
MINUS
static final Operator MINUS
Minus operator, for arguments a and b
returning a-b
.
-
MULTIPLY
static final Operator MULTIPLY
Multiply operator, for arguments a and b
returning a-b
.
-
DIVIDE
static final Operator DIVIDE
Divide operator, for arguments a and b
returning a/b
.
-
POW
static final Operator POW
Power operator, for arguments a and b
returning a^b
.
-
ABS_DIFF
static final Operator ABS_DIFF
Absolute difference operator, for arguments a and b
returning |a-b|
.
-
Method Detail
-
result
double result(double operand1,
double operand2)
This should return the desired of the result or the operation, depending on the operands.
- Parameters:
operand1
-
operand2
-
- Returns:
- the result
-
getDescription
java.lang.String getDescription()
Should return a description of what the operator does to be shown by the reporter. Example: "sum", "product" etc.