/** * searches all registry lists for a specific keyword and returns all matches in a a list * * <p>function is obsolete since 1.19 * * @param req the "search keyword" * @return list of matching objects */ public ArrayList<Object> search(String req) { ArrayList<Object> returnValues = new ArrayList<Object>(); for (Customer c : getCustomers().values()) { if (c.getName().contains(req) || c.getAddress().contains(req) || c.getCivic().contains(req) || c.getPhone().contains(req)) { returnValues.add(c); } } for (Item i : getItems().values()) { if (i.getName().contains(req) || i.getPrice().contains(req) || i.getDetails().contains(req)) { returnValues.add(i); } } for (Order i : getOrders().values()) { if (i.getOrderNo().contains(req) || i.getCustomer().getName().contains(req)) { returnValues.add(i); } } return returnValues; }
public void addOrder(Order tmp) { orders.put(tmp.getOrderNo(), tmp); }