maxarithmetic.java
来自「sample目录下是例子程序。 1.分组汇总例子 TestGroupRep」· Java 代码 · 共 44 行
JAVA
44 行
package com.lucaslee.report.grouparithmetic;
import java.util.Arrays;
import com.lucaslee.report.ReportException;
/**
* 取最大值。
* <p>
* Title:
* </p>
* <p>
* Description:
* </p>
* <p>
* Copyright: Copyright (c) 2003
* </p>
* <p>
* Company:Lucas-lee Soft
* </p>
*
* @author Lucas Lee
* @version 1.0
*/
public class MaxArithmetic implements GroupArithmetic {
public MaxArithmetic() {
}
/**
* 参考父类文档。
*
* @param values
* @return
* @throws ReportException
*/
public String getResult(double[] values) throws ReportException {
if (values == null) {
throw new ReportException("values can not be null.");
}
double[] temp = (double[]) values.clone();
Arrays.sort(temp);
return Double.toString(values[temp.length - 1]);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?