- @Override
- public Float calculateTotalPrice () {
- // product should be set
- if (this.getProduct() == null) {
- // Abort here
- throw new NullPointerException("product is null"); //NOI18N
- }
-
- // Calculate and return it
- // TODO: If later other purchaseable items (other than products) are handled through this class, this needs expansion
- return (this.getAmount() * this.getProduct().getPrice());
- }
-