Blame view

src/kernel/function/Sum.java 381 Bytes
2e8fbd04   Remi   global refactor
1
2
3
  package kernel.function;
  
  import kernel.Cell;
94ba86ff   Remi   Auto stash before...
4
  import kernel.LanguageEnum;
2e8fbd04   Remi   global refactor
5
  
94ba86ff   Remi   Auto stash before...
6
  import java.util.List;
2e8fbd04   Remi   global refactor
7
8
  
  public class Sum extends Function {
4186cd92   Remi   fix tests
9
10
11
12
13
14
15
16
17
18
  	
  	public Sum(List<Cell> listCells) {
  		super(listCells);
  		this.names.put(LanguageEnum.FR, "SOMME");
  		this.names.put(LanguageEnum.EN, "SUM");
  	}
  	
  	public double eval() {
  		return this.listCells.stream().mapToDouble(Cell::getValue).sum();
  	}
2e8fbd04   Remi   global refactor
19
  }