Class NumberFunctions
java.lang.Object
com.couchbase.client.java.query.dsl.functions.NumberFunctions
@Experimental @Public public class NumberFunctions extends Object
DSL for N1QL functions in the Numbers category.
Number functions are functions that are performed on a numeric field.
- Since:
- 2.2
- Author:
- Simon Baslé
-
Method Summary
Modifier and Type Method Description static Expressionabs(Expression expression)Returned expression results in the absolute value of the number.static Expressionabs(Number value)Returned expression results in the absolute value of the number.static Expressionacos(Expression expression)Returned expression results in the arccosine in radians.static Expressionacos(Number value)Returned expression results in the arccosine in radians.static Expressionasin(Expression expression)Returned expression results in the arcsine in radians.static Expressionasin(Number value)Returned expression results in the arcsine in radians.static Expressionatan(Expression expression)Returned expression results in the arctangent in radians.static Expressionatan(Expression expression1, Expression expression2)Returned expression results in the arctangent of expression2/expression1.static Expressionatan(Number value)Returned expression results in the arctangent in radians.static Expressionatan(String expression1, String expression2)Returned expression results in the arctangent of expression2/expression1.static Expressionceil(Expression expression)Returned expression results in the smallest integer not less than the number.static Expressionceil(Number value)Returned expression results in the smallest integer not less than the number.static Expressioncos(Expression expression)Returned expression results in the cosine.static Expressioncos(Number value)Returned expression results in the cosine.static Expressiondegrees(Expression expression)Returned expression results in the conversion of radians to degrees.static Expressiondegrees(Number value)Returned expression results in the conversion of radians to degrees.static Expressione()Returned expression results in the base of natural logarithms.static Expressionexp(Expression expression)Returned expression results in the exponential of expression.static Expressionexp(Number value)Returned expression results in the exponential of expression.static Expressionfloor(Expression expression)Returned expression results in the largest integer not greater than the number.static Expressionfloor(Number value)Returned expression results in the largest integer not greater than the number.static Expressionln(Expression expression)Returned expression results in the log base e.static Expressionln(Number value)Returned expression results in the log base e.static Expressionlog(Expression expression)Returned expression results in the log base 10.static Expressionlog(Number value)Returned expression results in the log base 10.static Expressionpi()Returned expression results in Pi.static Expressionpower(Expression expression1, Expression expression2)Returned expression results in expression1 to the power of expression2.static Expressionpower(Number value1, Number value2)Returned expression results in value1 to the power of value2.static Expressionradians(Expression expression)Returned expression results in the conversion of degrees to radians.static Expressionradians(Number value)Returned expression results in the conversion of degrees to radians.static Expressionrandom()Returned expression results in a pseudo-random number with default seed.static Expressionrandom(Expression seed)Returned expression results in a pseudo-random number with optional seed.static Expressionrandom(Number seed)Returned expression results in a pseudo-random number with optional seed.static Expressionround(Expression expression)Returned expression results in the value rounded to 0 digits to the right of the decimal point.static Expressionround(Expression expression, int digits)Returned expression results in the value rounded to the given number of integer digits to the right of the decimal point (left if digits is negative).static Expressionround(Number expression)Returned expression results in the value rounded to 0 digits to the right of the decimal point.static Expressionround(Number expression, int digits)Returned expression results in the value rounded to the given number of integer digits to the right of the decimal point (left if digits is negative).static Expressionsign(Expression expression)Returned expression results in the sign of the numerical expression, represented as -1, 0, or 1 for negative, zero, or positive numbers respectively.static Expressionsign(Number value)Returned expression results in the sign of the numerical expression, represented as -1, 0, or 1 for negative, zero, or positive numbers respectively.static Expressionsin(Expression expression)Returned expression results in the sine.static Expressionsin(Number value)Returned expression results in the sine.static ExpressionsquareRoot(Expression expression)Returned expression results in the square root.static ExpressionsquareRoot(Number value)Returned expression results in the square root.static Expressiontan(Expression expression)Returned expression results in the tangent.static Expressiontan(Number value)Returned expression results in the tangent.static Expressiontrunc(Expression expression)Returned expression results in a truncation of the number to 0 digits to the right of the decimal point.static Expressiontrunc(Expression expression, int digits)Returned expression results in a truncation of the number to the given number of integer digits to the right of the decimal point (left if digits is negative).static Expressiontrunc(Number value)Returned expression results in a truncation of the number to 0 digits to the right of the decimal point.static Expressiontrunc(Number value, int digits)Returned expression results in a truncation of the number to the given number of integer digits to the right of the decimal point (left if digits is negative).
-
Method Details
-
abs
Returned expression results in the absolute value of the number. -
abs
Returned expression results in the absolute value of the number. -
acos
Returned expression results in the arccosine in radians. -
acos
Returned expression results in the arccosine in radians. -
asin
Returned expression results in the arcsine in radians. -
asin
Returned expression results in the arcsine in radians. -
atan
Returned expression results in the arctangent in radians. -
atan
Returned expression results in the arctangent in radians. -
atan
Returned expression results in the arctangent of expression2/expression1. -
atan
Returned expression results in the arctangent of expression2/expression1. -
ceil
Returned expression results in the smallest integer not less than the number. -
ceil
Returned expression results in the smallest integer not less than the number. -
cos
Returned expression results in the cosine. -
cos
Returned expression results in the cosine. -
degrees
Returned expression results in the conversion of radians to degrees. -
degrees
Returned expression results in the conversion of radians to degrees. -
e
Returned expression results in the base of natural logarithms. -
exp
Returned expression results in the exponential of expression. -
exp
Returned expression results in the exponential of expression. -
ln
Returned expression results in the log base e. -
ln
Returned expression results in the log base e. -
log
Returned expression results in the log base 10. -
log
Returned expression results in the log base 10. -
floor
Returned expression results in the largest integer not greater than the number. -
floor
Returned expression results in the largest integer not greater than the number. -
pi
Returned expression results in Pi. -
power
Returned expression results in expression1 to the power of expression2. -
power
Returned expression results in value1 to the power of value2. -
radians
Returned expression results in the conversion of degrees to radians. -
radians
Returned expression results in the conversion of degrees to radians. -
random
Returned expression results in a pseudo-random number with optional seed. -
random
Returned expression results in a pseudo-random number with optional seed. -
random
Returned expression results in a pseudo-random number with default seed. -
round
Returned expression results in the value rounded to 0 digits to the right of the decimal point. -
round
Returned expression results in the value rounded to the given number of integer digits to the right of the decimal point (left if digits is negative). -
round
Returned expression results in the value rounded to 0 digits to the right of the decimal point. -
round
Returned expression results in the value rounded to the given number of integer digits to the right of the decimal point (left if digits is negative). -
sign
Returned expression results in the sign of the numerical expression, represented as -1, 0, or 1 for negative, zero, or positive numbers respectively. -
sign
Returned expression results in the sign of the numerical expression, represented as -1, 0, or 1 for negative, zero, or positive numbers respectively. -
sin
Returned expression results in the sine. -
sin
Returned expression results in the sine. -
squareRoot
Returned expression results in the square root. -
squareRoot
Returned expression results in the square root. -
tan
Returned expression results in the tangent. -
tan
Returned expression results in the tangent. -
trunc
Returned expression results in a truncation of the number to the given number of integer digits to the right of the decimal point (left if digits is negative). -
trunc
Returned expression results in a truncation of the number to the given number of integer digits to the right of the decimal point (left if digits is negative). -
trunc
Returned expression results in a truncation of the number to 0 digits to the right of the decimal point. -
trunc
Returned expression results in a truncation of the number to 0 digits to the right of the decimal point.
-