1 package ejava.examples.ejbsessionbank.bo; 2 3 import java.io.Serializable; 4 5 public class Ledger implements Serializable { 6 private static final long serialVersionUID = 4664361360609429071L; 7 private long numberOfAccounts; 8 private double totalAssets; 9 private double aveAssets; 10 11 public Ledger( 12 long numberOfAccounts, double totalAssets, double aveAssets) { 13 setNumberOfAccounts(numberOfAccounts); 14 setTotalAssets(totalAssets); 15 setAverageAssets(aveAssets); 16 } 17 public double getAverageAssets() { 18 return aveAssets; 19 } 20 private void setAverageAssets(double aveAssets) { 21 this.aveAssets = aveAssets; 22 } 23 public long getNumberOfAccounts() { 24 return numberOfAccounts; 25 } 26 private void setNumberOfAccounts(long numberOfAccounts) { 27 this.numberOfAccounts = numberOfAccounts; 28 } 29 public double getTotalAssets() { 30 return totalAssets; 31 } 32 private void setTotalAssets(double totalAssets) { 33 this.totalAssets = totalAssets; 34 } 35 public String toString() { 36 StringBuilder text = new StringBuilder(); 37 text.append("# accts=" + numberOfAccounts); 38 text.append(", ave $=" + aveAssets); 39 text.append(", tot $=" + totalAssets); 40 return text.toString(); 41 } 42 }