|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.sahits.game.openpatrician.model.BaseAmountable<T>
T - public class BaseAmountable<T extends IAmountable>
This base class for amountable items provides a count of the items.
| 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 |
|---|
protected int amount
| Constructor Detail |
|---|
public BaseAmountable()
| Method Detail |
|---|
public int getAmount()
public void add(int amount)
amount - number of the items to be addedavgPrice - average price of one item that is addedpublic void remove(int amount)
amount - of items to be removedpublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||