Class BaseAmountable<T extends IAmountable>
- java.lang.Object
-
- ch.sahits.game.openpatrician.model.BaseAmountable<T>
-
- Type Parameters:
T-
- Direct Known Subclasses:
AmountablePrice
public class BaseAmountable<T extends IAmountable> extends java.lang.ObjectThis 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
Fields Modifier and Type Field Description private javafx.beans.property.IntegerPropertyamountNumber of items that are amountedprotected IJavaFXApplicationThreadExecutionfxTheadExecution
-
Constructor Summary
Constructors Constructor Description BaseAmountable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int amount)Add a number itemsjavafx.beans.property.ReadOnlyIntegerPropertyamountProperty()booleanequals(java.lang.Object o)intgetAmount()Retrieve the number of itemsinthashCode()voidremove(int amount)Remove a number of itemsvoidreset()Set the amount to 0.protected voidsetAmount(int amount)java.lang.StringtoString()
-
-
-
Field Detail
-
amount
private final javafx.beans.property.IntegerProperty amount
Number of items that are amounted
-
fxTheadExecution
@Autowired protected IJavaFXApplicationThreadExecution fxTheadExecution
-
-
Method Detail
-
getAmount
public int getAmount()
Retrieve the number of items- Returns:
- amount of items
-
setAmount
protected void setAmount(int amount)
-
amountProperty
public javafx.beans.property.ReadOnlyIntegerProperty amountProperty()
-
add
public void add(int amount)
Add a number items- Parameters:
amount- number of the items to be added
-
remove
public void remove(int amount)
Remove a number of items- Parameters:
amount- of items to be removed
-
reset
public void reset()
Set the amount to 0.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-