## de.ix.jspTutorial.model
Class Ingredient

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

public class Ingredient
extends java.lang.Object
implements I_DatabaseObject, XMLConstants, XMLModelInterface

Class to represent an ingredient of a pizza.

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

Field Summary
`private long` `id` unique id of the ingredient
`private java.lang.String` `name` Name of the ingredient
`private double` `price` Price of the ingredient
`static java.lang.String` `vcid` version of the source

Fields inherited from interface de.ix.jspTutorial.database.I_DatabaseObject
`vcid`

Fields inherited from interface de.ix.jspTutorial.constants.XMLConstants
`XML_ADDRESS1_TAG, XML_ADDRESS2_TAG, XML_CUSTOMER_TAG, XML_DESCRIPTION_TAG, XML_EMAIL_TAG, XML_FIRSTNAME_TAG, XML_INGREDIENT_LIST_TAG, XML_INGREDIENT_TAG, XML_LASTNAME_TAG, XML_NAME_TAG, XML_ORDER_TAG, XML_PERSONAL_PIZZA_TAG, XML_PRICE_TAG, XML_ROOT_TAG, XML_SIZE_TAG, XML_TOWN_TAG, XML_ZIP_TAG`

Constructor Summary
`Ingredient()` Constructor for an empty ingredient object
`Ingredient(long id, java.lang.String name, double price)` Constructor sets all necessary values

Method Summary
`org.w3c.dom.Element` `generateXML(org.w3c.dom.Document document)` method to generate XML Element containing all important `Ingredient` information
`DatabaseGenericObject` `getGenericObject()` Method to create a generic object
`long` `getId()` Getter method for the attribute `id`
`java.lang.String` `getName()` Getter method for the attribute `name`
`double` `getPrice()` Getter method for the attribute `price`
`void` `setId(long newId)` Setter method for the attribute `id`
`void` `setName(java.lang.String newName)` Setter method for the attribute `name`
`void` `setPrice(double newPrice)` Setter method for the attribute `price`
`java.lang.String` `toString()` Build a string out of the ingredient attributes.

Methods inherited from class java.lang.Object
`<clinit>, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait`

Field Detail

### vcid

    public static java.lang.String vcid

  version of the source

### id

    private long id

  unique id of the ingredient

### name

    private java.lang.String name

  Name of the ingredient

### price

    private double price

  Price of the ingredient

Constructor Detail

### Ingredient

    public Ingredient()

  Constructor for an empty ingredient object

### Ingredient

    public Ingredient(long id,
                      java.lang.String name,
                      double price)

  Constructor sets all necessary values
  Parameters:
    `id` - unique id of the ingredient
    `name` - name f the ingredient
    `price` - price of the ingredient

Method Detail

### getGenericObject

    public DatabaseGenericObject getGenericObject()

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

### getId

    public long getId()

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

### setId

    public void setId(long newId)

  Setter method for the attribute `id`
  Parameters:
    `newId` - new value for the attribute id
  See Also:
    `getId()`

### getName

    public java.lang.String getName()

  Getter method for the attribute `name`
  Returns:
    current value of the attribute name
  See Also:
    `setName(String)`

### setName

    public void setName(java.lang.String newName)

  Setter method for the attribute `name`
  Parameters:
    `newName` - new value for the attribute name
  See Also:
    `getName()`

### setPrice

    public void setPrice(double newPrice)

  Setter method for the attribute `price`
  Parameters:
    `newPrice` - 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)`

### generateXML

    public org.w3c.dom.Element generateXML(org.w3c.dom.Document document)

  method to generate XML Element containing all important `Ingredient` information
  Specified by:
    generateXML in interface XMLModelInterface
  Parameters:
    `document` - XML Document, to create xml element
  Returns:
    xml element containing XML representation of PersonalPizza

### toString

    public java.lang.String toString()

  Build a string out of the ingredient attributes.
  Overrides:
    toString in class java.lang.Object
  Returns:
    String representation of the ingredient

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