ope.shopping
Class Product

java.lang.Object
  extended by ope.shopping.Product

public class Product
extends java.lang.Object

This class represents a product which has a name and a price. The product can be placed into a shopping cart.

Version:
0.1
Author:
Kimmo Kiiski, Teemu Koskinen
See Also:
ShoppingCart

Constructor Summary
Product(java.lang.String name, double price)
          Creates a new product with the given name and price.
 
Method Summary
 java.lang.String getName()
          Returns the name of this product.
 double getPrice()
          Returns the price of this product.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Product

public Product(java.lang.String name,
               double price)
Creates a new product with the given name and price.

Parameters:
name - the name of this product
price - the price of this product
Method Detail

getName

public java.lang.String getName()
Returns the name of this product.

Returns:
the name of this product.

getPrice

public double getPrice()
Returns the price of this product.

Returns:
the price of this product.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object