/* File: UserProfile.java
 * Author: Jason Gookins
 * Description: This class represents a UserProfile object for storing known distributions.
 */

import java.util.ArrayList;

public class View
{
	/************************
	 ** Instance Variables **
	 ************************/

	private String name;
	private ArrayList<Node> givenDistNodes;
	private ArrayList<ArrayList<Integer>> givenDistributions;
	private ArrayList<Node> goalDistNodes;
	private ArrayList<ArrayList<Integer>> goalDistributions;



	/**********************
	 ** Main Constructor **
	 **********************/

	public View(String name)
	{
		this.name = name;

		givenDistNodes = new ArrayList<Node>();
		givenDistributions = new ArrayList<ArrayList<Integer>>();
		goalDistNodes = new ArrayList<Node>();
		goalDistributions = new ArrayList<ArrayList<Integer>>();
	}



	/***************
	 ** Accessors **
	 ***************/

	public String getName()
	{
		return this.name;
	}

	public ArrayList<Node> getGivenDistNodes()
	{
		return this.givenDistNodes;
	}

	public ArrayList<ArrayList<Integer>> getGivenDistributions()
	{
		return this.givenDistributions;
	}

	public ArrayList<Node> getGoalDistNodes()
	{
		return this.goalDistNodes;
	}

	public ArrayList<ArrayList<Integer>> getGoalDistributions()
	{
		return this.goalDistributions;
	}



	/**************
	 ** Mutators **
	 **************/

	public void setName(String newName)
	{
		this.name = newName;
	}

	public void setGivenDistNodes(ArrayList<Node> newGivenDistNodes)
	{
		this.givenDistNodes = newGivenDistNodes;
	}

	public void setGivenDistributions(ArrayList<ArrayList<Integer>> newGivenDistributions)
	{
		this.givenDistributions = newGivenDistributions;
	}

	public void setGoalDistNodes(ArrayList<Node> newGoalDistNodes)
	{
		this.goalDistNodes = newGoalDistNodes;
	}

	public void setGoalDistributions(ArrayList<ArrayList<Integer>> newGoalDistributions)
	{
		this.goalDistributions = newGoalDistributions;
	}



	/**********************
	 ** Instance Methods **
	 **********************/

	public void addGivenDistNode(Node givenDistNode, ArrayList<Integer> givenDistribution)
	{
		givenDistNodes.add(givenDistNode);
		givenDistributions.add(givenDistribution);
	}

	public void removeGivenDistNode(Node givenDistNode)
	{
		int index = givenDistNodes.indexOf(givenDistNode);

		givenDistNodes.remove(givenDistNode);
		givenDistributions.remove(index);
	}

	public void addGoalDistNode(Node goalDistNode, ArrayList<Integer> goalDistribution)
	{
		goalDistNodes.add(goalDistNode);
		goalDistributions.add(goalDistribution);
	}

	public void removeGoalDistNode(Node goalDistNode)
	{
		int index = goalDistNodes.indexOf(goalDistNode);

		goalDistNodes.remove(goalDistNode);
		goalDistributions.remove(index);
	}
}
