cafe.main
Class ImportProduct

java.lang.Object
  extended by cafe.main.Product
      extended by cafe.main.ImportProduct

public class ImportProduct
extends Product

Version:
0.1
Author:
Markus Penttil�

Constructor Summary
ImportProduct(int id, java.lang.String[] name, java.lang.String[] group, double[] amounts, double[] values, java.lang.String unit, javax.swing.ImageIcon productpic)
          Constructs a new ImportProduct with the given parameters.
 
Method Summary
 double[] getIntakeAmounts()
          Returns the amounts in which users can import this product.
 java.lang.String getUnit()
          Returns the measure unit used in this product.
 double getValue(double amount)
          Returns the value for import of a certain amount.
 
Methods inherited from class cafe.main.Product
getGroup, getId, getName, getProductPic
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImportProduct

public ImportProduct(int id,
                     java.lang.String[] name,
                     java.lang.String[] group,
                     double[] amounts,
                     double[] values,
                     java.lang.String unit,
                     javax.swing.ImageIcon productpic)
Constructs a new ImportProduct with the 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.
amounts - The amounts in which this product can be imported.
values - Corresponding import values.
unit - Measure unit for the amounts.
Method Detail

getIntakeAmounts

public double[] getIntakeAmounts()
Returns the amounts in which users can import this product.

Returns:
The allowed amounts.

getUnit

public java.lang.String getUnit()
Returns the measure unit used in this product.

Returns:
The unit used.

getValue

public double getValue(double amount)
Returns the value for import of a certain amount.

Parameters:
amount - The amount value of which will be returned.
Returns:
Value of the amount. 0.0 if value not found.