Package com.barchart.feed.api.model.meta.id

Examples of com.barchart.feed.api.model.meta.id.InstrumentID


    if (symbolMap.containsKey(symbol)) {
      return symbolMap.get(symbol).get(0);
    }

    /* New symbol, create stub */
    final InstrumentState instState = new DDF_Instrument(new InstrumentID(inst.symbol()), inst, LoadState.PARTIAL);

    final List<InstrumentState> list = new ArrayList<InstrumentState>();
    list.add(instState);
    symbolMap.put(symbol, list);
    log.debug("Put {} stub into map", symbol);
View Full Code Here


            final Map<InstrumentID, InstrumentState> lookup = remoteIDLookup(query);

            /* Store instruments returned from lookup */
            for(final Entry<InstrumentID, InstrumentState> e : lookup.entrySet()) {
             
              final InstrumentID id = e.getKey();
              final InstrumentState inst = e.getValue();
             
              if(inst == null || inst.isNull()) {
                continue;
              }
View Full Code Here

  }

  public DDF_Instrument(final String symbol_) {

    super(new InstrumentID(symbol_));

    symbol = symbol_;

    loadState = LoadState.EMPTY;
View Full Code Here

      }

      /* Set underlier ID */
      final String under = xmlStringDecode(attr, UNDERLIER_ID, XML_PASS);
      if(under != null && under.length() > 0) {
        underlier = new InstrumentID(under);
      }

    }

    /* price currency */
 
View Full Code Here

    }

    /* market identifier; must be globally unique; */
    try {
      final Long id = Long.parseLong(xmlStringDecode(attr, ID, XML_STOP));
      return new InstrumentID(String.valueOf(id));
    } catch (final Exception e) {
      /* Ensure no id collision by making negative */
      log.warn("Instrumet with non long ID = {}", xmlStringDecode(attr, ID, XML_STOP));
      final Long id = Long.valueOf(Math.abs(xmlStringDecode(attr, ID, XML_STOP).hashCode()) * -1);
      return new InstrumentID(String.valueOf(id));
    }

  }
View Full Code Here

    return Collections.emptyList();
  }
 
  @Override
  public InstrumentID id() {
    return new InstrumentID(marketGUID());
  }
View Full Code Here

  }

  @Override
  public InstrumentID id() {
    return new InstrumentID(String.valueOf(def.getMarketId()));
  }
View Full Code Here

  public List<InstrumentID> components() {

    final List<InstrumentID> components = new ArrayList<InstrumentID>();

    for (final long id : def.getComponentIdList()) {
      components.add(new InstrumentID(String.valueOf(id)));
    }

    return components;

  }
View Full Code Here

  public InstrumentID underlier() {

    if (!def.hasUnderlyingMarketId())
      return InstrumentID.NULL;

    return new InstrumentID(String.valueOf(def.getUnderlyingMarketId()));

  }
View Full Code Here

  public List<SpreadLeg> spreadLegs() {

    final List<SpreadLeg> legs = new ArrayList<SpreadLeg>();

    for (final InstrumentDefinition.SpreadLeg leg : def.getSpreadLegList()) {
      legs.add(new DefaultSpreadLeg(new InstrumentID(String.valueOf(leg.getMarketId())), leg.getRatio()));
    }

    return legs;

  }
View Full Code Here

TOP

Related Classes of com.barchart.feed.api.model.meta.id.InstrumentID

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.