Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mandarax.eca.example
Class Portfolio  view Portfolio download Portfolio.java

java.lang.Object
  extended byorg.mandarax.eca.example.Portfolio

public class Portfolio
extends java.lang.Object

Class representing a portfolio of investments (e.g., shares).


Field Summary
private  java.util.List investments
           
 
Constructor Summary
Portfolio()
          Constructor.
 
Method Summary
 void add(Investment inv)
          Add an investment.
 java.util.List getInvestments()
          Get a list of all investments.
 double getRelativeValue(Investment inv)
          Get the relative value of a portfolio in an investment.
 double getTotalValue()
          Get the total value of all investments.
 void remove(Investment inv)
          Remove an investment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

investments

private java.util.List investments
Constructor Detail

Portfolio

public Portfolio()
Constructor.

Method Detail

add

public void add(Investment inv)
Add an investment.


remove

public void remove(Investment inv)
Remove an investment.


getTotalValue

public double getTotalValue()
Get the total value of all investments.


getRelativeValue

public double getRelativeValue(Investment inv)
Get the relative value of a portfolio in an investment.


getInvestments

public java.util.List getInvestments()
Get a list of all investments.