public class OrderedQuantityFilter extends java.lang.Object implements Filter
OrderedQuantityFilter
sorts the LineItemSet
and returns the specified
quantity of either highest priced or lowest priced LineItem
s.
The quantity of the LineItemSet used for filtration is specified by the NoOfItems node value. The FilterCriteria node
can have one of four values namely 'upto', 'exact', 'minimum' or 'rest'. These four values are explained by the example below. Filter
interface.
XML Snippet for this type of Filter
:
<Filter impl="com.ibm.commerce.marketing.promotion.condition.OrderedQuantityFilter"> <!-- highest or lowest --> <Type>highest</Type> <!-- upto, exact, minimum, rest --> <FilterCriteria>upto</FilterCriteria> <NoOfItems>2</NoOfItems> </Filter>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
static java.lang.String |
CRITERIA_EXACT
XML value exact
|
static java.lang.String |
CRITERIA_MINMUM
XML value minimum
|
static java.lang.String |
CRITERIA_REST
XML value rest
|
static java.lang.String |
CRITERIA_UPTO
XML value upto
|
static java.lang.Integer |
HIGH
Indicates Highest priced LineItems to be selected.
|
static java.lang.Integer |
LOW
Indicates Lowest priced LineItems to be selected.
|
Constructor and Description |
---|
OrderedQuantityFilter()
Constructor for OrderedQuantityFilter.
|
Modifier and Type | Method and Description |
---|---|
LineItemSet |
filter(LineItemSet input,
PromotionContext context)
This method sorts the input LineItemSet and returns the specified
quantity of either highest priced or lowest priced LineItems in a
LineItemSet.
|
void |
fromXML(org.w3c.dom.Node anXMLNode)
Transforms the XML node into its corresponding real Object.
|
java.lang.String |
getFilterCriteria()
This method returns the FilterCriteria.
|
int |
getNoOfItems()
This method returns the number of items to be selected.
|
java.lang.Integer |
getType()
This method gets the type of the selection.
|
void |
setFilterCriteria(java.lang.String _filterCriteria)
This method sets the FilterCriteria.
|
void |
setNoOfItems(int _noOfItems)
This method sets the number of items to be selected.
|
void |
setType(java.lang.Integer newType)
This method sets the type of the selection.
|
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.String CRITERIA_UPTO
public static final java.lang.String CRITERIA_EXACT
public static final java.lang.String CRITERIA_MINMUM
public static final java.lang.String CRITERIA_REST
public static final java.lang.Integer HIGH
public static final java.lang.Integer LOW
public OrderedQuantityFilter()
public java.lang.Integer getType()
public int getNoOfItems()
public void setType(java.lang.Integer newType)
newType
- Set to one of the two constants of HIGH or LOW.public java.lang.String getFilterCriteria()
public void setFilterCriteria(java.lang.String _filterCriteria)
_filterCriteria
- Set to one of the four constants of CRITERIA_UPTO, CRITERIA_EXACT, CRITERIA_MINMUM or CRITERIA_REST.public void setNoOfItems(int _noOfItems)
_noOfItems
- The number of items to be set.public LineItemSet filter(LineItemSet input, PromotionContext context)
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)