Package exceptions

Examples of exceptions.ItemNotFoundException


   * @param i Item to remove.
   * @throws ItemNotFoundException
   */
  public void removeFromInventory(Item i) throws ItemNotFoundException {
    if(!inventory.contains(i))
      throw new ItemNotFoundException();
    totalWeight -= i.getWeight();
  //  inventory.remove(i);//needs compatibility fix with Inventory.java
  }
View Full Code Here


   * @throws ItemNotFoundException
   */
  public void removeFromInventory(List<Item> l) throws ItemNotFoundException {
    for(Item i : l)
      if(!inventory.contains(i))
        throw new ItemNotFoundException();
    totalWeight -= sumWeight(l);
  //  inventory.removeAll(l);//needs compatibility fix with Inventory.java
  }
View Full Code Here

TOP

Related Classes of exceptions.ItemNotFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.