cafe.main
Class Product

java.lang.Object
  extended by cafe.main.Product
Direct Known Subclasses:
ExportProduct, ImportProduct

public class Product
extends java.lang.Object

Version:
0.1
Author:
Markus Penttil�

Constructor Summary
Product(int id, java.lang.String[] name, java.lang.String[] group, javax.swing.ImageIcon productpic)
          Constructs a new product with given parameters.
 
Method Summary
 java.lang.String getGroup(LanguageEnum language)
          Returns the name of the product's group.
 int getId()
          Returns the product id.
 java.lang.String getName(LanguageEnum language)
          Returns the name of the product.
 javax.swing.ImageIcon getProductPic()
          Returns the image/icon associated with the product.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Product

public Product(int id,
               java.lang.String[] name,
               java.lang.String[] group,
               javax.swing.ImageIcon productpic)
Constructs a new product with given parameters.

Parameters:
id - This product's id number (from database).
name - Product name in different languages.
group - Product's group's name in different languages.
productpic - Image/icon for this product.
Method Detail

getId

public int getId()
Returns the product id.

Returns:
Product's id

getName

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

Parameters:
language - Chooses the language in which the name is returned.
Returns:
Product's name in chosen language.

getGroup

public java.lang.String getGroup(LanguageEnum language)
Returns the name of the product's group.

Parameters:
language - Chooses the language in which the name is returned.
Returns:
Product's group's name in chosen language.

getProductPic

public javax.swing.ImageIcon getProductPic()
Returns the image/icon associated with the product.

Returns:
The icon of the product.