diff --git a/src/ItemsByCapacity.java b/src/ItemsByCapacity.java index faf7f85..dcc971f 100644 --- a/src/ItemsByCapacity.java +++ b/src/ItemsByCapacity.java @@ -1,21 +1,23 @@ -import java.util.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; public class ItemsByCapacity { - private Capacity capacity; - private SiteA siteA; - public ItemsByCapacity(Capacity capacity, SiteA siteA) { - this.capacity = capacity; - this.siteA = siteA; - } - public List> getValue() { - List> temp_l1 = new ArrayList<>(); - { - for (Map item: this.siteA.getValue()) { - if ((Integer) item.get("capacity") >= this.capacity.getValue()) { - temp_l1.add(item); - } - } - } - return temp_l1; - } + private Capacity capacity; + private SiteWrapper siteWrapper; + + public ItemsByCapacity(Capacity capacity, SiteWrapper siteWrapper) { + this.capacity = capacity; + this.siteWrapper = siteWrapper; + } + + public List> getValue() { + List> temp_l1 = new ArrayList<>(); + for (Map item: this.siteWrapper.getSiteValue()) { + if ((Integer) item.get("capacity") >= this.capacity.getValue()) { + temp_l1.add(item); + } + } + return temp_l1; + } } \ No newline at end of file