Package com.barchart.util.values.api

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


  public final DefCuvol freeze() {

    final SizeValue[] entries = entries();

    for (int k = 0; k < entries.length; k++) {
      SizeValue volume = entries[k];
      if (volume == null) {
        volume = ValueConst.NULL_SIZE;
      }
      entries[k] = volume.freeze();
    }

    final DefCuvol that = new DefCuvol(entries, priceFirst(), priceStep());

    return that;
View Full Code Here


    final int size = map.size();

    final SizeValue[] entries = new SizeValue[size];

    for (int k = 0; k < size; k++) {
      SizeValue volume = map.get(k);
      if (volume == null) {
        volume = ValueConst.NULL_SIZE;
      } else {
        volume = volume.freeze();
      }
      entries[k] = volume;
    }

    return entries;
View Full Code Here

    if (price == null) {
      return MarketConst.NULL_CUVOL_ENTRY;
    }

    final SizeValue size = map.get(price);

    if (size == null) {
      return MarketConst.NULL_CUVOL_ENTRY;
    }
View Full Code Here

    assert price != null;
    assert size != null;
   
    if(onGrid(price)) {
     
      SizeValue volume = map.get(price);

      if (volume == null) {
        volume = size;
      } else {
        volume = volume.add(size);
      }

      map.put(price, volume);

      priceLast = price;
      return;
    }
   
    /* One time build if needed */
    if(offGridMap == null) {
      offGridMap = new TreeMap<PriceValue, SizeValue>();
    }
   
    SizeValue volume = offGridMap.get(price);

    if (volume == null) {
      volume = size;
    } else {
      volume = volume.add(size);
    }

    offGridMap.put(price, volume);
    /*  */
  }
 
View Full Code Here

  }
 
  @Override
  public SizeValue getCuvol(final PriceValue price) {
   
    SizeValue size = ValueConst.NULL_SIZE;
    if(onGrid(price)) {
      size = map.get(price);
    } else if(offGridMap != null) {
      size = offGridMap.get(price);
    }
View Full Code Here

    if (price == null) {
      return MarketConst.NULL_CUVOL_ENTRY;
    }

    final SizeValue size = map.get(price);

    if (size == null) {
      return MarketConst.NULL_CUVOL_ENTRY;
    }
View Full Code Here

    this.map = map;
   
    entries = entries();

    for (int k = 0; k < entries.length; k++) {
      SizeValue volume = entries[k];
      if (volume == null) {
        volume = ValueConst.NULL_SIZE;
      }
      entries[k] = volume.freeze();
    }
   
  }
View Full Code Here

  }
 
  @Override
  public SizeValue getCuvol(final PriceValue price) {
   
    SizeValue size = ValueConst.NULL_SIZE;
    if(onGrid(price)) {
      size = map.get(price);
    } else if(offGridMap != null) {
      size = offGridMap.get(price);
    }
View Full Code Here

  public final void add(final PriceValue price, final SizeValue size) {

    assert price != null;
    assert size != null;

    SizeValue volume = map.get(price);

    if (volume == null) {
      volume = size;
    } else {
      volume = volume.add(size);
    }

    map.put(price, volume);

    priceLast = price;
View Full Code Here

  public final DefCuvol freeze() {

    final SizeValue[] entries = entries();

    for (int k = 0; k < entries.length; k++) {
      SizeValue volume = entries[k];
      if (volume == null) {
        volume = ValueConst.NULL_SIZE;
      }
      entries[k] = volume.freeze();
    }

    final DefCuvol that = new DefCuvol(instrument, entries,
        priceFirst(), priceStep());
View Full Code Here

TOP

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

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.