Examples of DDF_InstrumentDo


Examples of com.barchart.feed.ddf.instrument.provider.DDF_InstrumentDo

  /** convert lucene document into instrument */
  @SuppressWarnings("unchecked")
  static <V extends Value<V>> DDF_Instrument instrumentDecode(
      final Document doc) {

    final DDF_InstrumentDo instrument = DDF_InstrumentProvider
        .newInstrumentDDF();

    for (final InstrumentField<?> field : CodecHelper.BASE) {

      final String name = field.name();
      final String value = doc.get(name);

      if (!isValid(value)) {
        continue;
      }

      instrument
          .set((InstrumentField<V>) field, (V) decode(field, value));

    }

    for (final DDF_InstrumentField<?> field : CodecHelper.EXTRA) {

      final String name = field.name();
      final String value = doc.get(name);

      if (!isValid(value)) {
        continue;
      }

      instrument.set((DDF_InstrumentField<V>) field,
          (V) decode(field, value));

    }

    return instrument;
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.