org.opensha.sra.gui.portfolioeal
Class PortfolioParser

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

public class PortfolioParser
extends java.lang.Object

This class parses a well-formatted portfolio file and turns it in to Asset objects. These Assets in turn are used by the PortfolioEALCalculatorController to make EAL calculations. A standard portfolio file should be a csv file. Each value may also have one set of quotations, to allow for slightly different formats.

Author:
Jeremy Leakakos
See Also:
Asset, Portfolio

Constructor Summary
PortfolioParser()
          The default constructor for the class.
 
Method Summary
 java.util.ArrayList<Asset> scanFile(java.io.File portfolioFile)
          This method scans and parses the file in the portfolio.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortfolioParser

public PortfolioParser()
The default constructor for the class.

Method Detail

scanFile

public java.util.ArrayList<Asset> scanFile(java.io.File portfolioFile)
                                    throws java.lang.NumberFormatException
This method scans and parses the file in the portfolio. It breaks the file up by line, with each line being a separate Asset. The first line defines the parameters that will be stored in each asset. The Clone() method defined in Asset is used to allow for easy creation of assets with arbitrary parameters.

Throws:
java.lang.NumberFormatException