/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package mytime.bll; import java.util.ArrayList; import java.util.List; import javafx.scene.Node; /** * * @author Stefan-VpcEB3J1E */ public class Sortings { private SortingStrategy[] strategies; public Sortings(SortingStrategy... strategies) { this.strategies = strategies; } /** * Apply the sortings strategies on the list. * @param listToSort * @return */ public List<Node> applyStrategies(List<Node> listToSort) { List<Node> returnList = new ArrayList<>(); for (SortingStrategy strategy : strategies) { returnList = strategy.sort(listToSort); } return returnList; } }