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 java.lang.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 Summary
Fields Modifier and Type Field Description private Expression
arg
-
Constructor Summary
Constructors Constructor Description LengthFunction(Expression args)
Constructs a newLengthFunction
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
evaluate(Environment env)
Evaluate this expression.
-
-
-
Field Detail
-
arg
private final Expression arg
-
-
Constructor Detail
-
LengthFunction
public LengthFunction(Expression args)
Constructs a newLengthFunction
.- Parameters:
args
- arguments
-
-
Method Detail
-
evaluate
public java.lang.Object evaluate(Environment env)
Description copied from interface:Expression
Evaluate this expression.- Specified by:
evaluate
in 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.
-
-