com.ibm.commerce.marketing.promotion.reward

Class PatternQuantityVolumeDistribution

  • java.lang.Object
    • com.ibm.commerce.marketing.promotion.reward.PatternQuantityVolumeDistribution
  • All Implemented Interfaces:
    com.ibm.commerce.marketing.promotion.reward.GenericDistribution, XMLizable, java.io.Serializable


    public class PatternQuantityVolumeDistribution
    extends java.lang.Object
    implements com.ibm.commerce.marketing.promotion.reward.GenericDistribution
    PatternQuantityVolumeDistribution class provides an implementation of distribution based on ranges according to the number of maching range patterns. If the range pattern is not specified, then the number of the input LineItemSet will be used. This implementation should only be used with volume based promotion types. XML Snippet for PatternQuantityVolumeDistribution:

    <Distribution impl="com.ibm.commerce.marketing.promotion.reward.ItemCostVolumeDistribution"> <!-- The item selection Pattern to calculate the total cost --> <Pattern></Pattern> <!-- Multiple Ranges can be specified --> <Range> <LowerBound>1</LowerBound> <UpperBound>5</UpperBound> <Reward></Reward> <Reward></Reward> </Range> <Range> <LowerBound>6</LowerBound> <UpperBound>10</UpperBound> <Reward></Reward> <Reward></Reward> </Range> <!-- Multiple Pattern Filters can go here --> <PatternFilter></PatternFilter> </Distribution>

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String ATTR_IMPL
      XML attribute name -"impl"
      static java.lang.String TAG_DISTRIBUTION
      XML tag -"Distribution"
      static java.lang.String TAG_PATTERN
      XML tag -"Pattern"
      static java.lang.String TAG_PATTERN_FILTER
      XML tag -"PatternFilter"
      static java.lang.String TAG_RANGE
      XML tag -"Range"
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean distribute(LineItemSet[] inputItems, PromotionContext context)
      This method distributes the LineItemSet s according to the range setting and calculates the rewards for all qualified LineItemSets.
      void fromXML(org.w3c.dom.Node anXMLNode)
      Transforms the XML node into its corresponding real Object.
      java.util.List getPatternFilters()
      This method gets the PatternFilter of the Distribution.
      com.ibm.commerce.marketing.promotion.condition.GenericPattern getRangePattern()
      Gets the pattern to calculate the range qualification.
      java.util.List getRanges()
      This method gets the Ranges of the Distribution.
      void setRangePattern(com.ibm.commerce.marketing.promotion.condition.GenericPattern aPattern)
      Sets the pattern to calculate to range qualification.
      java.lang.String toXML()
      Converts the object into its corresponding XML format representation.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • TAG_DISTRIBUTION

        public static final java.lang.String TAG_DISTRIBUTION
        XML tag -"Distribution"
        See Also:
        Constant Field Values
      • TAG_PATTERN_FILTER

        public static final java.lang.String TAG_PATTERN_FILTER
        XML tag -"PatternFilter"
        See Also:
        Constant Field Values
      • TAG_PATTERN

        public static final java.lang.String TAG_PATTERN
        XML tag -"Pattern"
        See Also:
        Constant Field Values
      • TAG_RANGE

        public static final java.lang.String TAG_RANGE
        XML tag -"Range"
        See Also:
        Constant Field Values
      • ATTR_IMPL

        public static final java.lang.String ATTR_IMPL
        XML attribute name -"impl"
        See Also:
        Constant Field Values
    • Constructor Detail

      • PatternQuantityVolumeDistribution

        public PatternQuantityVolumeDistribution()
        Constructor for Distribution.
    • Method Detail

      • getPatternFilters

        public java.util.List getPatternFilters()
        This method gets the PatternFilter of the Distribution.
        Returns:
        list of PatternFilters of the Distribution
      • getRanges

        public java.util.List getRanges()
        This method gets the Ranges of the Distribution.
        Returns:
        list of DistributionRange
      • distribute

        public boolean distribute(LineItemSet[] inputItems,
                                  PromotionContext context)
        This method distributes the LineItemSet s according to the range setting and calculates the rewards for all qualified LineItemSets.
        Specified by:
        distribute in interface com.ibm.commerce.marketing.promotion.reward.GenericDistribution
        Parameters:
        inputItems - List of LineItemSet
        context - PromotionContext
        Returns:
        boolean true if successfully distributed, false otherwise;
      • getRangePattern

        public com.ibm.commerce.marketing.promotion.condition.GenericPattern getRangePattern()
        Gets the pattern to calculate the range qualification.
        Returns:
        Returns the Pattern object.
      • setRangePattern

        public void setRangePattern(com.ibm.commerce.marketing.promotion.condition.GenericPattern aPattern)
        Sets the pattern to calculate to range qualification.
        Parameters:
        aPattern - The pattern object to set.