public class CurrencyHolder extends java.lang.Object implements ResourceHolder
| Modifier and Type | Field and Description |
|---|---|
protected int |
amount |
static java.lang.String |
RESOURCE_NAME
Unique ENUM name of the currency resource.
|
| Constructor and Description |
|---|
CurrencyHolder(int amount) |
| Modifier and Type | Method and Description |
|---|---|
ResourceHolder |
add(ResourceHolder other)
Adds the amount in this and the given resource holder together, returning a new holder
with the result.
|
boolean |
equals(java.lang.Object obj) |
int |
getAmount()
The given amount of this resource.
|
java.lang.String |
getName()
A unique ENUM name representing this resource.
|
int |
hashCode() |
java.lang.String |
toString() |
public static final java.lang.String RESOURCE_NAME
protected int amount
public int getAmount()
ResourceHolderImplementations that use a different data structure should attempt to convert to the integer value.
getAmount in interface ResourceHolderpublic java.lang.String getName()
ResourceHoldergetName in interface ResourceHolderpublic ResourceHolder add(ResourceHolder other)
ResourceHolderadd in interface ResourceHolderother - - resource holder to add.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object