001/** 002 * TabuList.java 003 * jCOLIBRI2 framework. 004 * @author Juan A. Recio-Garc�a. 005 * GAIA - Group for Artificial Intelligence Applications 006 * http://gaia.fdi.ucm.es 007 * 21/11/2007 008 */ 009package es.ucm.fdi.gaia.jcolibri.extensions.recommendation.tabuList; 010 011 012import java.util.ArrayList; 013import java.util.Collection; 014import java.util.List; 015 016import es.ucm.fdi.gaia.jcolibri.cbrcore.CBRCase; 017 018/** 019 * Implements a list of tabu items. 020 * Tabu items already were presented to the user so the must not presented again. 021 * @author Juan A. Recio-Garcia 022 * @author Developed at University College Cork (Ireland) in collaboration with Derek Bridge. 023 * @version 1.0 024 * 025 */ 026public class TabuList 027{ 028 private static ArrayList<CBRCase> tabu = new ArrayList<CBRCase>(); 029 030 /** 031 * Removes cases from the tabu list. 032 * @param cases to remove 033 * @return updated tabu list. 034 */ 035 public static List<CBRCase> removeTabuList(Collection<CBRCase> cases) 036 { 037 ArrayList<CBRCase> newList = new ArrayList<CBRCase>(cases); 038 newList.removeAll(tabu); 039 return newList; 040 } 041 042 /** 043 * Adds cases to the tabu list. 044 * @param tabuCases to add 045 */ 046 public static void updateTabuList(Collection<CBRCase> tabuCases) 047 { 048 tabu.addAll(tabuCases); 049 } 050}