Somme.java 531 Bytes
package noyau;

import java.util.*;
import java.util.stream.Collectors;

public class Somme extends Fonctions{

	public String toString(){
		
		return "SOMME(" + listCases.stream()
		        .map( n -> n.getId() )
		        .collect( Collectors.joining( "," ) )
		        +")";
	}
	
	public String getFormuleDeveloppe(){
		
		return "";
	}
	
	public double eval() {
	    
		double val=0;

	    if (listCases.size() != 0)
	    	for(int i=0; i<listCases.size(); i++)
	    		val += listCases.get(i).getValue();

	    return val;
	}
}