eos.good
Class Good

java.lang.Object
  extended by eos.good.Good
Direct Known Subclasses:
Capital, Labor, OrdinaryCG

public abstract class Good
extends java.lang.Object

Parent class of all goods.


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.
 java.lang.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 java.lang.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 java.lang.String getName()
Return the name of the good

Returns:
the name of the good