Package com.barchart.util.values.api

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


      final String lookup = xmlStringDecode(tag, LOOKUP, XML_STOP);
      throw new SymbolNotFoundException(lookup);
    }

    // decode DOM
    TextValue guid;
    try {
      guid = ValueBuilder.newText(xmlStringDecode(tag, GUID, XML_STOP));
    } catch (Exception e) {
      // TODO
      //return (InstrumentDDF) Instrument.NULL;
      return null;
    }
   
    final TextValue symbolReal = ValueBuilder.newText(xmlStringDecode(
        tag, SYMBOL_REALTIME, XML_STOP));
    final byte exchCode = xmlByteDecode(tag, EXCHANGE_DDF, XML_PASS);
    final byte baseCode = xmlByteDecode(tag, BASE_CODE_DDF, XML_STOP);
    final String codeCFI = xmlStringDecode(tag, SYMBOL_CODE_CFI, XML_PASS);
    final String zoneCode = xmlStringDecode(tag, TIME_ZONE_DDF, XML_STOP);
View Full Code Here


      final String lookup = xmlStringDecode(ats, LOOKUP, XML_STOP);
      throw new SymbolNotFoundException(lookup);
    }
   
    // decode SAX
    final TextValue guid = ValueBuilder.newText(xmlStringDecode(ats, GUID, XML_STOP));
    final TextValue symbolReal = ValueBuilder.newText(
        xmlStringDecode(ats, SYMBOL_REALTIME, XML_STOP));
    final byte exchCode = xmlByteDecode(ats, EXCHANGE_DDF, XML_PASS);
    final byte baseCode = xmlByteDecode(ats, BASE_CODE_DDF, XML_STOP);
    final String codeCFI = xmlStringDecode(ats, SYMBOL_CODE_CFI, XML_PASS);
    final String zoneCode = xmlStringDecode(ats, TIME_ZONE_DDF, XML_STOP);
View Full Code Here

    return field.value();
  }

  @Override
  public final int compareTo(final MarketInstrument that) {
    TextValue id1 = this.get(ID);
    TextValue id2 = that.get(ID);
    return id1.compareTo(id2);
  }
View Full Code Here

    return id1.compareTo(id2);
  }

  @Override
  public String toString() {
    TextValue id = this.get(ID);
    return String.format("Instrument > %10s", id);// 20
  }
View Full Code Here

    return false;
  }

  @Override
  public final int hashCode() {
    TextValue id = this.get(ID);
    return id.hashCode();
  }
View Full Code Here

   *
   * @param text the text
   * @return the dD f_ symbol
   */
  public static final DDF_Symbol find(final TextValue text) {
    final TextValue guid = DDF_Symbology.lookupFromSymbol(text);
    DDF_Symbol symbol = symbolMap.get(guid);

    log.error("find {}", text);

    if (symbol == null) {
      symbol = decode(guid.toString());
      // TODO handle null symbol
      symbolMap.putIfAbsent(guid, symbol);
    }
    return symbol;
  }
View Full Code Here

      final String lookup = xmlStringDecode(tag, LOOKUP, XML_STOP);
      throw new SymbolNotFoundException(lookup);
    }

    // decode DOM
    TextValue guid;
    try {
      guid = ValueBuilder.newText(xmlStringDecode(tag, GUID, XML_STOP));
    } catch (Exception e) {
      //return Instrument.NULL_INSTRUMENT;
      return null;
    }
   
    final TextValue symbolReal = ValueBuilder.newText(xmlStringDecode(tag, SYMBOL_REALTIME, XML_STOP));
    final byte exchCode = xmlByteDecode(tag, EXCHANGE_DDF, XML_PASS);
    final byte baseCode = xmlByteDecode(tag, BASE_CODE_DDF, XML_STOP);
    final String codeCFI = xmlStringDecode(tag, SYMBOL_CODE_CFI, XML_PASS);
    final String zoneCode = xmlStringDecode(tag, TIME_ZONE_DDF, XML_STOP);
    final String symbolComment = xmlStringDecode(tag, SYMBOL_COMMENT,
View Full Code Here

      final String lookup = xmlStringDecode(ats, LOOKUP, XML_STOP);
      throw new SymbolNotFoundException(lookup);
    }
   
    // decode SAX
    final TextValue guid = ValueBuilder.newText(xmlStringDecode(ats, GUID, XML_STOP));
    final TextValue symbolReal = ValueBuilder.newText(
        xmlStringDecode(ats, SYMBOL_REALTIME, XML_STOP));
    final byte exchCode = xmlByteDecode(ats, EXCHANGE_DDF, XML_PASS);
    final byte baseCode = xmlByteDecode(ats, BASE_CODE_DDF, XML_STOP);
    final String codeCFI = xmlStringDecode(ats, SYMBOL_CODE_CFI, XML_PASS);
    final String zoneCode = xmlStringDecode(ats, TIME_ZONE_DDF, XML_STOP);
View Full Code Here

  public List<Instrument> lookup(final CharSequence symbol) {
    if(symbol == null || symbol.length() == 0) {
      return Collections.emptyList();
    }
   
    /** make an upper case id */
    final TextValue lookup = lookupFromSymbol(ValueBuilder.newText(symbol.toString()));

    final Map<Tag, Object> map = new HashMap<Tag, Object>();
    map.put(InstrumentField.MARKET_GUID, lookup);
    final Instrument instrument = ObjectMapFactory.build(InstrumentDDF.class, map);
View Full Code Here

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

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

    System.out.println("lookip ServicePerDDF = null for " + symbol.toString());
   
    return null;
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.