FileDocCategorySizeDatePackage
Stock.javaAPI DocExample2045Fri Mar 01 11:27:38 GMT 2002javajaxb.po

Stock

public class Stock extends Object

The Stock class represents the quantity portion of an {@link Order} object.

Fields Summary
private boolean
onHand
Whether the stock should be kept on hand
private int
quantity
The number to order
Constructors Summary
public Stock()

Default constructor for Quick.

 
public Stock(int quantity)

Set up defaults.

param
quantity the number to stock

        this(quantity, true);
    
public Stock(int quantity, boolean onHand)

Additional constructor to allow setting of whether or not to keep stock on hand.

param
quantity the number to stock
param
onHand whether to keep the stock on hand.

        this.quantity = quantity;
        this.onHand = onHand;
    
Methods Summary
public booleangetOnHand()

This returns the current status of whether the stock should be kept on hand.

return
boolean - whether stock is on hand.

        return onHand;
    
public intgetQuantity()

This returns the number ordered of this stock

return
int - the quantity ordered.

        return quantity;
    
public voidsetOnHand(boolean onHand)

This sets whether or not to keep the ordered stock on hand.

param
onHand whether to keep stock on hand.

        this.onHand = onHand;
    
public voidsetQuantity(int quantity)

This sets the number of this stock to order.

param
quantity the number to order.

        this.quantity = quantity;