com.ibm.commerce.tools.catalog.util
Class RangePricing

java.lang.Object
  |
  +--com.ibm.commerce.tools.catalog.util.RangePricing
All Implemented Interfaces:
java.lang.Comparable

public class RangePricing
extends java.lang.Object
implements java.lang.Comparable

A class used to represent a multi-currency ranged product/sku pricing.

Behaviour

This class is used to gather data related to pricing a product across possible multiple currencies for specific range of purchased units. It is currently used to help abstract the data within the Commerce Accelerator pricing tool in such a way as to allow the developer to more easily implement product/sku pricing.


Field Summary
static java.lang.String COPYRIGHT
           
 
Constructor Summary
RangePricing(java.lang.Double startUnits, java.util.Map currencyPrices)
          Creates an instance of PricingDataBean.
 
Method Summary
 int compareTo(java.lang.Object rangePricingToCompare)
          Casts the object passed to a RangePricing object and returns -1 if this object has a lower starting unit value than cast object, 0 if they are the same, and 1 if this object has a higher starting unit value than the one to which it is being compared.
 int compareTo(RangePricing rangePricingToCompare)
          Returns -1 if the object has a lower starting unit value than rangePricingToCompare, 0 if they are the same, and 1 if the object has a higher starting unit value than the one to which it is being compared.
 java.math.BigDecimal getCurrencyPrice(java.lang.String currency)
          Returns the price per unit for this unit range in the currency passed.
 java.lang.Double getStartingNumberOfUnits()
          Returns starting number of units for this unit range.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
Constructor Detail

RangePricing

public RangePricing(java.lang.Double startUnits,
                    java.util.Map currencyPrices)
Creates an instance of PricingDataBean.
Parameters:
startUnits - The minimum number of units which must be purchased to qualify for this price.
currencyPrices - The prices in each currency for which a price is defined.
Method Detail

compareTo

public int compareTo(java.lang.Object rangePricingToCompare)
Casts the object passed to a RangePricing object and returns -1 if this object has a lower starting unit value than cast object, 0 if they are the same, and 1 if this object has a higher starting unit value than the one to which it is being compared.
Specified by:
compareTo in interface java.lang.Comparable
Returns:
-1, 0, 1.

compareTo

public int compareTo(RangePricing rangePricingToCompare)
Returns -1 if the object has a lower starting unit value than rangePricingToCompare, 0 if they are the same, and 1 if the object has a higher starting unit value than the one to which it is being compared.
Returns:
-1, 0, 1.

getCurrencyPrice

public java.math.BigDecimal getCurrencyPrice(java.lang.String currency)
Returns the price per unit for this unit range in the currency passed.
Parameters:
currency - The currency for which to find the price per unit.
Returns:
The price per unit for this unit range in the currency passed.

getStartingNumberOfUnits

public java.lang.Double getStartingNumberOfUnits()
Returns starting number of units for this unit range.
Returns:
The starting number of units for this unit range.