Class Minus
java.lang.Object
calculator.operations.Operation
calculator.operations.Minus
- All Implemented Interfaces:
Expression
This class represents the arithmetic operation "-".
The class extends an abstract superclass Operation.
Other subclasses of Operation represent other arithmetic operations.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionMinus(List<Expression> elist) Class constructor specifying a number of Expressions to subtract. -
Method Summary
Modifier and TypeMethodDescriptionintop(int l, int r) The actual computation of the (binary) arithmetic subtraction of two integersAbstract method representing the actual binary arithmetic operation to compute on Complexesop(IntegerAtom i1, IntegerAtom i2) The actual computation of the (binary) arithmetic subtraction of two IntegersAbstract method representing the actual binary arithmetic operation to compute on RationnalsThe actual computation of the (binary) arithmetic subtraction of two Reals
-
Constructor Details
-
Minus
Class constructor specifying a number of Expressions to subtract.- Parameters:
elist- The list of Expressions to subtract- Throws:
IllegalConstruction- If an empty list of expressions if passed as parameter- See Also:
-
-
Method Details
-
op
public int op(int l, int r) The actual computation of the (binary) arithmetic subtraction of two integers- Parameters:
l- The first integerr- The second integer that should be subtracted from the first- Returns:
- The integer that is the result of the subtraction
-
op
-
op
The actual computation of the (binary) arithmetic subtraction of two Integers -
op
Description copied from class:OperationAbstract method representing the actual binary arithmetic operation to compute on Complexes -
op
Description copied from class:OperationAbstract method representing the actual binary arithmetic operation to compute on Rationnals
-