We have implemented our algorithm in the ConcurrentMainRecommendation class to obtain the list of recommended products to a customer. This class implements the main() method that receives as a parameter the ID of the customer whose recommended products we want to obtain. We have the following code:
public static void main(String[] args) { String user = args[0]; Path file = Paths.get("data"); try { Date start, end; start=new Date();
We have used different streams to transform the data in the final solution. The first one loads the whole list of the Product objects from its files:
List<Product> productList = Files.walk(file, FileVisitOption .FOLLOW_LINKS).parallel().filter(f-> f .toString().endsWith(".txt")) ...