package com.hammurapi.reasoning.impl;

import java.util.List;
import java.util.Set;

/**
 * Implementations of this interface are used to
 * manage collections to keep intermediate inference results.
 * Returned collections which hold resources shall implement Destroyable.
 * @author Pavel Vlasov
 *
 */
public interface CollectionManager<B> {

	/**
	 * Retrieves set with given id from the manager. If set doesn't exist,
	 * it shall be created.
	 * @param <T>
	 * @param id Set id.
	 * @param elementType Element type.
	 * @return
	 */
	<T extends B> Set<? extends T> getSet(String id, Class<T> elementType);
	
	/**
	 * Retrieves list with given id from the manager. If list doesn't exist,
	 * it shall be created.
	 * @param <T>
	 * @param id Set id.
	 * @param elementType Element type.
	 * @return
	 */
	<T extends B> List<? extends T> getList(String id, Class<T> elementType);
}
