Sum.java 411 Bytes
package kernel.function;

import kernel.Cell;
import kernel.LanguageEnum;

import java.util.List;

public class Sum extends Function {
	
	public Sum(List<Cell> listCells) {
		super(listCells);
		this.getNames().put(LanguageEnum.FR, "SOMME");
		this.getNames().put(LanguageEnum.EN, "SUM");
	}
	
	@Override
	public double eval() {
		return this.getUtilisedCells().stream().mapToDouble(Cell::getValue).sum();
	}
}