package jcircus.environment; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; /** * ChannelSetEnv.java * * @author Angela Freitas */ public class ChannelSetEnv { /** * Associates the name of the channel set to a vector of names of sets * */ private Map> _map; /** * Constructor. */ public ChannelSetEnv() { _map = new LinkedHashMap>(); } /** * * @param chanSetName * @param channelSet */ public void insert(String chanSetName, Set channelSet) { _map.put(chanSetName, channelSet); } /** * * @param chanSetName * @return */ public Set get(String chanSetName) { return _map.get(chanSetName); } /** * Insert a channel name in a channel set name in this collection. * * @param chanSetName * @param nameChannel */ public void insert(String chanSetName, String chanName) { Set set; if (this._map.containsKey(chanSetName)) set = _map.get(chanSetName); else set = new LinkedHashSet(); set.add(chanName); _map.put(chanSetName, set); } }