public class WeightedRange extends java.lang.Object implements XMLizable
When the weight is set to 1, and the lower bound is the same as the upper bound, then this weighted range defines a concept of exactly X where X is the value of the lower bound and the upper bound. If the lower bound is not the same as the upper bound, it defines a quantity requirement of "at least M, but no more than N", where M is the value of the lower bound and N is the value of the upper bound. If N is set to unlimited, then the concept is simplified to "at least M, but as many as possible".
XML Snippet of WeightedRange:
<WeightedRange impl= "com.ibm.commerce.marketing.promotion.condition.WeightedRange"> <!-- Minimum number of items is 1 --> <LowerBound>1</LowerBound> <!-- Maximum number of item is unlimited --> <UpperBound>-1</UpperBound> <!-- Usually possible values are: 0 and 1. 0: indicates lower boundary is used to match patterns, 1 indicates the upper boundary is used to match patterns --> <Weight>0</Weight> </WeightedRange>
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
WeightedRange() |
Modifier and Type | Method and Description |
---|---|
void | fromXML(org.w3c.dom.Node anXMLNode)
Transforms the XML node into its corresponding real Object.
|
java.math.BigDecimal | getLowerBound()
Get lower bound of the weighted range.
|
java.math.BigDecimal | getSize(java.math.BigDecimal qty)
This method takes the total quantity of one line item in this order as the parameter and returns the quantity required for each line item in current pattern.
|
java.math.BigDecimal | getUpperBound()
Get upper bound of the weighted range.
|
java.math.BigDecimal | getWeight()
Returns the weight of the weighted range.
|
void | setLowerBound(java.math.BigDecimal lBound)
Set lower bound of the weighted range.
|
void | setUpperBound(java.math.BigDecimal uBound)
Set upper bound of the weighted range.
|
void | setWeight(java.math.BigDecimal aWeight)
Sets the weight of the weighted range.
|
java.lang.String | toXML()
Converts the object into its corresponding XML format representation.
|
public static final java.lang.String COPYRIGHT
public java.math.BigDecimal getLowerBound()
public void setLowerBound(java.math.BigDecimal lBound)
public java.math.BigDecimal getUpperBound()
public void setUpperBound(java.math.BigDecimal uBound)
public java.lang.String toXML() throws XMLizationException
public void fromXML(org.w3c.dom.Node anXMLNode) throws DeXMLizationException
public java.math.BigDecimal getSize(java.math.BigDecimal qty)
public java.math.BigDecimal getWeight()
public void setWeight(java.math.BigDecimal aWeight)