Package org.geotools.mbstyle.expression
Class MBLookup
- Object
-
- ExpressionAbstract
-
- FunctionImpl
-
- MBExpression
-
- MBLookup
-
- All Implemented Interfaces:
Expression
,Function
public class MBLookup 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 MBLookup(JSONArray json)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Expression
getExpression()
Determines which expression to use.Expression
lookupAt()
Retrieves an item from an array.Expression
lookupGet()
Retrieves a property value from the current feature's properties, or from another object if a second argument is provided.Expression
lookupHas()
Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.Expression
lookupLength()
Gets the length of an array or string.-
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
-
lookupAt
public Expression lookupAt()
Retrieves an item from an array. Example: ["at", number, array]: ItemType- Returns:
- lookup array element expression
-
lookupGet
public Expression lookupGet()
Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns null if the requested property is missing. Example: ["get", string]: value ["get", string, object]: valueAs a note, the mbstyle requires json objects for lookup, and evaluates the object as such.
- Returns:
- lookup map property by bame expression
-
lookupHas
public Expression lookupHas()
Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided. Example: ["has", string]: boolean ["has", string, object]: booleanAs a note, the mbstyle requires json objects for lookup, and evaluates the object as such.
- Returns:
- check of properties contains key expression
-
lookupLength
public Expression lookupLength()
Gets the length of an array or string. Example: ["length", string]: number ["length", array]: number- Returns:
- length of array expression
-
getExpression
public Expression getExpression() throws MBFormatException
Description copied from class:MBExpression
Determines which expression to use.- Specified by:
getExpression
in classMBExpression
- Throws:
MBFormatException
-
-