de.ix.jspTutorial.model
Class Order

java.lang.Object
  |
  +--de.ix.jspTutorial.model.Order

public class Order
extends java.lang.Object

This class represents a full pizza order including the base pizza, additional ingredients and the delivery address

Version:
$Id:$
Author:
Peter Rossbach (pr@webapp.de), Lars Röwekamp ( lars.roewekamp@openKnowledge.de)

Field Summary
static java.lang.String vcid
          version of the source
 
Constructor Summary
Order()
          Constructor for an empty order.
Order(long id, Customer customer, PersonalPizza pizza, double price)
          Constructor for a real order
 
Method Summary
 Customer getCustomer()
          Getter method for the attribute customer
 DatabaseGenericObject getGenericObject()
          Method to create a generic object
 long getId()
          Getter method for the attribute id
 java.util.List getIngredientGenericObjects()
          Create a list of ingredients out of the current order for database storage.
 PersonalPizza getPersonalPizza()
          Getter method for the attribute pizza
 DatabaseGenericObject getPizzaGenericObject()
          Create the pizza out of the current order for database storage.
 double getPrice()
          Getter method for the attribute price
 void setCustomer(Customer aCustomer)
          Setter method for the attribute customer
 void setId(long aId)
          Setter method for the attribute id
 void setPizza(PersonalPizza aPizza)
          Setter method for the attribute pizza
 void setPrice(double aPrice)
          Setter method for the attribute price
 java.lang.String toString()
          Build a string out of the order attributes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

vcid

public static java.lang.String vcid
version of the source
Constructor Detail

Order

public Order()
Constructor for an empty order. All strings are set to null, all numeric values to -1 or -1.0

Order

public Order(long id,
             Customer customer,
             PersonalPizza pizza,
             double price)
Constructor for a real order
Parameters:
id - unique id
customer - delivery address
pizza - pizza, including additional ingredients
price - total cost
Method Detail

getGenericObject

public DatabaseGenericObject getGenericObject()
Method to create a generic object
Returns:
a DatabaseGenericObject
See Also:
DatabaseGenericModifier.create(I_DatabaseGenericObject,String)

getPizzaGenericObject

public DatabaseGenericObject getPizzaGenericObject()
Create the pizza out of the current order for database storage.
Returns:
a DatabaseGenericObject
See Also:
DatabaseGenericModifier.create(I_DatabaseGenericObject,String)

getIngredientGenericObjects

public java.util.List getIngredientGenericObjects()
Create a list of ingredients out of the current order for database storage.
Returns:
a list of ingredients
See Also:
DatabaseGenericModifier.create(I_DatabaseGenericObject,String)

setPizza

public void setPizza(PersonalPizza aPizza)
Setter method for the attribute pizza
Parameters:
aPizza - new value for the attribute pizza
See Also:
getPersonalPizza()

getPersonalPizza

public PersonalPizza getPersonalPizza()
Getter method for the attribute pizza
Returns:
current value of the attribute pizza
See Also:
setPizza(PersonalPizza)

setCustomer

public void setCustomer(Customer aCustomer)
Setter method for the attribute customer
Parameters:
aCustomer - new value for the attribute customer
See Also:
getCustomer()

getCustomer

public Customer getCustomer()
Getter method for the attribute customer
Returns:
current value of the attribute customer
See Also:
setCustomer(Customer)

setPrice

public void setPrice(double aPrice)
Setter method for the attribute price
Parameters:
aPrice - new value for the attribute price
See Also:
getPrice()

getPrice

public double getPrice()
Getter method for the attribute price
Returns:
current value of the attribute price
See Also:
setPrice(double)

setId

public void setId(long aId)
Setter method for the attribute id
Parameters:
aId - new value for the attribute id
See Also:
getId()

getId

public long getId()
Getter method for the attribute id
Returns:
current value of the attribute id
See Also:
setId(long)

toString

public java.lang.String toString()
Build a string out of the order attributes.
Overrides:
toString in class java.lang.Object
Returns:
String representation of the order


~ Das iX JSP Tutorial II - © 2000 by Peter Roßbach ~