parent
6d8f9c2972
commit
0503080231
@ -0,0 +1,22 @@
|
|||||||
|
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";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in new issue