Class ExpressionFactory.MinMaxFunction

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

public static class ExpressionFactory.MinMaxFunction extends Object implements Expression
Computes the maximum/minimum value an arbitrary number of floats, or a list of floats.
  • Field Details

  • Constructor Details

    • MinMaxFunction

      public MinMaxFunction(List<Expression> args, boolean computeMax)
      Constructs a new MinMaxFunction.
      Parameters:
      args - arguments
      computeMax - if true, compute max. If false, compute min
  • Method Details

    • aggregateList

      public Float aggregateList(List<?> lst)
      Compute the minimum / maximum over the list
      Parameters:
      lst - The list
      Returns:
      The minimum or maximum depending on computeMax
    • 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.