Package org.oristool.lello
Class ValueOperations
java.lang.Object
org.oristool.lello.ValueOperations
This class contains all the logic behind Lello unary and binary operators.
All the methods throw an exception if the arguments are not compatible with
the operation; compatible types are combined by first converting them to the
same type, always converting the less accurate to the most accurate.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Value
Implements addition.static Value
Implements logical AND.static Value
Implements division.static Value
Implements equality comparison.static Value
Implements greater than comparison.static Value
Implements greater than or equal comparison.static Value
Implements less than comparison.static Value
Implements less than or equal comparison.static Value
Implements modulus (also floating point modulus).static Value
Implements multiplication.static Value
Implements unary minus.static Value
Implements inequality comparison.static Value
Implements logical NOT.static Value
Implements logical OR.static Value
Implements unary plus.static Value
Implements power.static Value
Implements subtraction.
-
Constructor Details
-
ValueOperations
public ValueOperations()
-
-
Method Details
-
add
Implements addition.- Parameters:
lhs
- Left hand side operand.rhs
- Right hand side operand.- Returns:
- Their sum.
-
sub
Implements subtraction.- Parameters:
lhs
- Left hand side operand.rhs
- Right hand side operand.- Returns:
- Their difference.
-
mul
Implements multiplication.- Parameters:
lhs
- Left hand side operand.rhs
- Right hand side operand.- Returns:
- Their product.
-
div
Implements division.- Parameters:
lhs
- Left hand side operand.rhs
- Right hand side operand.- Returns:
- Their quotient.
-
mod
Implements modulus (also floating point modulus).- Parameters:
lhs
- Left hand side operand.rhs
- Right hand side operand.- Returns:
- The remainder of lhs / rhs.
-
raise
Implements power. The result is always REAL.- Parameters:
lhs
- Base.rhs
- Exponent.- Returns:
- lhs^rhs as REAL.
-
lt
Implements less than comparison.- Parameters:
lhs
- Left hand side operand.rhs
- Right hand side operand.- Returns:
- Whether it is true that
lhs < rhs
or not.
-
lte
Implements less than or equal comparison.- Parameters:
lhs
- Left hand side operand.rhs
- Right hand side operand.- Returns:
- Whether it is true that
lhs <= rhs
or not.
-
gt
Implements greater than comparison.- Parameters:
lhs
- Left hand side operand.rhs
- Right hand side operand.- Returns:
- Whether it is true that
lhs > rhs
or not.
-
gte
Implements greater than or equal comparison.- Parameters:
lhs
- Left hand side operand.rhs
- Right hand side operand.- Returns:
- Whether it is true that
lhs >= rhs
or not.
-
eq
Implements equality comparison.- Parameters:
lhs
- Left hand side operand.rhs
- Right hand side operand.- Returns:
- Whether it is true that lhs == rhs or not.
-
neq
Implements inequality comparison.- Parameters:
lhs
- Left hand side operand.rhs
- Right hand side operand.- Returns:
- Whether it is true that lhs != rhs or not.
-
and
Implements logical AND.- Parameters:
lhs
- Left hand side operand.rhs
- Right hand side operand.- Returns:
- lhs AND rhs.
-
or
Implements logical OR.- Parameters:
lhs
- Left hand side operand.rhs
- Right hand side operand.- Returns:
- lhs OR rhs.
-
pos
Implements unary plus.- Parameters:
u
- The operand.- Returns:
- Value +u.
-
neg
Implements unary minus.- Parameters:
u
- The operand.- Returns:
- Value -u.
-
not
Implements logical NOT.- Parameters:
u
- The operand.- Returns:
- Value NOT(u).
-