Package com.barchart.util.values.api

Examples of com.barchart.util.values.api.TextValue


    if (CodecHelper.isEmpty(symbol)) {
      return DDF_InstrumentProvider.NULL_INSTRUMENT;
    }

    /** make an upper case id */
    final TextValue lookup = lookupFromSymbol(symbol);

    final InstrumentDDF instrument = new InstrumentDDF();

    instrument.set(InstrumentField.ID, lookup);
View Full Code Here


  }

  /** make an upper case id */
  private DDF_Instrument load(final TextValue symbol) {

    final TextValue lookup = lookupFromSymbol(symbol);

    return instrumentMap.get(lookup);

  }
View Full Code Here

  }

  /** this will make 3 entries for futures and 1 entry for equities */
  private void store(final DDF_Instrument instrument) {

    /**
     * making assumption that first lookup of ESM0 will set symbol GUID per
     * DDF convention; that is ESM2020 in year 2011;
     * "if symbol expired, move forward"
     *
     * this logic can overwrite previously defined symbol; say we are in
     * year 2011; say ESM0 was already defined for ESM2020 resolution; now
     * request comes for ESM2010; now ESM0 will resolve to ESM2010, and not
     * ESM2020
     *
     * @author g-litchfield Removed mapping by DDF_SYMBOL_REALTIME because
     *         this is not always unique and was causing caching problems,
     *         specifically in KCK2 vs KCK02
     *
     */

    final TextValue symbolDDF =
        instrument.get(DDF_SYMBOL_REALTIME).toUpperCase();
    final TextValue symbolHIST =
        instrument.get(DDF_SYMBOL_HISTORICAL).toUpperCase();
    final TextValue symbolGUID =
        instrument.get(DDF_SYMBOL_UNIVERSAL).toUpperCase();

    ddfInstrumentMap.put(symbolDDF, instrument);

    // hack for bats

    if (symbolDDF.toString().contains(".BZ")) {
      final TextValue lookup =
          ValueBuilder.newText(symbolDDF.toString()
              .replace(".BZ", ""));

      instrumentMap.put(lookup, instrument);
    }
View Full Code Here

    if (CodecHelper.isEmpty(symbol)) {
      return DDF_InstrumentProvider.NULL_INSTRUMENT;
    }

    final TextValue lookup = symbol.toUpperCase();

    DDF_Instrument instrument = ddfInstrumentMap.get(lookup);

    if (instrument == null) {
     
View Full Code Here

    final List<DDF_Instrument> oldList =
        new ArrayList<DDF_Instrument>(size);

    for (final String symbol : symbolList) {

      final TextValue id = ValueBuilder.newText(symbol);

      final DDF_Instrument instrument = load(id);

      if (instrument == null) {
        fetchList.add(symbol);
View Full Code Here

  }

  /** random uuid based text id */
  public static final TextValue newTextId() {
    final UUID uuid = UUID.randomUUID();
    final TextValue text = newText(uuid.toString());
    return text;
  }
View Full Code Here

TOP

Related Classes of com.barchart.util.values.api.TextValue

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.