public class OrderQualifyingTotal extends java.lang.Object implements java.lang.Cloneable, XMLizable
XML Snippet of OrderQualifyingTotal:
<OrderQualifyingTotal impl="com.ibm.commerce.marketing.promotion.runtime.OrderQualifyingTotal"> <SubTotal>200</SubTotal> <Shipping>100</Shipping> <Tax>50</Tax> <ShippingTax>50</ShippingTax> </OrderQualifyingTotal>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM Copyright
|
static java.math.BigDecimal |
ZERO
BigDecimal value "0"
|
Constructor and Description |
---|
OrderQualifyingTotal()
Constructor.
|
OrderQualifyingTotal(java.math.BigDecimal _subTotal,
java.math.BigDecimal _shipping,
java.math.BigDecimal _tax,
java.math.BigDecimal _shippingTax)
Constructor.
|
OrderQualifyingTotal(OrderRunningTotal total)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
boolean |
equals(java.lang.Object obj) |
void |
fromXML(org.w3c.dom.Node anXMLNode)
Transforms the XML node into its corresponding real Object.
|
java.math.BigDecimal |
getOrderQualifyingTotal(int types)
Gets the order qualifying total of the specified monetary types
|
java.math.BigDecimal |
getShipping()
Returns shipping charge
|
java.math.BigDecimal |
getShippingTax()
Returns tax on shipping charge
|
java.math.BigDecimal |
getSubTotal()
Returns the sum of all Order Item Price * Order Item Quantity
|
java.math.BigDecimal |
getTax()
Returns tax on order
|
int |
hashCode() |
boolean |
isContained(java.math.BigDecimal value,
int mask)
Checks if monetary values as specified by the mask bit pattern of this OrderQualifyingTotal
is greater or equal to those of operand.
|
boolean |
isContained(OrderQualifyingTotal aTotal)
Checks if all monetary values of this OrderQualifyingTotal is greater or
equal to those of operand.
|
void |
subtract(java.math.BigDecimal value,
int mask)
Finds the difference between two OrderQualifyingTotals.
|
OrderQualifyingTotal |
subtract(OrderQualifyingTotal aTotal)
Finds the difference between two OrderQualifyingTotals.
|
java.lang.String |
toString() |
java.lang.String |
toXML()
Converts the object into its corresponding XML format representation.
|
public static final java.lang.String COPYRIGHT
public static final java.math.BigDecimal ZERO
public OrderQualifyingTotal()
public OrderQualifyingTotal(java.math.BigDecimal _subTotal, java.math.BigDecimal _shipping, java.math.BigDecimal _tax, java.math.BigDecimal _shippingTax)
_subTotal
- the sum of all price*quantity for all items_shipping
- the shipping cost_tax
- the tax cost_shippingTax
- the shipping tax costpublic OrderQualifyingTotal(OrderRunningTotal total)
total
- an order running total that this OrderQualifyingTotal object
will be created from.public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
com.ibm.commerce.marketing.promotion.runtime.ProtectedContextAttribute.clone()
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(org.w3c.dom.Node)
public java.math.BigDecimal getShipping()
public java.math.BigDecimal getShippingTax()
public java.math.BigDecimal getSubTotal()
public java.math.BigDecimal getTax()
public java.math.BigDecimal getOrderQualifyingTotal(int types)
types
- the monetary types for which an order qualifying total is needed. A bit patternpublic OrderQualifyingTotal subtract(OrderQualifyingTotal aTotal)
For example OrderQualifyingTotal Q1 and Q2, if Q1.subTotal=10, Q1.shipping = 2, Q1.tax = 2, Q1.shippingTax=1 and Q2.subTotal=20, Q1.shipping = 1, Q1.tax = 2, Q1.shippingTax=0. Q3 is the result of Q1-Q2. Then Q3.subTotal = 0, Q3.shipping=1, Q3.tax=0 and Q3.shippingTax=1.
aTotal
- is the object of OrderQualifyingTotal to be subtractedpublic boolean isContained(OrderQualifyingTotal aTotal)
aTotal
- the operand, a value to be comparedpublic java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public boolean isContained(java.math.BigDecimal value, int mask)
value
- the amount, a value to be comparedmask
- the bit pattern that marks the monetary values of this OrderQualifyingTotal to
be compared against.public void subtract(java.math.BigDecimal value, int mask)
value
- a total value of all the monetary values to be comparedmask
- the types of monetary values to be compared.