Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2004 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.beasys.commerce.ebusiness.shoppingcart
Class ShoppingCartLineImpl

    java.lang.Object
      com.beasys.commerce.foundation.BelongingImpl
          com.beasys.commerce.ebusiness.shoppingcart.ShoppingCartLineImpl

All Implemented Interfaces:
  Belonging, BusinessSmartComponent, Cloneable, Comparable, RelationalReference, Serializable, ShoppingCartLine

public class ShoppingCartLineImpl
extends BelongingImpl
implements ShoppingCartLine

This class combines an Item, a Quantity and a Money. The item is a reference to an entity bean.

See Also:
  `ShoppingCartLine`, `ShoppingCartLineHome`, Serialized Form

Field Summary
`ProductItem` | `productItem` Containment: By Value Multiplicity: 1:1
`double` | `quantity` Containment: By Value Multiplicity: 1:1
`Money` | `shipping` Containment: By Value Multiplicity: 1:1
`Money` | `tax` Containment: By Value Multiplicity: 1:1
`Money` | `unitPrice` Containment: By Value Multiplicity: 1:1

Fields inherited from class com.beasys.commerce.foundation.BelongingImpl
`__classIdentifier, __containingBelonging, __containingEntity, __mapKey, __sequenceNumber, _isDirty`

Constructor Summary
`ShoppingCartLineImpl()`

Method Summary
`int` | `compareTo(Object o)` Compare this belonging to another
`Money` | `getBaseSavings()` Get the savings from the MSRP to the base unit price, exluding non-catalog discounts, i.e. quantity * (MSRP - Unit Price)
`Money` | `getBaseTotal()` Get the total excluing non-catalog discounts, i.e.
`Money` | `getDiscountedPrice()` get the Discounted Price for the line
`ArrayList` | `getDiscountPresentations()` get the Discount Description Array list of the discounts that apply to a particular shopping cart line
`Money` | `getLineTotal(int totalType)` Gets the line total for the given total type
`ProductItem` | `getProductItem()` Get the value of productItem
`double` | `getQuantity()` Get the value of quantity
`Money` | `getSavings()` Get the value of the savings made on this line.
`Money` | `getShipping()` Get the value of shipping
`Money` | `getTax()` Get the value of tax
`Money` | `getUnitPrice()` Get the value of unitPrice
`String` | `interfaceName()` interfaceName() returns the unqualified name of the interface from the UML model
`void` | `setByValue(Belonging value)` It is possible to call set-by-value with a superclass.
`void` | `setDiscountedPrice(Money discountedPrice)` Set the discount price for this line
`void` | `setDiscountPresentations(ArrayList discountPresentations)` Set the value of discount Presentations of the discounts that apply to a particular shopping cart line
`void` | `setProductItem(ProductItem productItem)` Set the value of productItem
`void` | `setQuantity(double quantity)` Set the value of quantity
`void` | `setShipping(Money shipping)` Set the value of shipping
`void` | `setTax(Money tax)` Set the value of tax
`void` | `setUnitPrice(Money unitPrice)` Set the value of unitPrice
`Belonging` | `value()` value() is a more typesafe implementation of clone()

Methods inherited from class com.beasys.commerce.foundation.BelongingImpl
`clearRelationalBinding, clearRelationalBinding, clearRelationalBinding, clearRelationalBinding, clone, doRelationalBinding, doRelationalBinding, doRelationalBindingOnElement, doRelationalBindingOnElement, doRelationalBindingOnElement, doRelationalBindingOnSingleton, doRelationalBindingOnSingleton, doRelationalBindingOnSingleton, doRelationalBindingWithMapKey, doRelationalBindingWithMapKey, doRelationalBindingWithMapKey, enumerateRelationalBinding, enumerateRelationalBinding, equals, get__classIdentifier, get__containingBelonging, get__containingEntity, get__containingEntityReference, get__mapKey, get__sequenceNumber, getPersistenceHelperPlugin, hashCode, set__classIdentifier, set__containingBelonging, set__containingEntity, set__containingEntityReference, set__mapKey, toString`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface com.beasys.commerce.foundation.Belonging
`clone, equals`

Field Detail

### productItem

    public ProductItem productItem

  - Containment: By Value
  - Multiplicity: 1:1

### quantity

    public double quantity

  - Containment: By Value
  - Multiplicity: 1:1

### shipping

    public Money shipping

  - Containment: By Value
  - Multiplicity: 1:1

### tax

    public Money tax

  - Containment: By Value
  - Multiplicity: 1:1

### unitPrice

    public Money unitPrice

  - Containment: By Value
  - Multiplicity: 1:1

Constructor Detail

### ShoppingCartLineImpl

    public ShoppingCartLineImpl()

Method Detail

### compareTo

    public int compareTo(Object o)

  Compare this belonging to another

  Specified by:
    `compareTo` in interface `Comparable`
  Specified by:
    `compareTo` in class `BelongingImpl`
  Parameters:
    `o` - target object for comparision
  Returns:
    0 objects are equal

### getBaseSavings

    public Money getBaseSavings()

  Get the savings from the MSRP to the base unit price, exluding non-catalog discounts, i.e. quantity * (MSRP - Unit Price)

  Specified by:
    `getBaseSavings` in interface `ShoppingCartLine`
  Returns:
    base savings

### getBaseTotal

    public Money getBaseTotal()

  Get the total excluing non-catalog discounts, i.e. the quantity * unit price for this line

  Specified by:
    `getBaseTotal` in interface `ShoppingCartLine`
  Returns:
    baseTotal

### getDiscountedPrice

    public Money getDiscountedPrice()

  get the Discounted Price for the line

  Specified by:
    `getDiscountedPrice` in interface `ShoppingCartLine`
  Returns:
    the price as discounted

### getDiscountPresentations

    public ArrayList getDiscountPresentations()

  get the Discount Description Array list of the discounts that apply to a particular shopping cart line

  Specified by:
    `getDiscountPresentations` in interface `ShoppingCartLine`
  Returns:
    an ArrayList of DiscountDescription objects

### getLineTotal

    public Money getLineTotal(int totalType)
                       throws InvalidArgumentException

  Gets the line total for the given total type

  Specified by:
    `getLineTotal` in interface `ShoppingCartLine`
  Throws:
    `InvalidArgumentException`

### getProductItem

    public ProductItem getProductItem()

  Get the value of productItem

  Specified by:
    `getProductItem` in interface `ShoppingCartLine`
  Returns:
    productItem.

### getQuantity

    public double getQuantity()

  Get the value of quantity

  Specified by:
    `getQuantity` in interface `ShoppingCartLine`
  Returns:
    quantity.

### getSavings

    public Money getSavings()

  Get the value of the savings made on this line. Calulates the difference between the Msrp and the unit price and multiplies it by the line quantity

  Specified by:
    `getSavings` in interface `ShoppingCartLine`
  Returns:
    savings.

### getShipping

    public Money getShipping()

  Get the value of shipping

  Specified by:
    `getShipping` in interface `ShoppingCartLine`
  Returns:
    shipping.

### getTax

    public Money getTax()

  Get the value of tax

  Specified by:
    `getTax` in interface `ShoppingCartLine`
  Returns:
    tax.

### getUnitPrice

    public Money getUnitPrice()

  Get the value of unitPrice

  Specified by:
    `getUnitPrice` in interface `ShoppingCartLine`
  Returns:
    unitPrice.

### interfaceName

    public String interfaceName()

  interfaceName() returns the unqualified name of the interface from the UML model

  Specified by:
    `interfaceName` in interface `Belonging`
  Returns:
    the unqualified name of the belonging interface from the UML model

### setByValue

    public void setByValue(Belonging value)

  It is possible to call set-by-value with a superclass. If that is the case, only the fields in the superclass will be set in this instance. The remaining fields get the default values.

  It is also possible to call set-by-value with a subclass. In this case, the specialized fields in the subclass will be ignored. The overridden fields in the subclass will be populated.

  Specified by:
    `setByValue` in interface `Belonging`
  Overrides:
    `setByValue` in class `BelongingImpl`
  Parameters:
    `value` - The `Belonging` to use for initialization.

### setDiscountedPrice

    public void setDiscountedPrice(Money discountedPrice)

  Set the discount price for this line

  Specified by:
    `setDiscountedPrice` in interface `ShoppingCartLine`

### setDiscountPresentations

    public void setDiscountPresentations(ArrayList discountPresentations)

  Set the value of discount Presentations of the discounts that apply to a particular shopping cart line

  Specified by:
    `setDiscountPresentations` in interface `ShoppingCartLine`

### setProductItem

    public void setProductItem(ProductItem productItem)

  Set the value of productItem

  Specified by:
    `setProductItem` in interface `ShoppingCartLine`
  Parameters:
    `productItem` - productItem to be added

### setQuantity

    public void setQuantity(double quantity)

  Set the value of quantity

  Specified by:
    `setQuantity` in interface `ShoppingCartLine`
  Parameters:
    `quantity` - quantity to be added

### setShipping

    public void setShipping(Money shipping)

  Set the value of shipping

  Specified by:
    `setShipping` in interface `ShoppingCartLine`
  Parameters:
    `shipping` - shipping to be added

### setTax

    public void setTax(Money tax)

  Set the value of tax

  Specified by:
    `setTax` in interface `ShoppingCartLine`
  Parameters:
    `tax` - tax to be added

### setUnitPrice

    public void setUnitPrice(Money unitPrice)

  Set the value of unitPrice

  Specified by:
    `setUnitPrice` in interface `ShoppingCartLine`
  Parameters:
    `unitPrice` - unitPrice to be set

### value

    public Belonging value()

  value() is a more typesafe implementation of clone()

  Specified by:
    `value` in interface `Belonging`
  Returns:
    a clone of this instance

Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2004 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 BEA Systems, Inc. All Rights Reserved