From 3528a4df53a8ee93a1948bdd41825d8464ef9f78 Mon Sep 17 00:00:00 2001 From: Kamal Wickramanayake Date: Sun, 15 Mar 2026 14:49:00 +0530 Subject: Added ItemManager --- .../src/lk/ac/pdn/ceit/pos/Item.java | 34 ---------------------- .../src/lk/ac/pdn/ceit/pos/entities/Item.java | 34 ++++++++++++++++++++++ .../src/lk/ac/pdn/ceit/pos/item/ItemManager.java | 11 +++++++ 3 files changed, 45 insertions(+), 34 deletions(-) delete mode 100644 oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/Item.java create mode 100644 oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/entities/Item.java create mode 100644 oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/item/ItemManager.java (limited to 'oop/10-point-of-sale/src') diff --git a/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/Item.java b/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/Item.java deleted file mode 100644 index 08567c7..0000000 --- a/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/Item.java +++ /dev/null @@ -1,34 +0,0 @@ -package lk.ac.pdn.ceit.pos; - -public class Item { - private String name; - private String id; - private double unitPrice; - - public Item(String name, String id, double unitPrice) { - this.name = name; - this.id = id; - this.unitPrice = unitPrice; - } - - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public double getUnitPrice() { - return unitPrice; - } - public void setUnitPrice(double unitPrice) { - this.unitPrice = unitPrice; - } - - -} diff --git a/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/entities/Item.java b/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/entities/Item.java new file mode 100644 index 0000000..47b8e32 --- /dev/null +++ b/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/entities/Item.java @@ -0,0 +1,34 @@ +package lk.ac.pdn.ceit.pos.entities; + +public class Item { + private String name; + private String id; + private double unitPrice; + + public Item(String name, String id, double unitPrice) { + this.name = name; + this.id = id; + this.unitPrice = unitPrice; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + public double getUnitPrice() { + return unitPrice; + } + public void setUnitPrice(double unitPrice) { + this.unitPrice = unitPrice; + } + + +} diff --git a/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/item/ItemManager.java b/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/item/ItemManager.java new file mode 100644 index 0000000..5c6b47e --- /dev/null +++ b/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/item/ItemManager.java @@ -0,0 +1,11 @@ +package lk.ac.pdn.ceit.pos.item; + +import java.util.List; + +import lk.ac.pdn.ceit.pos.entities.Item; + +public interface ItemManager { + public Item findById(String id); + public List searchByName(String word); + public Item create(String name, String id, double unitPrice); +} -- cgit v1.2.3