Class ExpressionFactory.LengthFunction

java.lang.Object
org.openstreetmap.josm.gui.mappaint.mapcss.ExpressionFactory.LengthFunction
All Implemented Interfaces:
Expression
Enclosing class:
ExpressionFactory

public static class ExpressionFactory.LengthFunction extends Object implements Expression
Function to calculate the length of a string or list in a MapCSS eval expression.

Separate implementation to support overloading for different argument types.

The use for calculating the length of a list is deprecated, use Functions.count(java.util.List) instead (see #10061).

  • Field Details

  • Constructor Details

  • Method Details

    • evaluate

      public Object evaluate(Environment env)
      Description copied from interface: Expression
      Evaluate this expression.
      Specified by:
      evaluate in interface Expression
      Parameters:
      env - The environment
      Returns:
      the result of the evaluation, can be a List, String or any primitive type or wrapper classes of a primitive type.