org.opensha.sra.gui.portfolioeal
Class Portfolio

java.lang.Object
  extended by org.opensha.sra.gui.portfolioeal.Portfolio

public class Portfolio
extends Object

The representation of a site portfolio, which holds assets and represents the model of the PortfolioEALCalculator.

Author:
Jeremy Leakakos
See Also:
PortfolioParser, Asset

Method Summary
 double calculatePortfolioEAL(ScalarIMR imr, double maxSourceDistance, Site site, BaseERF erf, PortfolioEALCalculatorController controller)
          This computes the EAL for a portfolio.
static Portfolio createPortfolio(File portfolioFile)
          This method acts as a factory of sorts.
 ArrayList<Asset> getAssetList()
           
 File getPortfolioFile()
           
 ArrayList<Site> getSiteList()
           
 void setPortfolioFile(File portfolioFile)
          Set the portofolio file for the given portfolio
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createPortfolio

public static Portfolio createPortfolio(File portfolioFile)
                                 throws IOException
This method acts as a factory of sorts. It is used to access the private portfolio constructor. It calls the constructor to create a portfolio object, and then calls a method to create/set the assets based on the file set in the constructor.

Parameters:
portfolioFile - The file the portfolio is based on.
Returns:
The created portfolio
Throws:
IOException

calculatePortfolioEAL

public double calculatePortfolioEAL(ScalarIMR imr,
                                    double maxSourceDistance,
                                    Site site,
                                    BaseERF erf,
                                    PortfolioEALCalculatorController controller)
This computes the EAL for a portfolio.

Parameters:
imr - The imr gotten from the view
value - The asset's value
site - The site that the asset is at
erf - The erf gotten from the view
controller - The controller

setPortfolioFile

public void setPortfolioFile(File portfolioFile)
Set the portofolio file for the given portfolio

Parameters:
portfolioFile - The portfolio file

getAssetList

public ArrayList<Asset> getAssetList()
Returns:
The list of assets stored in the portfolio

getSiteList

public ArrayList<Site> getSiteList()
Returns:
The list of sites associated with this portfolio

getPortfolioFile

public File getPortfolioFile()