public class QuantitySelectionFilter extends java.lang.Object implements Filter
QuantitySelectionFilter
class groups the items LineItemSet in
groups of number specified by the value of the GroupOf
element.
It then selects a number of items specified by the
Select
element
value. This selection is done of either the first, last or random items in
the group. This is controlled by the value specified in the
SelectPosition
element. This class implements the Filter
interface. XML Snippet for this type of Filter
.
<Filter impl="com.ibm.commerce.marketing.promotion.condition.QuantitySelectionFilter"> <GroupOf>10</GroupOf> <Select>2</Select> <!-- could be first, last or random --> <SelectPosition>random</SelectPosition> </Filter>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
static java.lang.Integer |
FIRST
Indicates select from Beginning
|
static java.lang.Integer |
LAST
Indicates select at end
|
static java.lang.Integer |
RANDOM
Indicates select in Random way
|
Constructor and Description |
---|
QuantitySelectionFilter()
Constructor for QuantitySelectionFilter.
|
Modifier and Type | Method and Description |
---|---|
LineItemSet |
filter(LineItemSet input,
PromotionContext context)
This method performs the business logic to filter the input LineItemSet
and return a subset of the original LineItemSet.
|
void |
fromXML(org.w3c.dom.Node anXMLNode)
Transforms the XML node into its corresponding real Object.
|
long |
getGroupSize()
This method gets the groupSize.
|
long |
getNoOfItems()
This method gets the Number Of Items.
|
java.lang.Integer |
getSelectPosition()
This method gets the SelectPosition.
|
void |
setGroupSize(int _groupSize)
This method sets the groupSize.
|
void |
setNoOfItems(int _noOfItems)
This method sets the Number Of Items.
|
void |
setSelectPosition(java.lang.Integer _selectPosition)
This method sets the SelectPosition.
|
java.lang.String |
toXML()
Converts the object into its corresponding XML format representation.
|
public static final java.lang.String COPYRIGHT
public static final java.lang.Integer FIRST
public static final java.lang.Integer LAST
public static final java.lang.Integer RANDOM
public QuantitySelectionFilter()
public long getGroupSize()
public long getNoOfItems()
public java.lang.Integer getSelectPosition()
public void setGroupSize(int _groupSize)
_groupSize
- intpublic void setNoOfItems(int _noOfItems)
_noOfItems
- intpublic void setSelectPosition(java.lang.Integer _selectPosition)
_selectPosition
- Integerpublic LineItemSet filter(LineItemSet input, PromotionContext context)
Filter
filter
in interface Filter
input
- LineItemSet
context
- PromotionContext
LineItemSet
Filter.filter(LineItemSet, PromotionContext)
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)