Modifier and Type | Field and Description |
---|---|
private List<Item> |
ItemizedBill.items
The list of items for this bill.
|
Modifier and Type | Method and Description |
---|---|
Item |
ItemizedBill.getMostExpensiveItem()
Returns a copy of the most expensive item in this bill.
|
private static Item |
ItemizedBill.getMostExpensiveItem(List<Item> t)
Recursively searches the list
t for the most expensive
item. |
Modifier and Type | Method and Description |
---|---|
List<Item> |
ItemizedBill.getItems()
Returns the list of items purchased for this bill.
|
Modifier and Type | Method and Description |
---|---|
void |
ItemizedBill.addItem(Item item)
Add an item to the list of items purchased for this bill.
|
int |
Item.compareTo(Item other)
Compares two items numerically by their price.
|
void |
ItemizedBill.removeItem(Item item)
Removes the specified item from the list and updates the total
price of the bill.
|
Modifier and Type | Method and Description |
---|---|
private static Item |
ItemizedBill.getMostExpensiveItem(List<Item> t)
Recursively searches the list
t for the most expensive
item. |
Constructor and Description |
---|
Item(Item other)
Initialize an item by copying another item.
|
Constructor and Description |
---|
ItemizedBill(Date date,
List<Item> items)
Initialize this bill from a list of purchased items.
|