public class DistributionRange extends java.lang.Object implements XMLizable
DistributionRange class provides default implementation for
Range. The class extends XMLizable interface.
XML Snippet for a DistributionRange:
<Range impl="com.ibm.commerce.marketing.promotion.reward.DistributionRange">
<LowerBound>0</LowerBound>
<UpperBound>2</UpperBound>
<RewardChoice>
<!-- Multiple Rewards can be specified -->
<Reward></Reward>
</RewardChoice>
</Range>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
| Constructor and Description |
|---|
DistributionRange()
Constructor for DistributionRange.
|
| 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()
This method gets the lower bound of the range.
|
Reward[] |
getRewards()
This method gets the rewards in the range.
|
java.math.BigDecimal |
getUpperBound()
This method gets the upper bound of the range.
|
boolean |
isInRange(java.math.BigDecimal x)
This method checks if the given number falls in the range.
|
boolean |
isLowerBoundIncludedInRange()
Returns a boolean value which indicates whether the lower bound is included in the range or not.
|
boolean |
isUpperBoundIncludedInRange()
Returns a boolean value which indicates whether the upper bound is included in the range or not.
|
void |
setLowerBound(java.math.BigDecimal _lowerBound)
This method sets the lower bound of the range.
|
void |
setLowerBoundIncludedInRange(boolean b)
Sets the boolean attribute
lowerBoundIncludedInRange. |
void |
setRewards(Reward[] _rewards)
This method sets the rewards in the range.
|
void |
setUpperBound(java.math.BigDecimal _upperBound)
This methods sets the upper bound of the range.
|
void |
setUpperBoundIncludedInRange(boolean b)
Sets the boolean attribute
upperBoundIncludedInRange. |
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 java.math.BigDecimal getUpperBound()
public void setUpperBound(java.math.BigDecimal _upperBound)
_upperBound - java.math.BigDecimal upper bound of the rangepublic void setLowerBound(java.math.BigDecimal _lowerBound)
_lowerBound - java.math.BigDecimal lower bound the rangepublic Reward[] getRewards()
Rewardpublic void setRewards(Reward[] _rewards)
_rewards - list of Rewardpublic boolean isInRange(java.math.BigDecimal x)
x - java.math.BigDecimaltrue if number falls in the range,
false otherwise;public java.lang.String toXML()
throws XMLizationException
XMLizabletoXML in interface XMLizableXMLizationException - when this process failsXMLizable.toXML()public void fromXML(org.w3c.dom.Node anXMLNode)
throws DeXMLizationException
XMLizablefromXML in interface XMLizableanXMLNode - The node that represents an XMLizable objectDeXMLizationException - when this process failsXMLizable.fromXML(Node)public boolean isLowerBoundIncludedInRange()
true indicates the lower bound is included in the range, which is the default value,
false indicates the lower bound is not included in the range.public boolean isUpperBoundIncludedInRange()
true indicates the upper bound is included in the range, which is the default value,
false indicates the upper bound is not included in the range.public void setLowerBoundIncludedInRange(boolean b)
lowerBoundIncludedInRange. A true value indicates the lower bound is
included in the range, a false indicates the lower bound is not included in the range.b - new boolean value for the lowerBoundIncludedInRange attributepublic void setUpperBoundIncludedInRange(boolean b)
upperBoundIncludedInRange. A true value indicates the upper bound is
included in the range, a false indicates the upper bound is not included in the range.b - new boolean value for the upperBoundIncludedInRange attribute