You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
461 B
23 lines
461 B
4 months ago
|
package com.sen.api.functions;
|
||
|
|
||
|
import java.math.BigDecimal;
|
||
|
|
||
|
public class MaxFunction implements Function{
|
||
|
|
||
|
@Override
|
||
|
public String execute(String[] args) {
|
||
|
BigDecimal maxValue=new BigDecimal(args[0]);
|
||
|
for(String numerial :args){
|
||
|
maxValue = maxValue.max(new BigDecimal(numerial));
|
||
|
}
|
||
|
return String.valueOf(maxValue);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public String getReferenceKey() {
|
||
|
// TODO Auto-generated method stub
|
||
|
return "max";
|
||
|
}
|
||
|
|
||
|
}
|