public class LineItemSet extends java.lang.Object implements java.io.Serializable, XMLizable, java.lang.Cloneable
AssociatedOrderItem
. It is a temporary
grouping of order items used by the promotion engine during promotion
evaluation.
XML Snippet for LineItemSet:
<LineItemSet> <AssociatedOrderItem impl="com.ibm.commerce.marketing.promotion.runtime.AssociatedOrderItem" > <OrderItemKey> <OrderItemId>1234</OrderItemId> </OrderItemKey> <StartIndex>2</StartIndex> <Quantity>4</Quantity> </AssociatedOrderItem> <AssociatedOrderItem impl="com.ibm.commerce.marketing.promotion.runtime.AssociatedOrderItem" > <OrderItemKey> <OrderItemId>3456</OrderItemId> </OrderItemKey> <StartIndex>1</StartIndex> <Quantity>9</Quantity> </AssociatedOrderItem> </LineItemSet>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM Copyright
|
Constructor and Description |
---|
LineItemSet()
Constructor
|
LineItemSet(Order order)
Constructor constructs a LineItemSet based on an order
|
Modifier and Type | Method and Description |
---|---|
void |
addLineItem(AssociatedOrderItem anItem)
Adds an AssociatedOrderItem to this LineItemSet; merge it with
associated order items already in the set if possible
|
java.lang.Object |
clone() |
LineItemSet |
difference(LineItemSet that)
Returns the difference between two line item sets by returning a new line
item set representing their difference
|
void |
directlyAppendItem(AssociatedOrderItem anItem)
Append items without testing if this item can be merged with other items
already in the line item set.
|
void |
fromXML(org.w3c.dom.Node node)
Builds an LineItem object from an XML fragment.
|
AssociatedOrderItem[] |
getAssociatedOrderItems()
Returns all the associated order items in an array
|
java.math.BigDecimal |
getCost()
Returns the total cost of all the associated items in this line item set.
|
static java.util.Comparator |
getOrderItemComparator()
Returns the order item comparator used by this LineItemSet
|
boolean |
getOrderSplitEndToStart()
Returns true if split order is end to start, otherwise false
|
java.math.BigDecimal |
getQuantity()
Returns the total quantity of all the associated items in this line item set.
|
boolean |
hasCrossSection(LineItemSet that)
Checks if two line item sets have a cross-section
|
LineItemSet |
merge(LineItemSet that)
Merges two line item sets
|
static void |
setOrderItemComparator(java.util.Comparator comparator)
Sets the order item comparator for this line item set
|
void |
setOrderSplitEndToStart(boolean _orderSplitEndToStart)
Sets the split order for this line item set
|
LineItemSet[] |
split(java.math.BigDecimal[] quantities)
Splits a line item set based on the quantities specified in the parameter.
|
java.lang.String |
toXML()
Generates XML fragments for this LineItem object
|
public static final java.lang.String COPYRIGHT
public LineItemSet()
public LineItemSet(Order order)
order
- the order for constructing a LineItemSetpublic void directlyAppendItem(AssociatedOrderItem anItem)
anItem
- item to be appendedpublic void addLineItem(AssociatedOrderItem anItem)
anItem
- item to be addedpublic LineItemSet merge(LineItemSet that)
that
- the set to be merged with this setpublic boolean hasCrossSection(LineItemSet that)
that
- line item setpublic AssociatedOrderItem[] getAssociatedOrderItems()
public java.math.BigDecimal getQuantity()
public java.math.BigDecimal getCost()
public LineItemSet difference(LineItemSet that)
that
- another line item setpublic LineItemSet[] split(java.math.BigDecimal[] quantities)
quantities
- based on which quantities to split this line item setpublic boolean getOrderSplitEndToStart()
public void setOrderSplitEndToStart(boolean _orderSplitEndToStart)
_orderSplitEndToStart
- the orderSplitEndToStart to be setpublic static java.util.Comparator getOrderItemComparator()
public static void setOrderItemComparator(java.util.Comparator comparator)
comparator
- the OrderItemComparator to be setpublic void fromXML(org.w3c.dom.Node node) throws DeXMLizationException
fromXML
in interface XMLizable
node
- Node the XML fragmentDeXMLizationException
- exception that may be caught in DeXMLizationpublic java.lang.String toXML() throws XMLizationException
toXML
in interface XMLizable
XMLizationException
- exception that may be caught in XMLizationpublic java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
Object.clone()