System.out.printf("\t\t\tOverall: %.2f%%\n", portfolioData.getReturnOverall() * 100.0);
if (portfolioData.getCostBasis() == null) {
System.out.println("\t\tCost Basis not specified");
} else {
for (int i = 0; i < portfolioData.getCostBasis().getMoney().size(); i++) {
Money m = portfolioData.getCostBasis().getMoney().get(i);
System.out.printf("\t\tThis portfolio cost %.2f %s.\n",
m.getAmount(), m.getCurrencyCode());
}
}
if (portfolioData.getDaysGain() == null) {
System.out.println("\t\tDay's Gain not specified");
} else {
for (int i = 0; i < portfolioData.getDaysGain().getMoney().size(); i++) {
Money m = portfolioData.getDaysGain().getMoney().get(i);
System.out.printf("\t\tThis portfolio made %.2f %s today.\n",
m.getAmount(), m.getCurrencyCode());
}
}
if (portfolioData.getGain() == null) {
System.out.println("\t\tTotal Gain not specified");
} else {
for (int i = 0; i < portfolioData.getGain().getMoney().size(); i++) {
Money m = portfolioData.getGain().getMoney().get(i);
System.out.printf("\t\tThis portfolio has a total gain of %.2f %s.\n",
m.getAmount(), m.getCurrencyCode());
}
}
if (portfolioData.getMarketValue() == null) {
System.out.println("\t\tMarket Value not specified");
} else {
for (int i = 0; i < portfolioData.getMarketValue().getMoney().size(); i++) {
Money m = portfolioData.getMarketValue().getMoney().get(i);
System.out.printf("\t\tThis portfolio is worth %.2f %s.\n",
m.getAmount(), m.getCurrencyCode());
}
}
}