Examples of Stock


Examples of com.extjs.gxt.samples.resources.client.model.Stock

  }

  public static List<Stock> getStocks() {
    List<Stock> stocks = new ArrayList<Stock>();

    stocks.add(new Stock("Apple Inc.", "AAPL", 125.64, 123.43));
    stocks.add(new Stock("Cisco Systems, Inc.", "CSCO", 25.84, 26.3));
    stocks.add(new Stock("Google Inc.", "GOOG", 516.2, 512.6));
    stocks.add(new Stock("Intel Corporation", "INTC", 21.36, 21.53));
    stocks.add(new Stock("Level 3 Communications, Inc.", "LVLT", 5.55, 5.54));
    stocks.add(new Stock("Microsoft Corporation", "MSFT", 29.56, 29.72));
    stocks.add(new Stock("Nokia Corporation (ADR)", "NOK", 27.83, 27.93));
    stocks.add(new Stock("Oracle Corporation", "ORCL", 18.73, 18.98));
    stocks.add(new Stock("Starbucks Corporation", "SBUX", 27.33, 27.36));
    stocks.add(new Stock("Yahoo! Inc.", "YHOO", 26.97, 27.29));
    stocks.add(new Stock("Applied Materials, Inc.", "AMAT", 18.4, 18.66));
    stocks.add(new Stock("Comcast Corporation", "CMCSA", 25.9, 26.4));
    stocks.add(new Stock("Sirius Satellite", "SIRI", 2.77, 2.74));

    stocks.add(new Stock("Tellabs, Inc.", "TLAB", 10.64, 10.75));
    stocks.add(new Stock("eBay Inc.", "EBAY", 30.43, 31.21));
    stocks.add(new Stock("Broadcom Corporation", "BRCM", 30.88, 30.48));
    stocks.add(new Stock("CMGI Inc.", "CMGI", 2.14, 2.13));
    stocks.add(new Stock("Amgen, Inc.", "AMGN", 56.22, 57.02));
    stocks.add(new Stock("Limelight Networks", "LLNW", 23, 22.11));
    stocks.add(new Stock("Amazon.com, Inc.", "AMZN", 72.47, 72.23));

    stocks.add(new Stock("E TRADE Financial Corporation", "ETFC", 24.32, 24.58));
    stocks.add(new Stock("AVANIR Pharmaceuticals", "AVNR", 3.7, 3.52));
    stocks.add(new Stock("Gemstar-TV Guide, Inc.", "GMST", 4.41, 4.55));
    stocks.add(new Stock("Akamai Technologies, Inc.", "AKAM", 43.08, 45.32));
    stocks.add(new Stock("Motorola, Inc.", "MOT", 17.74, 17.69));
    stocks.add(new Stock("Advanced Micro Devices, Inc.", "AMD", 13.77, 13.98));
    stocks.add(new Stock("General Electric Company", "GE", 36.8, 36.91));
    stocks.add(new Stock("Texas Instruments Incorporated", "TXN", 35.02, 35.7));
    stocks.add(new Stock("Qwest Communications", "Q", 9.9, 10.03));
    stocks.add(new Stock("Tyco International Ltd.", "TYC", 33.48, 33.26));
    stocks.add(new Stock("Pfizer Inc.", "PFE", 26.21, 26.19));
    stocks.add(new Stock("Time Warner Inc.", "TWX", 20.3, 20.45));
    stocks.add(new Stock("Sprint Nextel Corporation", "S", 21.85, 21.76));
    stocks.add(new Stock("Bank of America Corporation", "BAC", 49.92, 49.73));
    stocks.add(new Stock("Taiwan Semiconductor", "TSM", 10.4, 10.52));
    stocks.add(new Stock("AT&T Inc.", "T", 39.7, 39.66));
    stocks.add(new Stock("United States Steel Corporation", "X", 115.81, 114.62));
    stocks.add(new Stock("Exxon Mobil Corporation", "XOM", 81.77, 81.86));
    stocks.add(new Stock("Valero Energy Corporation", "VLO", 72.46, 72.6));
    stocks.add(new Stock("Micron Technology, Inc.", "MU", 12.02, 12.27));
    stocks.add(new Stock("Verizon Communications Inc.", "VZ", 42.5, 42.61));
    stocks.add(new Stock("Avaya Inc.", "AV", 16.96, 16.96));
    stocks.add(new Stock("The Home Depot, Inc.", "HD", 37.66, 37.79));

    stocks.add(new Stock("First Data Corporation", "FDC", 32.7, 32.65));
    return stocks;

  }
View Full Code Here

Examples of com.fusesource.examples.activemq.websocket.marketdata.Stock

            while (running) {

                Iterator<Stock> i = stocksList.iterator();
                while (i.hasNext()) {
                    Stock stock = i.next();
                    simulateChange(stock);
                    Message msg = createStockMessage(session, stock);
                    msg.setStringProperty("symbol", stock.getSymbol());
                    quotesProducer.send(msg);
                    try {
                        Thread.sleep(500);
                    } catch (InterruptedException e) {
                    }
View Full Code Here

Examples of com.manning.hip.ch3.avro.gen.Stock

    ByteArrayOutputStream bao = new ByteArrayOutputStream();
    BinaryEncoder encoder =
        EncoderFactory.get().directBinaryEncoder(bao, null);

    for (String line : FileUtils.readLines(inputFile)) {
      Stock stock = AvroStockFileWrite.createStock(line);
      writer.write(stock, encoder);
      encoder.flush();

      byte[] rowkey = Bytes.add(
          Bytes.toBytes(stock.symbol.toString()),
View Full Code Here

Examples of com.manning.hip.ch3.proto.StockProtos.Stock

    ProtobufBlockReader<Stock> reader =
        new ProtobufBlockReader<Stock>(
            inputStream, new TypeRef<Stock>() {});

    Stock stock;
    while((stock = reader.readNext()) != null) {
      System.out.println(ToStringBuilder.reflectionToString(stock));
    }

    IOUtils.closeStream(inputStream);
View Full Code Here

Examples of com.oltpbenchmark.benchmarks.tpcc.pojo.Stock

            + "stock.csv"));
        LOG.debug("\nWriting Stock file to: " + fileLocation
            + "stock.csv");
      }

      Stock stock = new Stock();

      for (int i = 1; i <= itemKount; i++) {

        for (int w = 1; w <= whseKount; w++) {
View Full Code Here

Examples of com.swinarta.sunflower.core.model.Stock

    if(request.getOperationType() == OPERATION_TYPE.FETCH){
     
      Integer storeId = (Integer) request.getData().get("storeId");
     
      Stock s = coreManager.getStock(productId, storeId);
     
      DisplayStock dstock = null;
     
      if(s != null){
        dstock = mapper.map(s, DisplayStock.class);
        dstock.setProductId(s.getProduct().getId());
      }
     
      SgwtRestFetchResponseBase ret = new SgwtRestFetchResponseBase(dstock);
         
      return ret;
   
    }else if(request.getOperationType() == OPERATION_TYPE.ADD){
     
      Float current = RequestUtil.getFloat(request.getData().get("current"));
      Integer max = (Integer) request.getData().get("max");
      Integer min = (Integer) request.getData().get("min");
      Integer order = (Integer) request.getData().get("defaultOrder");
      Integer storeId = (Integer) request.getData().get("storeId");
     
      Product product = coreManager.get(Product.class, productId);
     
      Stock s = new Stock();
      s.setCurrent(current);
      s.setDefaultOrder(order);
      s.setMax(max);
      s.setMin(min);
      s.setLastUpdateReason(StockUpdateReason.WEB);
      s.setProduct(product);
      s.setStoreId(storeId);
     
      Stock retStock;
      DisplayStock dstock = null;
      try {
        retStock = coreManager.save(Stock.class, s);
        dstock = mapper.map(retStock, DisplayStock.class);
        dstock.setProductId(retStock.getProduct().getId());
       
      } catch (Exception e) {
        SgwtRestErrorResponse resp = new SgwtRestErrorResponse(SgwtRestResponseBase.RESPONSE_FAILURE);
        resp.addError("exception", e.getMessage());
        return resp;
      }
     
      SgwtRestFetchResponseBase ret = new SgwtRestFetchResponseBase(dstock);
     
      return ret;
    }else if(request.getOperationType() == OPERATION_TYPE.UPDATE){

      Float current = RequestUtil.getFloat(request.getData().get("current"));
      Integer max = (Integer) request.getData().get("max");
      Integer min = (Integer) request.getData().get("min");
      Integer order = (Integer) request.getData().get("defaultOrder");
      Integer storeId = (Integer) request.getData().get("storeId");

      Stock s = coreManager.getStock(productId, storeId);
      s.setCurrent(current);
      s.setDefaultOrder(order);
      s.setMax(max);
      s.setMin(min);
      s.setLastUpdateReason(StockUpdateReason.WEB);
     
      Stock retStock;
      DisplayStock dstock = null;
      try {
        retStock = coreManager.save(Stock.class, s);
        dstock = mapper.map(retStock, DisplayStock.class);
        dstock.setProductId(retStock.getProduct().getId());       
      } catch (Exception e) {
        SgwtRestErrorResponse resp = new SgwtRestErrorResponse(SgwtRestResponseBase.RESPONSE_FAILURE);
        resp.addError("exception", e.getMessage());
        return resp;
      }
View Full Code Here

Examples of models.data.Stock

        return stockListJson;
    }

    public static ArrayNode getPrices(Game game, String ticker) {
        ArrayNode stockPricesJson = Json.newObject().arrayNode();
        Stock stock = Stock.find
                .where()
                .eq("ticker", ticker)
                .findUnique();
        if (stock != null) {
            DateTime dt = new DateTime(game.getVirtualCurrentDate());
View Full Code Here

Examples of models.data.Stock

      if (stockExistInSystem(ticker)) {
            return false;
        }

        if (stockExist(ticker)) {
            Stock stock = new Stock();
            stock.setAddedOn(new Timestamp(new Date().getTime()));
            stock.setCompanyName(companyName);
            stock.setIsEnabled(isEnabled);
            stock.setLastUpdated(GameUtil.getCurrentTimeStamp());
            stock.setTicker(ticker);

            ICsvBeanReader beanReader = setup(ticker, null, null);
            if (beanReader == null) {
                play.Logger.warn("bean reader null");
            }

            List<StockPrice> stockPrices = parseCSV(beanReader);

            stock.setPrices(stockPrices);
            stock.save();
            return true;
        }
        return false;
    }
View Full Code Here

Examples of models.data.Stock

     */
    public boolean deleteStock(String ticker) throws IOException {

        if (stockExist(ticker)) {

            Stock stock = Stock.find.where().eq("ticker", ticker).findUnique();

            if (stock != null) {
                int stock_id = Stock.find.where().eq("ticker", ticker).findUnique().getId();
                Stock.find.ref(Integer.toString(stock_id)).delete();
                return true;
View Full Code Here

Examples of models.data.Stock

     * stock is disabled after the method call
     */
    public int flipEnableStock(String ticker) throws IOException {
        int final_state = 2;
        if (stockExist(ticker)) {
            Stock stock = Stock.find.where().eq("ticker", ticker).findUnique();
            if (stock != null) {
                int stock_id = Stock.find.where().eq("ticker", ticker).findUnique().getId();
                Integer currentStatus = stock.getIsEnabled();
                if (currentStatus == 1) {
                    stock.setIsEnabled(ApplicationConstants.FALSE);
                    final_state = ApplicationConstants.FALSE;
                } else {
                    stock.setIsEnabled(ApplicationConstants.TRUE);
        final_state = ApplicationConstants.TRUE;
                }
                stock.save();
            }
        }
        return final_state;
    }
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.