Examples of Price


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

  }

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

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

    if (instrument.isNull()) {
      log.error("instrument.isNull()");
      return false;
    }

    final Price priceStep = instrument.tickSize();

    if (priceStep.isZero()) {
      log.error("priceStep.isZero()");
      return false;
    }

    final Fraction fraction = instrument.displayFraction();
View Full Code Here

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

  }

  public static final boolean isStrictMultiple(final Price priceTest,
      final Price priceStep) {
    final long count = priceTest.count(priceStep);
    final Price priceBack = priceStep.mult(count);
    if (priceBack.equals(priceTest)) {
      return true;
    } else {
      return false;
    }
  }
View Full Code Here

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

        type = Book.Type.COMBINED;
        break;
      }
      final SizeValue size = LIMIT;
      // TODO ValueConverter
      final Price tempStep = instrument.tickSize();
      final PriceValue step = ValueBuilder.newPrice(tempStep.mantissa(),
          tempStep.exponent());

      final VarBookDDF varBook = new VarBookDDF(instrument, type, size, step);
      final VarBookTopDDF varBookTop = new VarBookTopDDF(varBook);

      set(BOOK, varBook);
View Full Code Here

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

    if (instrument.isNull()) {
      log.error("instrument.isNull()");
      return false;
    }

    final Price priceStep = instrument.tickSize();

    if(priceStep.isNull()) {
      log.error("priceStep.isNull(");
      return false;
    }
   
    if (priceStep.isZero()) {
      log.error("priceStep.isZero()");
      return false;
    }

    final Fraction fraction = instrument.displayFraction();
View Full Code Here

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

    if (instrument.isNull()) {
      log.error("instrument.isNull()");
      return false;
    }

    final Price priceStep = instrument.tickSize();

    if (priceStep.isNull() || priceStep.isZero()) {
      return false;
    }

    final Fraction fraction = instrument.displayFraction();
View Full Code Here

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

          type = Book.Type.COMBINED;
          break;
      }
      final SizeValue size = LIMIT;
      // TODO ValueConverter
      final Price tempStep = instrument.tickSize();
      final PriceValue step = ValueBuilder.newPrice(tempStep.mantissa(),
          tempStep.exponent());

      final VarBookDDF varBook = new VarBookDDF(instrument, type, size, step);
      final VarBookTopDDF varBookTop = new VarBookTopDDF(varBook);

      set(BOOK, varBook);
View Full Code Here

Examples of com.mcorrigal.matchingEngine.order.orderProperties.Price

  private Price highPrice = Price.create("20");
  private Price lowPrice = Price.create("10");

  @Test
  public void newPriceFromStringRepresentation() {
    Price priceFromString = Price.create("100.89");
    Price priceFromDecimal = new Price(new BigDecimal("100.89"));
    assertThat(priceFromString.equals(priceFromDecimal), is(true));
  }
View Full Code Here

Examples of it.hotel.model.price.Price

    priceListDTO.setTypology(typology);
    double price_double = Double.parseDouble(priceListDTO.getPrice());
    BigDecimal priceValue = BigDecimal.valueOf(price_double);
   
    if (priceListDTO.getId() == 0){
      Price price = new Price ();
      price.setPrice(priceValue);
      price.setCalendarDate(CalendarUtils.GetGregorianCalendar(priceListDTO.getDate()));
      price.setTypology_id(typology.getId());
      price.setStructure(structure);
      price.setHotelId(typology.getStructure().getId());
      typology.addPrice(price);
        typologyManager.add(typology)
    }
    else {
      Typology typologyEdit = priceListDTO.getTypology();
      String dateString = priceListDTO.getDate();
      Price priceActual  = (Price)priceManager.get(priceListDTO.getId());
      priceActual.setCalendarDate(CalendarUtils.GetGregorianCalendar(priceListDTO.getDate()));
      priceActual.setPrice(priceValue);
      priceActual.setTypology_id(priceListDTO.getTypologyId());
      priceManager.add(priceActual);
    }
  }
View Full Code Here

Examples of it.hotel.model.price.Price

  public ModelAndView edit (HttpServletRequest req, HttpServletResponse resp){
    String id = req.getParameter("id");
    if (id != null){
      req.setAttribute("hotels", structureManager.getAll());
      req.setAttribute("typologies", typologyManager.getAll());
      Price price = (Price) priceManager.get(Integer.parseInt(id));
      PriceListDTO priceListDTO = new PriceListDTO ();
      priceListDTO.setId(price.getId());
      priceListDTO.setDate(CalendarUtils.GetDateAsString(price.getCalendarDate()));
      BigDecimal priceBDecimal = price.getPrice();
      double priceDouble = priceBDecimal.doubleValue();
      String priceString = String.valueOf(priceDouble);
      priceListDTO.setPrice(priceString);
      priceListDTO.setTypologyId(price.getTypology_id());
      priceListDTO.setTypology((Typology)typologyManager.get(price.getTypology_id()));
      return new ModelAndView("hotel.priceList.new", "priceListDTO", priceListDTO);
     
    }
    return new ModelAndView("redirect:/priceList/list.htm");
  }
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.