java.lang.Object
com.xavierloeraflores.inventorymanagement.Inventory

public class Inventory extends Object
A class representing the inventory which contains all parts and products.
Author:
xavierloeraflores
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final javafx.collections.ObservableList<Part>
    The [observableArrayList] of parts in the inventory.
    private static final javafx.collections.ObservableList<Product>
    The [observableArrayList] of products in the inventory.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addPart(Part newPart)
    Adds a part to the allParts list of the inventory.
    static void
    addProduct(Product newProduct)
    Adds a product to the allProducts list of the inventory.
    static boolean
    deletePart(Part selectedPart)
    Takes an index value pointing to a part in the inventory to delete it and return true or false if successful
    static boolean
    deleteProduct(Product selectedProduct)
    Takes an index value pointing to a product in the inventory to delete it and return true or false if successful
    static javafx.collections.ObservableList<Part>
    Returns the full list of parts in the inventory
    static javafx.collections.ObservableList<Product>
    Returns the full list of product in the inventory
    static Part
    lookupPart(int partId)
    Looks up a part given a partID and returns the result.
    static javafx.collections.ObservableList<Part>
    lookupPart(String partName)
    Looks up parts given a partName and returns the result
    static Product
    lookupProduct(int productId)
    Looks up a product given a productId and returns the result.
    static javafx.collections.ObservableList<Product>
    lookupProduct(String productName)
    Looks up products given a productName and returns the result
    static void
    updatePart(int index, Part newPart)
    Takes an index value pointing to a part in the inventory and updates it with the given newPart
    static void
    updateProduct(int index, Product newProduct)
    Takes an index value pointing to a product in the inventory and updates it with the given newProduct

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • allParts

      private static final javafx.collections.ObservableList<Part> allParts
      The [observableArrayList] of parts in the inventory.
    • allProducts

      private static final javafx.collections.ObservableList<Product> allProducts
      The [observableArrayList] of products in the inventory.
  • Constructor Details

    • Inventory

      public Inventory()
  • Method Details

    • addPart

      public static void addPart(Part newPart)
      Adds a part to the allParts list of the inventory.
      Parameters:
      newPart - The [Part] object part to be added to the allParts of the inventory.
    • addProduct

      public static void addProduct(Product newProduct)
      Adds a product to the allProducts list of the inventory.
      Parameters:
      newProduct - The [Product] object part to be added to the allProducts of the inventory.
    • lookupPart

      public static Part lookupPart(int partId)
      Looks up a part given a partID and returns the result.
      Parameters:
      partId - [int] partId value to be looked up
      Returns:
      Part matching the given partId value or null if not found
    • lookupProduct

      public static Product lookupProduct(int productId)
      Looks up a product given a productId and returns the result.
      Parameters:
      productId - [int] productId value to be looked up
      Returns:
      Product matching the given productId value or null if not found
    • lookupPart

      public static javafx.collections.ObservableList<Part> lookupPart(String partName)
      Looks up parts given a partName and returns the result
      Parameters:
      partName - [string] value partName to be looked up
      Returns:
      ObservableList matching the given partName value or null if not found
    • lookupProduct

      public static javafx.collections.ObservableList<Product> lookupProduct(String productName)
      Looks up products given a productName and returns the result
      Parameters:
      productName - [string] value productName to be looked up
      Returns:
      ObservableList matching the given productName value or null if not found
    • updatePart

      public static void updatePart(int index, Part newPart)
      Takes an index value pointing to a part in the inventory and updates it with the given newPart
      Parameters:
      index - [int] index value pointing to the index of the part to be edited part in inventory
      newPart - [Part] newPart value which will replace the old part
    • updateProduct

      public static void updateProduct(int index, Product newProduct)
      Takes an index value pointing to a product in the inventory and updates it with the given newProduct
      Parameters:
      index - [int] index value pointing to the index of the product to be edited part in inventory
      newProduct - [Product] newProduct value which will replace the old product
    • deletePart

      public static boolean deletePart(Part selectedPart)
      Takes an index value pointing to a part in the inventory to delete it and return true or false if successful
      Parameters:
      selectedPart - [Part] newPart value which will be deleted
      Returns:
      true if the part was successfully delete or false if no deletion was made
    • deleteProduct

      public static boolean deleteProduct(Product selectedProduct)
      Takes an index value pointing to a product in the inventory to delete it and return true or false if successful
      Parameters:
      selectedProduct - [Product] selectedProduct value which will be deleted
      Returns:
      true if the product was successfully delete or false if no deletion was made
    • getAllParts

      public static javafx.collections.ObservableList<Part> getAllParts()
      Returns the full list of parts in the inventory
      Returns:
      ObservableList list of parts in the inventory
    • getAllProducts

      public static javafx.collections.ObservableList<Product> getAllProducts()
      Returns the full list of product in the inventory
      Returns:
      ObservableList list of product in the inventory