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 java.lang.Object implements Expression
Computes the maximum/minimum value an arbitrary number of floats, or a list of floats.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Expression>argsprivate booleancomputeMax
-
Constructor Summary
Constructors Constructor Description MinMaxFunction(java.util.List<Expression> args, boolean computeMax)Constructs a newMinMaxFunction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.FloataggregateList(java.util.List<?> lst)Compute the minimum / maximum over the listjava.lang.Objectevaluate(Environment env)Evaluate this expression.
-
-
-
Field Detail
-
args
private final java.util.List<Expression> args
-
computeMax
private final boolean computeMax
-
-
Constructor Detail
-
MinMaxFunction
public MinMaxFunction(java.util.List<Expression> args, boolean computeMax)
Constructs a newMinMaxFunction.- Parameters:
args- argumentscomputeMax- iftrue, compute max. Iffalse, compute min
-
-
Method Detail
-
aggregateList
public java.lang.Float aggregateList(java.util.List<?> lst)
Compute the minimum / maximum over the list- Parameters:
lst- The list- Returns:
- The minimum or maximum depending on
computeMax
-
evaluate
public java.lang.Object evaluate(Environment env)
Description copied from interface:ExpressionEvaluate this expression.- Specified by:
evaluatein interfaceExpression- 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.
-
-