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.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
Fields Modifier and Type Field Description private javafx.beans.property.IntegerProperty
amount
Number of items that are amountedprotected IJavaFXApplicationThreadExecution
fxTheadExecution
-
Constructor Summary
Constructors Constructor Description BaseAmountable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int amount)
Add a number itemsjavafx.beans.property.ReadOnlyIntegerProperty
amountProperty()
boolean
equals(java.lang.Object o)
int
getAmount()
Retrieve the number of itemsint
hashCode()
void
remove(int amount)
Remove a number of itemsvoid
reset()
Set the amount to 0.protected void
setAmount(int amount)
java.lang.String
toString()
-
-
-
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:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-