Blame view

src/kernel/function/Sum.java 411 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
  	
  	public Sum(List<Cell> listCells) {
  		super(listCells);
080a0e68   Remi   change return
12
13
  		this.getNames().put(LanguageEnum.FR, "SOMME");
  		this.getNames().put(LanguageEnum.EN, "SUM");
4186cd92   Remi   fix tests
14
15
  	}
  	
080a0e68   Remi   change return
16
  	@Override
4186cd92   Remi   fix tests
17
  	public double eval() {
080a0e68   Remi   change return
18
  		return this.getUtilisedCells().stream().mapToDouble(Cell::getValue).sum();
4186cd92   Remi   fix tests
19
  	}
2e8fbd04   Remi   global refactor
20
  }