Class MBLookup

All Implemented Interfaces:
Expression, Function

public class MBLookup extends MBExpression
  • Constructor Details

    • MBLookup

      public MBLookup(JSONArray json)
  • Method Details

    • 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]: value

      As 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]: boolean

      As 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 class MBExpression
      Throws:
      MBFormatException