|
@ -30,10 +30,18 @@ public class Item { |
|
|
this.price = price; |
|
|
this.price = price; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* |
|
|
|
|
|
* @return true if at least one item is in stock. |
|
|
|
|
|
*/ |
|
|
public boolean inStock() { |
|
|
public boolean inStock() { |
|
|
return availability > 0; |
|
|
return availability > 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* |
|
|
|
|
|
* @return current number of this items |
|
|
|
|
|
*/ |
|
|
public float getCurrentStock() { |
|
|
public float getCurrentStock() { |
|
|
return availability; |
|
|
return availability; |
|
|
} |
|
|
} |
|
|