forked from nus-cs2113-AY2324S2/tp
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from YHWong20/feature-ItemList
Item and ItemList Feature
- Loading branch information
Showing
5 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/seedu/duke/Duke.java → src/main/java/seedu/binbash/Duke.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package seedu.duke; | ||
package seedu.binbash; | ||
|
||
import java.util.Scanner; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package seedu.binbash; | ||
|
||
public class Item { | ||
private final String itemName; | ||
private final String itemDescription; | ||
|
||
public Item(String itemName, String itemDescription) { | ||
this.itemName = itemName; | ||
this.itemDescription = itemDescription; | ||
} | ||
|
||
public String getItemName() { | ||
return itemName; | ||
} | ||
|
||
public String getItemDescription() { | ||
return itemDescription; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return itemName + ": " + itemDescription; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package seedu.binbash; | ||
|
||
import java.util.List; | ||
import java.util.ArrayList; | ||
|
||
public class ItemList { | ||
private final List<Item> itemList; | ||
|
||
public ItemList() { | ||
itemList = new ArrayList<>(); | ||
} | ||
|
||
public List<Item> getItemList() { | ||
return itemList; | ||
} | ||
|
||
/** | ||
* Test method | ||
*/ | ||
public void addItem(Item item) { | ||
itemList.add(item); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return itemList.toString(); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/test/java/seedu/duke/DukeTest.java → src/test/java/seedu/binbash/DukeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package seedu.duke; | ||
package seedu.binbash; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
|