gpt4 book ai didi

org.springframework.social.yahoo.module.YahooQuote.getLastChangePercent()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 20:47:31 27 4
gpt4 key购买 nike

本文整理了Java中org.springframework.social.yahoo.module.YahooQuote.getLastChangePercent()方法的一些代码示例,展示了YahooQuote.getLastChangePercent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YahooQuote.getLastChangePercent()方法的具体详情如下:
包路径:org.springframework.social.yahoo.module.YahooQuote
类名称:YahooQuote
方法名:getLastChangePercent

YahooQuote.getLastChangePercent介绍

暂无

代码示例

代码示例来源:origin: alex-bretet/cloudstreetmarket.com

@Override
  protected void writeInternal(QuoteWrapper quotes, HttpOutputMessage httpOutputMessage) throws IOException, HttpMessageNotWritableException {
    CSVWriter writer = new CSVWriter(new OutputStreamWriter(httpOutputMessage.getBody()));
    for (YahooQuote quote : quotes) {
      writer.writeNext(
          new String[]{	quote.getId(),
                  quote.getName(),
                  String.valueOf(quote.getOpen()),
                  String.valueOf(quote.getPreviousClose()),
                  String.valueOf(quote.getLast()),
                  String.valueOf(quote.getLastChange()),
                  String.valueOf(quote.getLastChangePercent()),
                  String.valueOf(quote.getHigh()),
                  String.valueOf(quote.getLow()),
                  String.valueOf(quote.getBid()),
                  String.valueOf(quote.getAsk()),
                  String.valueOf(quote.getVolume()),
                  quote.getExchange(),
                  quote.getCurrency()
          });
    }

    writer.close();
  }
}

代码示例来源:origin: alex-bretet/cloudstreetmarket.com

@Override
  protected void writeInternal(QuoteWrapper quotes, HttpOutputMessage httpOutputMessage) throws IOException, HttpMessageNotWritableException {
    CSVWriter writer = new CSVWriter(new OutputStreamWriter(httpOutputMessage.getBody()));
    for (YahooQuote quote : quotes) {
      writer.writeNext(
          new String[]{	quote.getId(),
                  quote.getName(),
                  String.valueOf(quote.getOpen()),
                  String.valueOf(quote.getPreviousClose()),
                  String.valueOf(quote.getLast()),
                  String.valueOf(quote.getLastChange()),
                  String.valueOf(quote.getLastChangePercent()),
                  String.valueOf(quote.getHigh()),
                  String.valueOf(quote.getLow()),
                  String.valueOf(quote.getBid()),
                  String.valueOf(quote.getAsk()),
                  String.valueOf(quote.getVolume()),
                  quote.getExchange(),
                  quote.getCurrency()
          });
    }

    writer.close();
  }
}

代码示例来源:origin: alex-bretet/cloudstreetmarket.com

@Override
  protected void writeInternal(QuoteWrapper quotes, HttpOutputMessage httpOutputMessage) throws IOException, HttpMessageNotWritableException {
    CSVWriter writer = new CSVWriter(new OutputStreamWriter(httpOutputMessage.getBody()));
    for (YahooQuote quote : quotes) {
      writer.writeNext(
          new String[]{	quote.getId(),
                  quote.getName(),
                  String.valueOf(quote.getOpen()),
                  String.valueOf(quote.getPreviousClose()),
                  String.valueOf(quote.getLast()),
                  String.valueOf(quote.getLastChange()),
                  String.valueOf(quote.getLastChangePercent()),
                  String.valueOf(quote.getHigh()),
                  String.valueOf(quote.getLow()),
                  String.valueOf(quote.getBid()),
                  String.valueOf(quote.getAsk()),
                  String.valueOf(quote.getVolume()),
                  quote.getExchange(),
                  quote.getCurrency()
          });
    }

    writer.close();
  }
}

代码示例来源:origin: alex-bretet/cloudstreetmarket.com

@Override
  public CurrencyExchange convert(YahooQuote yahooQuote) {
    
    CurrencyExchange currencyExchange = currencyExchangeRepository.findOne(yahooQuote.getId());
    if(currencyExchange == null){
      currencyExchange = new CurrencyExchange();
      currencyExchange.setId(yahooQuote.getId());
    }
    
    currencyExchange.setName(yahooQuote.getName());
    currencyExchange.setBid(BigDecimal.valueOf(yahooQuote.getBid()));
    currencyExchange.setAsk(BigDecimal.valueOf(yahooQuote.getAsk()));
    currencyExchange.setDailyLatestChange(BigDecimal.valueOf(yahooQuote.getLastChange()));
    currencyExchange.setDailyLatestChangePercent(BigDecimal.valueOf(yahooQuote.getLastChangePercent()));
    currencyExchange.setDailyLatestValue(BigDecimal.valueOf(yahooQuote.getLast()));
    currencyExchange.setPreviousClose(BigDecimal.valueOf(yahooQuote.getPreviousClose()));
    currencyExchange.setOpen(BigDecimal.valueOf(yahooQuote.getOpen()));
    return currencyExchange;
  }
}

代码示例来源:origin: alex-bretet/cloudstreetmarket.com

@Override
  public Index convert(YahooQuote yahooQuote) {
    
    Index index = indexRepository.findOne(yahooQuote.getId());
    if(index == null){
      index = new Index();
      index.setId(yahooQuote.getId());
    }

    index.setName(yahooQuote.getName());
    index.setOpen(BigDecimal.valueOf(yahooQuote.getOpen()));
    index.setHigh(BigDecimal.valueOf(yahooQuote.getHigh()));
    index.setLow(BigDecimal.valueOf(yahooQuote.getLow()));
    index.setDailyLatestChange(BigDecimal.valueOf(yahooQuote.getLastChange()));
    index.setDailyLatestChangePercent(BigDecimal.valueOf(yahooQuote.getLastChangePercent()));
    index.setDailyLatestValue(BigDecimal.valueOf(yahooQuote.getLast()));
    index.setPreviousClose(BigDecimal.valueOf(yahooQuote.getPreviousClose()));
    index.setComponents(Sets.newHashSet());
    if(!StringUtils.isEmpty(yahooQuote.getExchange())){
      index.setExchange(exchangeService.get(yahooQuote.getExchange()));
    }
    return index;
  }
}

代码示例来源:origin: alex-bretet/cloudstreetmarket.com

@Override
  public StockProduct convert(YahooQuote yahooQuote) {
    StockProduct stockProduct = stockProductRepository.findOne(yahooQuote.getId());
    if(stockProduct == null){
      stockProduct = new StockProduct();
      stockProduct.setId(yahooQuote.getId());
    }
    
    stockProduct.setName(yahooQuote.getName());
    stockProduct.setHigh(BigDecimal.valueOf(yahooQuote.getHigh()));
    stockProduct.setLow(BigDecimal.valueOf(yahooQuote.getLow()));
    stockProduct.setDailyLatestChange(BigDecimal.valueOf(yahooQuote.getLastChange()));
    stockProduct.setDailyLatestChangePercent(BigDecimal.valueOf(yahooQuote.getLastChangePercent()));
    stockProduct.setDailyLatestValue(BigDecimal.valueOf(yahooQuote.getLast()));
    stockProduct.setPreviousClose(BigDecimal.valueOf(yahooQuote.getPreviousClose()));
    stockProduct.setOpen(BigDecimal.valueOf(yahooQuote.getOpen()));
    
    if(!StringUtils.isEmpty(yahooQuote.getExchange())){
      stockProduct.setExchange(exchangeService.get(yahooQuote.getExchange()));
    }
    if(!StringUtils.isEmpty(yahooQuote.getCurrency())){
      stockProduct.setCurrency(yahooQuote.getCurrency());
    }
    
    return stockProduct;
  }
}

代码示例来源:origin: alex-bretet/cloudstreetmarket.com

@Override
  public StockQuote convert(YahooQuote yahooQuote) {
    StockQuote stockQuote = new StockQuote();
    stockQuote.setHigh(yahooQuote.getHigh());
    stockQuote.setLow(yahooQuote.getLow());
    stockQuote.setLastChange(yahooQuote.getLastChange());
    stockQuote.setLastChangePercent(yahooQuote.getLastChangePercent());
    stockQuote.setPreviousClose(yahooQuote.getPreviousClose());
    stockQuote.setOpen(yahooQuote.getOpen());
    stockQuote.setExchange(yahooQuote.getExchange());
    stockQuote.setCurrency(yahooQuote.getCurrency());
    return stockQuote;
  }
}

代码示例来源:origin: alex-bretet/cloudstreetmarket.com

public StockQuote(org.springframework.social.yahoo.module.YahooQuote q){
  setAsk(q.getAsk());
  setBid(q.getBid());
  setDate(new Date());
  setHigh(q.getHigh());
  setLow(q.getLow());
  setLast(q.getLast());
  setOpen(q.getOpen());
  setSymbol(q.getId());
  setLastChange(q.getLastChange());
  setLastChangePercent(q.getLastChangePercent());
  setExchange(q.getExchange());
  setCurrency(q.getCurrency());
  setPreviousClose(q.getPreviousClose());
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com