Examples of StockAccount


Examples of bigbank.accountdata.StockAccount

        System.out.println("Checking account: " + checking);

        SavingsAccount savings = accountDataService.getSavingsAccount(customerID);
        System.out.println("Savings account: " + savings);

        StockAccount stock = accountDataService.getStockAccount(customerID);
        System.out.println("Stock account: " + stock);
       
        // Get the stock price in USD
        double price = stockQuoteService.getQuote(stock.getSymbol());
        System.out.println("Stock price for " + stock.getSymbol() + ": " + price);

        // Convert to the configured currency
        if (currency.equals("EURO")) {
           
            // Use our fancy calculator service to convert to the target currency
            price = calculatorService.multiply(price, 0.70);
           
            System.out.println("Converted to " + currency + ": " + price);
        }
       
        // Calculate the value of the stock account
        double stockValue = price * stock.getQuantity();
       
        // Calculate the total balance of all accounts and return it
        double balance = checking.getBalance() + savings.getBalance() + stockValue;
       
        return balance;
View Full Code Here

Examples of bigbank.accountdata.StockAccount

        summaries.add(ca.getSummary());

        SavingsAccount sa = accountDataService.getSavingsAccount(s);
        summaries.add(sa.getSummary());

        StockAccount sk = accountDataService.getStockAccount(s);
        summaries.add(sk.getSummary());

        AccountReport report = new AccountReport(currency, summaries);
       
        return report;
    }
View Full Code Here

Examples of bigbank.accountdata.StockAccount

        System.out.println("Checking account: " + checking);

        SavingsAccount savings = accountDataService.getSavingsAccount(customerID);
        System.out.println("Savings account: " + savings);

        StockAccount stock = accountDataService.getStockAccount(customerID);
        System.out.println("Stock account: " + stock);
       
        // Get the stock price in USD
        double price = stockQuoteService.getQuote(stock.getSymbol());
        System.out.println("Stock price for " + stock.getSymbol() + ": " + price);

        // Convert to the configured currency
        if (currency.equals("EURO")) {
           
            // Use our fancy calculator service to convert to the target currency
            price = calculatorService.multiply(price, 0.70);
           
            System.out.println("Converted to " + currency + ": " + price);
        }
       
        // Calculate the value of the stock account
        double stockValue = price * stock.getQuantity();
       
        // Calculate the total balance of all accounts and return it
        double balance = checking.getBalance() + savings.getBalance() + stockValue;
       
        return balance;
View Full Code Here

Examples of bigbank.accountdata.StockAccount

        summaries.add(ca.getSummary());

        SavingsAccount sa = accountDataService.getSavingsAccount(s);
        summaries.add(sa.getSummary());

        StockAccount sk = accountDataService.getStockAccount(s);
       
        double price = stockQuoteService.getQuote(sk.getSymbol());
        sk.setBalance(sk.getQuantity() * price);
       
        summaries.add(sk.getSummary());

        AccountReport report = new AccountReport(currency, summaries);
       
        return report;
    }
View Full Code Here

Examples of bigbank.accountdata.StockAccount

        System.out.println("Checking account: " + checking);

        SavingsAccount savings = accountDataService.getSavingsAccount(customerID);
        System.out.println("Savings account: " + savings);

        StockAccount stock = accountDataService.getStockAccount(customerID);
        System.out.println("Stock account: " + stock);
       
        // Get the stock price in USD
        double price = stockQuoteService.getQuote(stock.getSymbol());
        System.out.println("Stock price for " + stock.getSymbol() + ": " + price);

        // Convert to the configured currency
        if (currency.equals("EURO")) {
           
            // Use our fancy calculator service to convert to the target currency
            price = calculatorService.multiply(price, 0.70);
           
            System.out.println("Converted to " + currency + ": " + price);
        }
       
        // Calculate the value of the stock account
        double stockValue = price * stock.getQuantity();
       
        // Calculate the total balance of all accounts and return it
        double balance = checking.getBalance() + savings.getBalance() + stockValue;
       
        return balance;
View Full Code Here

Examples of bigbank.accountdata.StockAccount

        summaries.add(ca.getSummary());

        SavingsAccount sa = accountDataService.getSavingsAccount(s);
        summaries.add(sa.getSummary());

        StockAccount sk = accountDataService.getStockAccount(s);
       
        double price = stockQuoteService.getQuote(sk.getSymbol());
        sk.setBalance(sk.getQuantity() * price);
       
        summaries.add(sk.getSummary());

        AccountReport report = new AccountReport(currency, summaries);
       
        return report;
    }
View Full Code Here

Examples of org.apache.servicemix.sca.bigbank.accountdata.StockAccount

      summary.setBalance(savings.getBalance());
      return summary;
    }

    private AccountSummary getStockAccountSummary(String customerID) {
      StockAccount stock = accountDataService.getStockAccount(customerID);
      AccountSummary summary = new AccountSummary();
      summary.setAccountNumber(stock.getAccountNumber());
      summary.setAccountType("Stock");
      float quote = getQuote(stock.getSymbol());
      summary.setBalance(quote * stock.getQuantity());
      return summary;
    }
View Full Code Here

Examples of org.apache.servicemix.sca.bigbank.accountdata.StockAccount

      summary.setBalance(savings.getBalance());
      return summary;
    }

    private AccountSummary getStockAccountSummary(String customerID) {
      StockAccount stock = accountDataService.getStockAccount(customerID);
      AccountSummary summary = new AccountSummary();
      summary.setAccountNumber(stock.getAccountNumber());
      summary.setAccountType("Stock");
      float quote = getQuote(stock.getSymbol());
      summary.setBalance(quote * stock.getQuantity());
      return summary;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.