Package bigbank.account.services.stockquote

Examples of bigbank.account.services.stockquote.StockQuote


        Map<String, StockQuote> stockInfo = stockQuoteService.getQuotes(ownedStr.toArray(new String[owned.size()]));

        for (StockSummary stock : stocks) {
            String symbol = stock.getSymbol();
            StockQuote stockquote = stockInfo.get(symbol);
            if (stockquote == null) {
                stock.setCurrentPrice(Float.NaN);
                stock.setCompany("*not found*");
                stock.setHighPrice(Float.NaN);
                stock.setLowPrice(Float.NaN);

            } else {
                stock.setCurrentPrice(fromUSDollarToCurrency(convertToFloat(stockquote.getStockQuote())));
                stock.setCompany(stockquote.getCompanyName());
                stock.setHighPrice(fromUSDollarToCurrency(convertToFloat(stockquote.getDayHighPrice())));
                stock.setLowPrice(fromUSDollarToCurrency(convertToFloat(stockquote.getDayLowPrice())));
            }
        }

        return accountReport;
    }
View Full Code Here


    public StockSummary purchaseStock(int id, StockSummary stock) throws RemoteException {
        try {
            String symbol = stock.getSymbol();
            Map<String, StockQuote> stockInfo = stockQuoteService.getQuotes(new String[] { symbol });

            StockQuote stockQuote = stockInfo.get(symbol);
            stock.setPurchasePrice(Float.parseFloat(stockQuote.getStockQuote()));
            String purchaseDate = tsformatXSDDateTime.format(new Date());
            if (purchaseDate.endsWith("UTC")) {
                purchaseDate = purchaseDate.substring(0, purchaseDate.length() - 3) + "Z";
            }
            stock.setPurchaseDate(purchaseDate);
View Full Code Here

        Map<String, StockQuote> stockInfo = stockQuoteService.getQuotes((String[]) ownedStr.toArray(new String[owned.size()]));

        for (StockSummary stock : stocks) {
            String symbol = stock.getSymbol();
            StockQuote stockquote = stockInfo.get(symbol);
            if (stockquote == null) {
                stock.setCurrentPrice(Float.NaN);
                stock.setCompany("*not found*");
                stock.setHighPrice(Float.NaN);
                stock.setLowPrice(Float.NaN);

            } else {
                stock.setCurrentPrice(fromUSDollarToCurrency(convertToFloat(stockquote.getStockQuote())));
                stock.setCompany(stockquote.getCompanyName());
                stock.setHighPrice(fromUSDollarToCurrency(convertToFloat(stockquote.getDayHighPrice())));
                stock.setLowPrice(fromUSDollarToCurrency(convertToFloat(stockquote.getDayLowPrice())));
            }
        }

        return accountReport;
    }
View Full Code Here

    public StockSummary purchaseStock(int id, StockSummary stock) throws RemoteException {
        try {
            String symbol = stock.getSymbol();
            Map<String, StockQuote> stockInfo = stockQuoteService.getQuotes(new String[] { symbol });

            StockQuote stockQuote = stockInfo.get(symbol);
            stock.setPurchasePrice(Float.parseFloat(stockQuote.getStockQuote()));
            String purchaseDate = tsformatXSDDateTime.format(new Date());
            if (purchaseDate.endsWith("UTC"))
                purchaseDate = purchaseDate.substring(0, purchaseDate.length() - 3) + "Z";
            stock.setPurchaseDate(purchaseDate);
View Full Code Here

TOP

Related Classes of bigbank.account.services.stockquote.StockQuote

Copyright © 2018 www.massapicom. 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.