eos.good
Class Good

Object
  extended by eos.good.Good
Direct Known Subclasses:
Capital, Enjoyment, Labor, Necessity

public abstract class Good
extends Object

Parent class of all goods.

Author:
zhihongx

Field Summary
protected  double quantity
          quantity of the good
 
Constructor Summary
Good(double quantity)
          Create quantity amount of a new good
 
Method Summary
 double decrease(double amount)
          Decrease the quantity of the good by amount.
 String getName()
          Return the name of the good
 double getQuantity()
          Return quantity of the good
 void increase(double amount)
          Increase the quantity of the good by amount
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

quantity

protected double quantity
quantity of the good

Constructor Detail

Good

public Good(double quantity)
Create quantity amount of a new good

Parameters:
quantity -
Method Detail

getQuantity

public double getQuantity()
Return quantity of the good

Returns:
quantity of the good

increase

public void increase(double amount)
Increase the quantity of the good by amount

Parameters:
amount -

decrease

public double decrease(double amount)
Decrease the quantity of the good by amount. If quantity is less than amount, quantity is reduced to zero.

Parameters:
amount -
Returns:
actual amount by which the quantity is reduced

getName

public final String getName()
Return the name of the good

Returns:
the name of the good