package eu.dnetlib.dlms.epub;

import java.util.ArrayList;
import java.util.Collection;

/**
 * Instances of this class represent union sets to be created. This class holds all relevant information user would like
 * to supply when creating a UnionSet.
 * 
 * @author lexis
 */
public class UnionSetToCreate extends SetToCreate {
	/** Collection of the set names involved by the UnionSet represented by this. */
	private Collection<String> setNames = new ArrayList<String>();

	/** Constructor. */
	public UnionSetToCreate() {
		//left blank
	}

	/**
	 * Constructor.
	 * 
	 * @param names
	 *            Collection of String, the names of sets to be included in the union this instance represents.
	 */
	public UnionSetToCreate(final Collection<String> names) {
		this.setNames = names;
	}

	public void setSetNames(final Collection<String> setNames) {
		this.setNames = setNames;
	}

	public Collection<String> getSetNames() {
		return this.setNames;
	}

	/**
	 * Adds the given string to the list of set names.
	 * 
	 * @param setName
	 *            name of a set to add
	 */
	public void addSetName(final String setName) {
		this.setNames.add(setName);
	}

	/**
	 * Removes the given string from the collection of set names.
	 * 
	 * @param setName
	 *            name of the set to remove
	 * @return true if the string was in the collection and has been removed, false if it was not in the collection
	 */
	public boolean removeSetName(final String setName) {
		return this.setNames.remove(setName);
	}
}
