public class PatternQuantityVolumeDistribution
extends java.lang.Object
implements com.ibm.commerce.marketing.promotion.reward.GenericDistribution
<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>
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"
|
Constructor and Description |
---|
PatternQuantityVolumeDistribution()
Constructor for Distribution.
|
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
LineItemSet s. |
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.
|
public static final java.lang.String TAG_DISTRIBUTION
public static final java.lang.String TAG_PATTERN_FILTER
public static final java.lang.String TAG_PATTERN
public static final java.lang.String TAG_RANGE
public static final java.lang.String ATTR_IMPL
public PatternQuantityVolumeDistribution()
public java.util.List getPatternFilters()
PatternFilters of the Distribution
public java.util.List getRanges()
DistributionRange
public boolean distribute(LineItemSet[] inputItems, PromotionContext context)
LineItemSet
s according to
the range setting and calculates the rewards for all qualified
LineItemSet
s.distribute
in interface com.ibm.commerce.marketing.promotion.reward.GenericDistribution
inputItems
- List of LineItemSet
context
- PromotionContext
true
if successfully distributed,
false
otherwise;public java.lang.String toXML() throws XMLizationException
XMLizable
toXML
in interface XMLizable
XMLizationException
- when this process failsXMLizable.toXML()
public void fromXML(org.w3c.dom.Node anXMLNode) throws DeXMLizationException
XMLizable
fromXML
in interface XMLizable
anXMLNode
- The node that represents an XMLizable objectDeXMLizationException
- when this process failsXMLizable.fromXML(Node)
public com.ibm.commerce.marketing.promotion.condition.GenericPattern getRangePattern()
public void setRangePattern(com.ibm.commerce.marketing.promotion.condition.GenericPattern aPattern)
aPattern
- The pattern object to set.