public class ItemRunningTotal
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM Copyright
|
Constructor and Description |
---|
ItemRunningTotal()
Default constructor
|
ItemRunningTotal(AssociatedOrderItem _item,
java.math.BigDecimal _subTotal,
java.math.BigDecimal _shippingCharge,
java.math.BigDecimal _shippingTax,
java.math.BigDecimal _tax)
This constructor creates a running total object.
|
ItemRunningTotal(OrderItem oitem)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
AssociatedOrderItem |
getItem()
Returns the AssociatedOrderItem for which this ItemRunningTotal is kept
|
java.math.BigDecimal |
getShippingCharge()
Returns shipping charge running total
|
java.math.BigDecimal |
getShippingTax()
Returns shipping tax running total
|
java.math.BigDecimal |
getSubTotal()
Returns subtotal running total
|
java.math.BigDecimal |
getSumOfEverything()
Returns the sum of all four monetary attributes
|
java.math.BigDecimal |
getTax()
Returns tax running total
|
int |
hashCode() |
ItemRunningTotal[] |
split(java.math.BigDecimal quantity)
Splits this running total based on the quantity specified.
|
ItemRunningTotal[] |
split(java.math.BigDecimal[] quantities)
Splits this running total based on the quantities specified.
|
static java.math.BigDecimal |
splitBasedOnPartialQuantity(java.math.BigDecimal value,
java.math.BigDecimal fquant,
java.math.BigDecimal pquant)
Calculates
value * pquant / fquant |
public static final java.lang.String COPYRIGHT
public ItemRunningTotal(AssociatedOrderItem _item, java.math.BigDecimal _subTotal, java.math.BigDecimal _shippingCharge, java.math.BigDecimal _shippingTax, java.math.BigDecimal _tax)
_item
- the AssociatedOrderItem_subTotal
- the sub total of the AssociatedOrderItem_shippingCharge
- shipping charges on the AssociatedOrderItem_shippingTax
- shipping tax levied on the shipping charges_tax
- tax levied on the sub totalpublic ItemRunningTotal(OrderItem oitem)
oitem
- the order itempublic ItemRunningTotal()
public static final java.math.BigDecimal splitBasedOnPartialQuantity(java.math.BigDecimal value, java.math.BigDecimal fquant, java.math.BigDecimal pquant)
value
* pquant
/ fquant
value
- valuefquant
- full quantitypquant
- partial quantitypquant
/ fquant
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
java.lang.Object.equals(Object)
public int hashCode()
hashCode
in class java.lang.Object
java.lang.Object.hashCode()
public ItemRunningTotal[] split(java.math.BigDecimal quantity)
quantity
- quantity of the first element.public ItemRunningTotal[] split(java.math.BigDecimal[] quantities)
quantities
- quantities of each element after the RunningTotal are split.public AssociatedOrderItem getItem()
public java.math.BigDecimal getShippingCharge()
public java.math.BigDecimal getShippingTax()
public java.math.BigDecimal getSubTotal()
public java.math.BigDecimal getTax()
public java.math.BigDecimal getSumOfEverything()