public class AssociatedOrderItem extends java.lang.Object implements XMLizable, java.lang.Comparable, java.lang.Cloneable
XML Snippet for AssociatedOrderItem:
<AssociatedOrderItem impl="com.ibm.commerce.marketing.promotion.runtime.AssociatedOrderItem" > <OrderItemKey> <OrderItemId>1234</OrderItemId> </OrderItemKey> <StartIndex>2</StartIndex> <Quantity>4</Quantity> </AssociatedOrderItem>
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
IBM Copyright
|
static int | SECTION_FROM_OTHER_ITEM
A section in the three sections as returned by the markCommonSection(AssociatedOrderItem, AssociatedOrderItem[]) method: is from the operand AssociatedOrderItem
|
static int | SECTION_FROM_THIS_ITEM
A section in the three sections as returned by the markCommonSection(AssociatedOrderItem, AssociatedOrderItem[]) method: is from this AssociatedOrderItem.
|
static int | SECTION_IS_COMMON
A section in the three sections as returned by the markCommonSection(AssociatedOrderItem, AssociatedOrderItem[]) method: is common to both this AssociatedOrderItem and the operand AssociatedOrderItem
|
Modifier | Constructor and Description |
---|---|
AssociatedOrderItem()
Default constructor for creating an AssociatedOrderItem.
|
|
protected | AssociatedOrderItem(OrderItem item)
Constructor that creates a LineItem from an OrderItem.
|
protected | AssociatedOrderItem(OrderItem _item, java.math.BigDecimal _startsAt, java.math.BigDecimal _aQuantity)
Constructor based on the key of an OrderItem, the starting position in the quantity of the order item and quantity referred to by this LineItem.
|
protected | AssociatedOrderItem(OrderItemKey ikey, java.math.BigDecimal _startsAt, java.math.BigDecimal aQuantity)
Constructor based on the key of an OrderItem, the starting position in the quantity of the order item and quantity referred to by this LineItem
|
Modifier and Type | Method and Description |
---|---|
boolean | canMerge(AssociatedOrderItem item)
Checks if this AssociatedOrderItem can be merged with the operand AssociatedOrderItem.
|
java.lang.Object | clone()
Returns null if the CloneNotSupportedException is thrown.
|
int | compareTo(java.lang.Object obj)
Compares two AssociatedOrderItem objects.
|
AssociatedOrderItem[] | difference(AssociatedOrderItem item)
Calculates the difference between this associated order item and the parameter item.
|
boolean | equals(java.lang.Object obj)
Checks to see if two AssociatedOrderItem objects are equal or not.
|
void | fromXML(org.w3c.dom.Node node)
Builds an AssociatedOrderItem objects based on an XML fragment
|
OrderItem | getOrderItem()
Returns the order item
|
OrderItemKey | getOrderItemKey()
Returns the key of the order item with which this AssociatedOrderItem is associated with
|
java.math.BigDecimal | getQuantity()
Returns the quantity.
|
java.math.BigDecimal | getStartsAt()
Returns the StartIndex node value of the order item.
|
boolean | hasCrossSection(AssociatedOrderItem item)
Checks to see if the current AssociatedOrderItem has cross-section with another AssociatedOrderItem or not.
|
int | hashCode()
Generates a hash code for the AssociatedOrderItem.
|
int[] | markCommonSection(AssociatedOrderItem item, AssociatedOrderItem[] sections)
Seeks out the common sections between this AssociatedOrderItem and the operand AssociatedOrderItem.
|
AssociatedOrderItem | merge(AssociatedOrderItem item)
Merges two AssociatedOrderItems into one AssociatedOrderItem.
|
boolean | refersToSameOrderItem(AssociatedOrderItem item)
Tests if two AssociatedOrderItems are referring to the same order item.
|
AssociatedOrderItem[] | split(java.math.BigDecimal _quantity)
Splits the current AssociatedOrderItem into one or two AssociatedOrderItems based on quantity.
|
AssociatedOrderItem[] | split(java.math.BigDecimal[] quantities)
Splits the current AssociatedOrderItem into a number of smaller AssociatedOrderItems.
|
AssociatedOrderItem[] | splitEndToStart(java.math.BigDecimal _quantity)
Splits the current AssociatedOrderItem into one or two AssociatedOrderItems based on quantity, starting from the end of the current AssociatedOrderItems instead of the start.
|
AssociatedOrderItem[] | splitEndToStart(java.math.BigDecimal[] quantities)
Splits the current AssociatedOrderItem into a number of smaller AssociatedOrderItems, starting from the end of the current AssociatedOrderItem intead of the start.
|
java.lang.String | toString()
Returns a string representation of the AssociatedOrderItem.
|
java.lang.String | toXML()
Generates the XML representation of this AssociatedOrderItem
|
public static final java.lang.String COPYRIGHT
public static final int SECTION_FROM_THIS_ITEM
public static final int SECTION_IS_COMMON
public static final int SECTION_FROM_OTHER_ITEM
protected AssociatedOrderItem(OrderItem _item, java.math.BigDecimal _startsAt, java.math.BigDecimal _aQuantity)
protected AssociatedOrderItem(OrderItemKey ikey, java.math.BigDecimal _startsAt, java.math.BigDecimal aQuantity)
protected AssociatedOrderItem(OrderItem item)
public AssociatedOrderItem()
public boolean canMerge(AssociatedOrderItem item)
public AssociatedOrderItem merge(AssociatedOrderItem item)
public boolean hasCrossSection(AssociatedOrderItem item)
public int[] markCommonSection(AssociatedOrderItem item, AssociatedOrderItem[] sections)
public AssociatedOrderItem[] split(java.math.BigDecimal _quantity)
public AssociatedOrderItem[] split(java.math.BigDecimal[] quantities)
public AssociatedOrderItem[] splitEndToStart(java.math.BigDecimal _quantity)
public AssociatedOrderItem[] splitEndToStart(java.math.BigDecimal[] quantities)
public AssociatedOrderItem[] difference(AssociatedOrderItem item)
public void fromXML(org.w3c.dom.Node node) throws DeXMLizationException
public java.lang.String toXML() throws XMLizationException
public boolean equals(java.lang.Object obj)
public int hashCode()
public OrderItem getOrderItem()
public java.math.BigDecimal getQuantity()
public java.math.BigDecimal getStartsAt()
public int compareTo(java.lang.Object obj)
public OrderItemKey getOrderItemKey()
public boolean refersToSameOrderItem(AssociatedOrderItem item)
public java.lang.Object clone()
public java.lang.String toString()