- Type Parameters:
N
- Number type
- All Superinterfaces:
Comparable<N>
- All Known Implementing Classes:
RationalNumber
An interface to define requirements for a number to perform arithmetic
operations. The Numbers are supposed to remain unchanged by an arithmetic
operation.
- Author:
- Arthur Zimek
-
Method Summary
Methods inherited from interface java.lang.Comparable
compareTo
-
Method Details
-
plus
Adds the given number to this number.- Parameters:
number
- the number to add to this number.- Returns:
- the result of arithmetic addition of this Number with the given number
-
times
Multiplies this number with the given number.- Parameters:
number
- the number to multiply this number with- Returns:
- the result of arithmetic multiplication of this Number with the given number
-
minus
Subtracts the given number from this number.- Parameters:
number
- the number to subtract from this number- Returns:
- the result of arithmetic subtraction of the given number from this Number
-
divided
Divides this number by the given number.- Parameters:
number
- the number to divide this number by- Returns:
- the result of arithmetic division of this Number by the given number
-