ch.sahits.game.openpatrician.model
Class BaseAmountable<T extends IAmountable>

java.lang.Object
  extended by ch.sahits.game.openpatrician.model.BaseAmountable<T>
Type Parameters:
T -
Direct Known Subclasses:
AmountablePrice

public class BaseAmountable<T extends IAmountable>
extends Object

This base class for amountable items provides a count of the items.

Author:
Andi Hotz, (c) Sahits GmbH, 2011 Created on Dec 23, 2011

Field Summary
protected  int amount
          Number of items that are amounted
 
Constructor Summary
BaseAmountable()
           
 
Method Summary
 void add(int amount)
          Add a number items
 int getAmount()
          Retrieve the number of items
 void remove(int amount)
          Remove a number of items
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

amount

protected int amount
Number of items that are amounted

Constructor Detail

BaseAmountable

public BaseAmountable()
Method Detail

getAmount

public int getAmount()
Retrieve the number of items

Returns:

add

public void add(int amount)
Add a number items

Parameters:
amount - number of the items to be added
avgPrice - average price of one item that is added

remove

public void remove(int amount)
Remove a number of items

Parameters:
amount - of items to be removed

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011-2012 Sahits GmbH. All Rights Reserved.