Package org.geotools.mbstyle.expression
Class MBMath
-
- All Implemented Interfaces:
Expression
,Function
public class MBMath extends MBExpression
-
-
Field Summary
-
Fields inherited from class MBExpression
colors, decisions, featureData, ff, heatMap, json, lookUp, math, name, parse, ramps, string, transformer, types, variableBindings, zoom
-
Fields inherited from class FunctionImpl
functionName
-
Fields inherited from interface Expression
NIL
-
-
Constructor Summary
Constructors Constructor Description MBMath(JSONArray json)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Expression
getExpression()
Determines which expression to use.Expression
mathAcos()
Returns the arccosine of the input.Expression
mathAdd()
Returns the sum of the inputs.Expression
mathAsin()
Returns the arcsine of the input.Expression
mathAtan()
Returns the arctangent of the input.Expression
mathCos()
Returns the cosine of the input.Expression
mathDivide()
Returns the result of floating point division of the first input by the second.Expression
mathE()
Returns the mathematical constant e.Expression
mathExponent()
Returns the result of raising the first input to the power specified by the second.Expression
mathLn()
Returns the natural logarithm of the input.Expression
mathLn2()
Returns mathematical constant ln(2).Expression
mathLog10()
Returns the base-ten logarithm of the input.Expression
mathLog2()
Returns the base-two logarithm of the input.Expression
mathMax()
Returns the maximum value of the inputs.Expression
mathMin()
Returns the minimum value of the inputs.Expression
mathMultiply()
Returns the product of the inputs.Expression
mathPi()
Returns the mathematical constant pi.Expression
mathRemainder()
Returns the remainder after integer division of the first input by the second.Expression
mathSin()
Returns the sine of the input.Expression
mathSqrt()
Returns the square root of the input.Expression
mathSubtract()
For two inputs, returns the result of subtracting the second input from the first.Expression
mathTan()
Returns the tangent of the input.-
Methods inherited from class MBExpression
canCreate, create, getName, throwInsufficientArgumentCount, throwUnexpectedArgumentCount, transformExpression, transformLiteral
-
Methods inherited from class FunctionImpl
accept, dispatchArguments, equals, evaluate, functionName, getFallbackValue, getFunctionName, getParameters, getParameterValue, getParameterValue, hashCode, setFallbackValue, setName, setParameters, toString
-
Methods inherited from class ExpressionAbstract
evaluate
-
Methods inherited from interface Expression
evaluate
-
-
-
-
Method Detail
-
mathSubtract
public Expression mathSubtract()
For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0. Example: ["-", number, number]: number ["-", number]: number- Returns:
- subtract expression
-
mathMultiply
public Expression mathMultiply()
Returns the product of the inputs. Example: ["*", number, number, ...]: number- Returns:
- multiply expression
-
mathDivide
public Expression mathDivide()
Returns the result of floating point division of the first input by the second. Example: ["/", number, number]: number- Returns:
- divide expression
-
mathRemainder
public Expression mathRemainder()
Returns the remainder after integer division of the first input by the second. Example: ["%", number, number]: number- Returns:
- remainder expression
-
mathExponent
public Expression mathExponent()
Returns the result of raising the first input to the power specified by the second. Example: ["^", number, number]: number- Returns:
- exponent expression
-
mathAdd
public Expression mathAdd()
Returns the sum of the inputs. Example: ["+", number, number...]: number- Returns:
- add expression
-
mathAcos
public Expression mathAcos()
Returns the arccosine of the input. Example: ["acos", number]: number- Returns:
- acos expression
-
mathAsin
public Expression mathAsin()
Returns the arcsine of the input. Example: ["asin", number]: number- Returns:
- asin expression
-
mathAtan
public Expression mathAtan()
Returns the arctangent of the input. Example: ["atan", number]: number- Returns:
- atan expression
-
mathCos
public Expression mathCos()
Returns the cosine of the input. Example: ["cos", number]: number- Returns:
- cos expression
-
mathE
public Expression mathE()
Returns the mathematical constant e. Example: ["e"]: number- Returns:
- constant e literal
-
mathLn
public Expression mathLn()
Returns the natural logarithm of the input. Example: ["ln", number]: number- Returns:
- log expression
-
mathLn2
public Expression mathLn2()
Returns mathematical constant ln(2). Example: ["ln2"]: number- Returns:
- min(2) as a literal
-
mathLog10
public Expression mathLog10()
Returns the base-ten logarithm of the input. Example: ["log10", number]: number- Returns:
- log10 expression
-
mathLog2
public Expression mathLog2()
Returns the base-two logarithm of the input. Example: ["log2", number]: number- Returns:
- base to log expression
-
mathMax
public Expression mathMax()
Returns the maximum value of the inputs. Example: ["max", number, number, ...]: number- Returns:
- max expression
-
mathMin
public Expression mathMin()
Returns the minimum value of the inputs. Example: ["min", number, number, ...]: number- Returns:
- min expression
-
mathPi
public Expression mathPi()
Returns the mathematical constant pi. Example: ["pi"]: number- Returns:
- pi literal
-
mathSin
public Expression mathSin()
Returns the sine of the input. Example: ["sin", number]: number- Returns:
- sin expression
-
mathSqrt
public Expression mathSqrt()
Returns the square root of the input. Example: ["sqrt", number]: number- Returns:
- sqrt expression
-
mathTan
public Expression mathTan()
Returns the tangent of the input. Example: ["tan", number]: number- Returns:
- tan expression
-
getExpression
public Expression getExpression() throws MBFormatException
Description copied from class:MBExpression
Determines which expression to use.- Specified by:
getExpression
in classMBExpression
- Throws:
MBFormatException
-
-