Class Divides
java.lang.Object
calculator.operations.Operation
calculator.operations.Divides
- All Implemented Interfaces:
Expression
This class represents the arithmetic division operation "/".
The class extends an abstract superclass Operation.
Other subclasses of Operation represent other arithmetic operations.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionDivides(List<Expression> elist) Class constructor specifying a number of Expressions to divide. -
Method Summary
Modifier and TypeMethodDescriptionintop(int l, int r) The actual computation of the (binary) arithmetic division 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 division of two IntegersAbstract method representing the actual binary arithmetic operation to compute on RationnalsThe actual computation of the (binary) arithmetic division of two Reals
-
Constructor Details
-
Divides
Class constructor specifying a number of Expressions to divide.- Parameters:
elist- The list of Expressions to divide- 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 division of two integers- Parameters:
l- The first integerr- The second integer that should divide the first- Returns:
- The integer that is the result of the division
-
op
-
op
The actual computation of the (binary) arithmetic division 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
-