コード例 #1
0
 public boolean containInName(String name) {
   Iterator<CommodityPO> iterator = set.iterator();
   while (iterator.hasNext()) {
     if (iterator.next().getName().equals(name)) {
       return true;
     }
   }
   return false;
 }
コード例 #2
0
 public void delete(CommodityPO po) {
   Iterator<CommodityPO> iterator = set.iterator();
   while (iterator.hasNext()) {
     if (iterator.next().getId().equals(po.getId())) {
       iterator.remove();
       break;
     }
   }
 }
コード例 #3
0
 public boolean containInId(String id) {
   Iterator<CommodityPO> iterator = set.iterator();
   while (iterator.hasNext()) {
     if (iterator.next().getId().equals(id)) {
       return true;
     }
   }
   return false;
 }
コード例 #4
0
 public CommodityPO findCommodityInName(String name) {
   Iterator<CommodityPO> iterator = set.iterator();
   CommodityPO po = null;
   while (iterator.hasNext()) {
     po = iterator.next();
     if (po.getName().equals(name)) {
       return po;
     }
   }
   return null;
 }
コード例 #5
0
 public CommodityPO findCommodityInID(String id) {
   Iterator<CommodityPO> iterator = set.iterator();
   CommodityPO po = null;
   while (iterator.hasNext()) {
     po = iterator.next();
     if (po.getId().equals(id)) {
       return po;
     }
   }
   return null;
 }
コード例 #6
0
 public boolean containInType(String id) {
   Iterator<CommodityPO> iterator = set.iterator();
   CommodityPO po = null;
   while (iterator.hasNext()) {
     po = iterator.next();
     if (po.getId().substring(0, 11).equals(id)) {
       return true;
     }
   }
   return false;
 }
コード例 #7
0
 public Iterator<CommodityPO> findCommoditiesInType(String id) {
   ArrayList<CommodityPO> list = new ArrayList<CommodityPO>();
   Iterator<CommodityPO> iterator = set.iterator();
   CommodityPO po = null;
   while (iterator.hasNext()) {
     po = iterator.next();
     if (po.getId().substring(0, 11).equals(id)) {
       list.add(po);
     }
   }
   return list.iterator();
 }
コード例 #8
0
 public boolean containInKeyword(String key) {
   Iterator<CommodityPO> iterator = set.iterator();
   CommodityPO po = null;
   while (iterator.hasNext()) {
     po = iterator.next();
     if (po.getId().contains(key) || po.getName().contains(key)) {
       return true;
     } else {
       Iterator<CommodityPO.CommodityModelPO> it = po.getList().iterator();
       while (it.hasNext()) {
         if (it.next().getName().contains(key) || it.next().getStorehouse().contains(key)) {
           return true;
         }
       }
     }
   }
   return false;
 }
コード例 #9
0
 public Iterator<CommodityPO> findCommoditiesInKeyword(String key) {
   ArrayList<CommodityPO> output = new ArrayList<CommodityPO>();
   Iterator<CommodityPO> iterator = set.iterator();
   CommodityPO po = null;
   while (iterator.hasNext()) {
     po = iterator.next();
     if (po.getId().contains(key) || po.getName().contains(key)) {
       output.add(po);
     } else {
       Iterator<CommodityPO.CommodityModelPO> it = po.getList().iterator();
       while (it.hasNext()) {
         if (it.next().getName().contains(key) || it.next().getStorehouse().contains(key)) {
           output.add(po);
         }
       }
     }
   }
   return output.iterator();
 }
コード例 #10
0
 public Iterator<CommodityPO> getAllCommodities() {
   return set.iterator();
 }
コード例 #11
0
 public void insert(CommodityPO po) {
   set.add(po);
 }
コード例 #12
0
 public boolean hasCommodity() {
   return set.size() == 0 ? false : true;
 }