© 2002 BEA Systems, Inc.


examples.e2e.common
Class InventoryImpl

java.lang.Object
  |
  +--examples.e2e.common.InventoryImpl

public class InventoryImpl
extends java.lang.Object
implements Inventory

This class implements the Inventory interface

See Also:
Serialized Form

Constructor Summary
InventoryImpl(java.lang.String id, long min, long max, long available, java.lang.String stdImageURL, java.lang.String wideImageURL)
          Use this constructor to construct an inventory object with image URLs.
InventoryImpl(java.lang.String id, java.lang.String description, long min, long max, long available)
          Use this constructor to construct an inventory object without image URLs.
 
Method Summary
 long available()
          Returns the current available quantity of inventory for this item.
 java.lang.String description()
          Returns a description for the inventory object.
 java.lang.String id()
          Returns the identifier for the inventory object.
 java.lang.String imageURL(int image)
          Returns the URL to an image for the product.
 boolean isBelowMinimum()
          Returns true if the available stock is less than the minimum requirement for the product.
 long max()
          Returns the maximum quantity of inventory that should be maintained in stock for this item.
 long min()
          Returns the minimum quantity of inventory that should be maintained in stock for this item.
 long qtyBelowMinimum()
          Returns the quantity required to bring the available stock to the minimum specifed for the product.
 java.lang.String toString()
          Returns a String that represents the value of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InventoryImpl

public InventoryImpl(java.lang.String id,
                     long min,
                     long max,
                     long available,
                     java.lang.String stdImageURL,
                     java.lang.String wideImageURL)
Use this constructor to construct an inventory object with image URLs.

InventoryImpl

public InventoryImpl(java.lang.String id,
                     java.lang.String description,
                     long min,
                     long max,
                     long available)
Use this constructor to construct an inventory object without image URLs.
Method Detail

id

public java.lang.String id()
Returns the identifier for the inventory object.
Specified by:
id in interface Inventory


description

public java.lang.String description()
Returns a description for the inventory object.
Specified by:
description in interface Inventory


min

public long min()
Returns the minimum quantity of inventory that should be maintained in stock for this item.
Specified by:
min in interface Inventory


max

public long max()
Returns the maximum quantity of inventory that should be maintained in stock for this item.
Specified by:
max in interface Inventory


available

public long available()
Returns the current available quantity of inventory for this item.
Specified by:
available in interface Inventory


imageURL

public java.lang.String imageURL(int image)
Returns the URL to an image for the product.
Specified by:
imageURL in interface Inventory


isBelowMinimum

public boolean isBelowMinimum()
Returns true if the available stock is less than the minimum requirement for the product.
Specified by:
isBelowMinimum in interface Inventory


qtyBelowMinimum

public long qtyBelowMinimum()
Returns the quantity required to bring the available stock to the minimum specifed for the product. Returns zero if available >= minimum.
Specified by:
qtyBelowMinimum in interface Inventory


toString

public java.lang.String toString()
Returns a String that represents the value of this object.

Returns:
a string representation of the receiver
Overrides:
toString in class java.lang.Object

© 2002 BEA Systems, Inc.

Copyright © 2002 BEA Systems, Inc. All Rights Reserved