<commit_before>package BusinessModel;

public class Action {

}<commit_msg>Actionklasse geimplementeerd<commit_after>package BusinessModel;

import java.util.ArrayList;
/**
 * A class representing an action.
 * 
 * @author team 10
 *
 */
public class Action {
	
	/**
	 * The description of the action
	 */
	private String description;
	/**
	 * The list of components needed for the action
	 */
	private ArrayList<Component> components;
	
	/**
	 * This method constructs a new action with a given description.
	 * @param 	description
	 * 			The description of the action
	 */
	public Action(String description) {
		this.setDescription(description);
		this.components = new ArrayList<Component>();
	}
	
	/**
	 * This method constructs a new action with a given description and list of components.
	 * 
	 * @param 	description
	 * 			The description of the action
	 * @param 	components
	 * 			The list of components needed for the action
	 */
	public Action(String description, ArrayList<Component> components) {
		this(description);
		this.setComponents(components);
	}
	
	/**
	 * This method returns the description of the action.
	 * @return	this.description
	 */
	public String getDescription() {
		return this.description;
	}
	
	/**
	 * This method returns the list of components needed for the action.
	 * @return	this.components
	 */
	public ArrayList<Component> getComponents() {
		return this.components;
	}
	
	/**
	 * This method sets the description of the action.
	 * (the description can be null)
	 * 
	 * @param	description
	 * 			The description of the action
	 */
	private void setDescription(String description) {
		this.description = description;
	}
	
	/**
	 * This method sets the components of the action.
	 * 
	 * @param 	components
	 * 			The components of the action.
	 * @throws 	IllegalArgumentException
	 * 			components == null
	 */
	private void setComponents(ArrayList<Component> components) throws IllegalArgumentException {
		if (components == null) throw new IllegalArgumentException();
		this.components = components;
	}
	
	/**
	 * This method adds a component to the action.
	 * 
	 * @param	component
	 * 			The component that needs to be added.
	 */
	public void addComponent(Component component) {
		if (!this.getComponents().contains(component)) {
			this.getComponents().add(component);
		}
	}
	
	/**
	 * This method removes a component needed for the action.
	 * 
	 * @param 	component
	 * 			The component that needs to be removed.
	 */
	public void removeComponent(Component component) {
		this.getComponents().remove(component);
	}

}
{'fraction_non_alphanumeric': 0.09324009324009325, 'fraction_numerical': 0.000777000777000777, 'mean_word_length': 3.4092465753424657, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '335926', 'n_tokens_mistral': 770, 'n_tokens_neox': 673, 'n_words': 241}