Examples of StockPrice


Examples of com.google.gwt.sample.stockwatcher.client.StockPrice

    return last;
  }

  private StockPrice updatePrice(String symbol, Double oldPrice, Double newPrice) {
    double change = oldPrice == null ? 0 : (newPrice - oldPrice);
    return new StockPrice(symbol, newPrice, change);
  }
View Full Code Here

Examples of models.data.StockPrice

            stockNode.put("id", portfoilioStock.getId());
            String ticker = portfoilioStock.getStock().getTicker();
            stockNode.put("ticker", ticker);
            stockNode.put("company", portfoilioStock.getStock().getCompanyName());
            stockNode.put("quantity", portfoilioStock.getQuantity());
            StockPrice currentStockPrice = null;
            try {
                currentStockPrice = gm.getStockPrice(ticker, gameState.getGame().getVirtualCurrentDate());
            } catch (IOException ex) {
                play.Logger.warn("error occured while retrieving price", ex);
            }
            stockNode.put("currentPrice", currentStockPrice != null ? currentStockPrice.getStockPrice() : 0);
            //stockNode.put("purchasePrice", purchasePrice);
            stocks.add(stockNode);
        }
        return stocks;
    }
View Full Code Here

Examples of models.data.StockPrice

  }

  @Test
  public void getStockPriceSuccessTest()
    throws IOException, InvalidStockException{
    StockPrice stockPrice = gameManager.getStockPrice("GOOG",date);
    Assert.assertTrue(stockPrice!=null);
  }
View Full Code Here

Examples of models.data.StockPrice

    }

    private List<StockPrice> parseCSV(ICsvBeanReader beanReader) throws IOException {

        List<StockPrice> stockPrices = new ArrayList<StockPrice>();
        StockPrice temp;
        while ((temp = beanReader.read(StockPrice.class, header, processors)) != null) {
            stockPrices.add(temp);
        }

        return stockPrices;
View Full Code Here

Examples of models.data.StockPrice

        return stockPrices.isEmpty() ? null : stockPrices.get(0);
    }

    public double getStockPriceAmount(String ticker, Timestamp virtualDate) {
        StockPrice stockPrice;
        try {
            stockPrice = getStockPrice(ticker, virtualDate);
            return stockPrice == null ? 0 : stockPrice.getStockPrice();
        } catch (IOException ex) {
            play.Logger.error("Could not retrieve stock price", ex);
        }

        return 0;
View Full Code Here

Examples of org.springframework.data.elasticsearch.entities.StockPrice

public class StockPriceBuilder {

  private StockPrice result;

  public StockPriceBuilder(String id) {
    result = new StockPrice(id);
  }
View Full Code Here

Examples of org.test.stock1.StockPrice

        // Create the JAXBContext
        JAXBBlockContext context = new JAXBBlockContext(StockPrice.class.getPackage().getName());
       
        // Create the JAX-B object
        ObjectFactory of = new ObjectFactory();
        StockPrice obj = of.createStockPrice();
        obj.setPrice("100");
       
        // Create the JAX-B Element
        QName paramQName = new QName("urn://sample", "param", "m");
        JAXBElement e = new JAXBElement(paramQName, StockPrice.class, obj);
       
View Full Code Here

Examples of org.test.stock1.StockPrice

        // Create the JAXBContext
        JAXBBlockContext context = new JAXBBlockContext(StockPrice.class.getPackage().getName());
       
        // Create the JAX-B object
        ObjectFactory of = new ObjectFactory();
        StockPrice obj = of.createStockPrice();
        obj.setPrice("100");
       
        // Create the JAX-B Element
        QName paramQName = new QName("urn://sample", "param", "m");
        JAXBElement e = new JAXBElement(paramQName, StockPrice.class, obj);
       
View Full Code Here

Examples of org.test.stock1.StockPrice

        }
        assertTrue(bo instanceof StockPrice);
       
       
        // Check to make sure the content of that object is correct
        StockPrice obj = (StockPrice) bo;
        assertNotNull(obj);
        assertTrue(obj.getPrice().equals("100"));
    }
View Full Code Here

Examples of org.test.stock1.StockPrice

        // Create the JAXBContext
        JAXBBlockContext context = new JAXBBlockContext(StockPrice.class.getPackage().getName());
       
        // Create the JAX-B object
        ObjectFactory of = new ObjectFactory();
        StockPrice obj = of.createStockPrice();
        obj.setPrice("100");
       
        // Create the JAX-B Element
        QName paramQName = new QName("urn://sample", "param", "m");
        JAXBElement e = new JAXBElement(paramQName, StockPrice.class, obj);
       
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.