org.opensha.sra.gui.portfolioeal
Class PortfolioParser
java.lang.Object
org.opensha.sra.gui.portfolioeal.PortfolioParser
public class PortfolioParser
- extends 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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PortfolioParser
public PortfolioParser()
- The default constructor for the class.
scanFile
public ArrayList<Asset> scanFile(File portfolioFile)
throws 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:
NumberFormatException