Package com.barchart.util.value.api

Examples of com.barchart.util.value.api.Time


  }

  @Override
  public final boolean equals(final Object thatTime) {
    if (thatTime instanceof Time) {
      final Time that = (Time) thatTime;
      return this.compareTo(that) == 0;
    }
    return false;
  }
View Full Code Here


    /* display fraction base : decimal(10) vs binary(2), etc. */
    builder.setDisplayBase((int)frac.fraction.base());
    builder.setDisplayExponent(frac.fraction.exponent());
   
    /* Calendar */
    final Time expire = xmlTimeDecode(tag, SYMBOL_EXPIRE, XML_PASS);
    final Calendar.Builder calBuilder = Calendar.newBuilder();
    final Interval.Builder intBuilder = Interval.newBuilder();
   
    intBuilder.setTimeStart(0);
    if(expire == null) {
      intBuilder.setTimeFinish(0);
    } else {
      intBuilder.setTimeFinish(expire.millisecond());
    }
   
    calBuilder.setLifeTime(intBuilder.build());
    builder.setCalendar(calBuilder.build());

View Full Code Here

      /* display fraction base : decimal(10) vs binary(2), etc. */
      builder.setDisplayBase((int)frac.fraction.base());
      builder.setDisplayExponent(frac.fraction.exponent());
     
      /* Calendar */
      final Time expire = xmlTimeDecode(ats, SYMBOL_EXPIRE, XML_PASS);
      final Calendar.Builder calBuilder = Calendar.newBuilder();
      final Interval.Builder intBuilder = Interval.newBuilder();
     
      intBuilder.setTimeStart(0);
      if(expire == null) {
        intBuilder.setTimeFinish(0);
      } else {
        intBuilder.setTimeFinish(expire.millisecond());
      }
     
      calBuilder.setLifeTime(intBuilder.build());
      builder.setCalendar(calBuilder.build());
 
View Full Code Here

    /* display fraction base : decimal(10) vs binary(2), etc. */
    builder.setDisplayBase((int)frac.fraction.base());
    builder.setDisplayExponent(frac.fraction.exponent());
   
    /* Calendar */
    final Time expire = xmlTimeDecode(tag, SYMBOL_EXPIRE, XML_PASS);
    final Calendar.Builder calBuilder = Calendar.newBuilder();
    final Interval.Builder intBuilder = Interval.newBuilder();
   
    intBuilder.setTimeStart(0);
    if(expire == null) {
      intBuilder.setTimeFinish(0);
    } else {
      intBuilder.setTimeFinish(expire.millisecond());
    }
   
    calBuilder.setLifeTime(intBuilder.build());
    builder.setCalendar(calBuilder.build());

View Full Code Here

      /* display fraction base : decimal(10) vs binary(2), etc. */
      builder.setDisplayBase((int)frac.fraction.base());
      builder.setDisplayExponent(frac.fraction.exponent());
     
      /* Calendar */
      final Time expire = xmlTimeDecode(ats, SYMBOL_EXPIRE, XML_PASS);
      final Calendar.Builder calBuilder = Calendar.newBuilder();
      final Interval.Builder intBuilder = Interval.newBuilder();
     
      intBuilder.setTimeStart(0);
      if(expire == null) {
        intBuilder.setTimeFinish(0);
      } else {
        intBuilder.setTimeFinish(expire.millisecond());
      }
     
      calBuilder.setLifeTime(intBuilder.build());
      builder.setCalendar(calBuilder.build());
 
View Full Code Here

    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,
        XML_PASS);
   
    final Time expire = xmlTimeDecode(tag, SYMBOL_EXPIRE, XML_PASS);

    // month code for exp of futures contract
    final DDF_TimeZone zone = DDF_TimeZone.fromCode(zoneCode);
    final DDF_Exchange exchange = DDF_Exchange.fromCode(exchCode);
    final DDF_Fraction frac = DDF_Fraction.fromBaseCode(baseCode);
    final long priceStepMantissa = xmlDecimalDecode(frac, tag,
        PRICE_TICK_INCREMENT, XML_STOP);
    final String pricePointString = xmlStringDecode(tag, PRICE_POINT_VALUE,
        XML_PASS);

    PriceValue pricePoint = ValueBuilder.newPrice(0);
    if (pricePointString != null) {
      try {
        pricePoint = ValueBuilder.newPrice(Double
            .valueOf(pricePointString));
      } catch (Exception e) {
      }

    }

    final PriceValue priceStep = newPrice(priceStepMantissa,
        frac.decimalExponent);
   
    /* Build Lifetime, currently only have last month/year of instrument from ddf.extras */
    TimeInterval lifetime;
    if(expire == null || expire == Time.NULL) { // Was isNull()
      lifetime = TimeInterval.NULL;
    } else {
      lifetime = factory.newTimeInterval(0, expire.millisecond());
    }
   
    Fraction f = factory.newFraction(1, (int) frac.decimalDenominator);
   
    return build(guid, symbolReal, symbolComment, codeCFI,
View Full Code Here

    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);
    final String symbolComment = xmlStringDecode(ats, SYMBOL_COMMENT,
        XML_PASS);
    final Time expire = xmlTimeDecode(ats, SYMBOL_EXPIRE, XML_PASS);

    //

    final DDF_TimeZone zone = DDF_TimeZone.fromCode(zoneCode);
    final DDF_Exchange exchange = DDF_Exchange.fromCode(exchCode);
    final DDF_Fraction frac = DDF_Fraction.fromBaseCode(baseCode);
    final long priceStepMantissa = xmlDecimalDecode(frac, ats,
        PRICE_TICK_INCREMENT, XML_STOP);
    final String pricePointString = xmlStringDecode(ats, PRICE_POINT_VALUE,
        XML_PASS);

    PriceValue pricePoint = ValueBuilder.newPrice(0);
    if (pricePointString != null) {
      try {
        pricePoint = ValueBuilder.newPrice(Double
            .valueOf(pricePointString));
      } catch (Exception e) {
      }
    }

    final PriceValue priceStep = newPrice(priceStepMantissa,
        frac.decimalExponent);
   
    /* Build Lifetime, currently only have last month/year of instrument from ddf.extras */
    TimeInterval lifetime;
    if(expire == null || expire == com.barchart.util.value.impl.ValueConst.NULL_TIME) { // Was isNull()
      lifetime = com.barchart.util.value.impl.ValueConst.NULL_TIME_INTERVAL;
    } else {
      lifetime = factory.newTimeInterval(0, expire.millisecond());
    }
   
    Fraction f = factory.newFraction(1, (int) frac.decimalDenominator);
   
    return build(guid, symbolReal, symbolComment, codeCFI,
View Full Code Here

    /* display fraction base : decimal(10) vs binary(2), etc. */
    builder.setDisplayBase((int)frac.fraction.base());
    builder.setDisplayExponent(frac.fraction.exponent());
   
    /* Calendar */
    final Time expire = xmlTimeDecode(ats, SYMBOL_EXPIRE, XML_PASS);
    final Calendar.Builder calBuilder = Calendar.newBuilder();
    final Interval.Builder intBuilder = Interval.newBuilder();
   
    intBuilder.setTimeStart(0);
    if(expire == null) {
      intBuilder.setTimeFinish(0);
    } else {
      intBuilder.setTimeFinish(expire.millisecond());
    }
   
    calBuilder.setLifeTime(intBuilder.build());
    builder.setCalendar(calBuilder.build());

View Full Code Here

  }

  @Override
  public final boolean equals(final Object thatTime) {
    if (thatTime instanceof Time) {
      final Time that = (Time) thatTime;
      return this.compareTo(that) == 0;
    }
    return false;
  }
View Full Code Here

      /* display fraction base : decimal(10) vs binary(2), etc. */
      builder.setDisplayBase((int) frac.fraction.base());
      builder.setDisplayExponent(frac.fraction.exponent());

      /* Calendar */
      final Time expire = xmlTimeDecode(ats, SYMBOL_EXPIRE, XML_PASS);
      final Calendar.Builder calBuilder = Calendar.newBuilder();
      final Interval.Builder intBuilder = Interval.newBuilder();

      intBuilder.setTimeStart(0);
      if (expire == null) {
        intBuilder.setTimeFinish(0);
      } else {
        intBuilder.setTimeFinish(expire.millisecond());
      }

      calBuilder.setLifeTime(intBuilder.build());
      builder.setCalendar(calBuilder.build());

View Full Code Here

TOP

Related Classes of com.barchart.util.value.api.Time

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.