Class PriceBands

java.lang.Object
com.eqixiac.equinix.design.cost.PriceBands

public final class PriceBands extends Object
The plausible range of a price, derived only from where it came from. A live or caller-supplied figure is exact; anything indicative carries a stated band around its expected value.

A line restated in another currency is widened further by its rate's band (fxLow(BigDecimal, BigDecimal, double), fxHigh(BigDecimal, BigDecimal, double)): 0 for a rate pinned in the spec (unless the spec states one), ±2.0% for a live ECB reference rate, ±5.0% for the bundled table.

  • Field Details

    • REFERENCE_BAND_PERCENT

      public static final int REFERENCE_BAND_PERCENT
      Half-width of the band around a reference (dated, indicative) figure, in percent.
      See Also:
    • ESTIMATE_BAND_PERCENT

      public static final int ESTIMATE_BAND_PERCENT
      Half-width of the band around a derived estimate, in percent.
      See Also:
  • Method Details

    • halfWidth

      public static double halfWidth(PriceSource source)
      Parameters:
      source - where the price came from
      Returns:
      the band half-width as a fraction (0 for an exact source)
    • low

      public static BigDecimal low(BigDecimal expected, PriceSource source)
      Parameters:
      expected - the expected amount
      source - where it came from
      Returns:
      the low end of its range
    • high

      public static BigDecimal high(BigDecimal expected, PriceSource source)
      Parameters:
      expected - the expected amount
      source - where it came from
      Returns:
      the high end of its range
    • fxLow

      public static BigDecimal fxLow(BigDecimal low, BigDecimal rate, double bandPercent)
      The low end of a line restated at an exchange rate, widened by the FX allowance: low x rate x (1 - bandPercent/100), rounded half-up to cents.
      Parameters:
      low - the line's low end in its own currency
      rate - units of the target currency per unit of the line's currency
      bandPercent - the FX allowance either side, in percent
      Returns:
      the converted, widened low end
    • fxHigh

      public static BigDecimal fxHigh(BigDecimal high, BigDecimal rate, double bandPercent)
      The high end of a converted line: high x rate x (1 + bandPercent/100), rounded half-up.
      Parameters:
      high - the line's high end in its own currency
      rate - units of the target currency per unit of the line's currency
      bandPercent - the FX allowance either side, in percent
      Returns:
      the converted, widened high end
    • describe

      public static String describe(PriceSource source)
      Parameters:
      source - where a price came from
      Returns:
      a short statement of the band, for line notes