package control;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

public class Investor
{
	// This class exactly maps to theinvestor table.
	// It also acts as a container.
	private int investorId;
	private String firstName;
	private String lastName;
	private String email;
	private double currentFunds;
	private double totalGain;
	
	private List portfolios = new ArrayList();
	
	public Investor()
	{
		
	}
	
	public int getInvestorId() {
		return investorId;
	}
	public void setInvestorId(int investorId) {
		this.investorId = investorId;
	}
	public String getFirstName() {
		return firstName;
	}
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	public String getLastName() {
		return lastName;
	}
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public double getCurrentFunds() {
		return currentFunds;
	}
	public void setCurrentFunds(double currentFunds) {
		this.currentFunds = currentFunds;
	}
	public double getTotalGain() {
		return totalGain;
	}
	public void setTotalGain(double totalGain) {
		this.totalGain = totalGain;
	}
	
	
	public void loadFromResultSet(ResultSet rs)
		throws SQLException
	{
		this.setEmail((String) rs.getString("email"));
		this.setFirstName((String) rs.getString("first_name"));
		this.setLastName((String) rs.getString("last_name"));
		this.setCurrentFunds(rs.getDouble("current_funds"));
		this.setTotalGain(rs.getDouble("total_gain"));
	}
	
	public void addPortfolio()
	{
		
	}

}
