Package FLOTF

Class NSNScrape


  • public class NSNScrape
    extends java.lang.Object
    This class holds the logic to webscrape NSNCenter.com for National Stock Numbers
    Author:
    Bernard Chan, Sonali Loomba
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.ArrayList<java.lang.String[]> scrapedNSNs
      Stores the scraped National Stock Number information
    • Constructor Summary

      Constructors 
      Constructor Description
      NSNScrape()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void clearNSNList()
      Clears scrapedNSNs to enable cancel button functionality and the user to navigate back and forth in the GUI without the logic breaking
      static java.util.ArrayList<java.lang.String[]> getScrapedNSNs()
      Gets scrapedNSNs
      static void webScrape​(Part part)
      Scrapes NSNCenter.com for a particular part and stores all the possible corresponding National Stock Numbers in the scrapedNSNs
      • Methods inherited from class java.lang.Object

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

      • scrapedNSNs

        private static java.util.ArrayList<java.lang.String[]> scrapedNSNs
        Stores the scraped National Stock Number information
    • Constructor Detail

      • NSNScrape

        public NSNScrape()
    • Method Detail

      • webScrape

        public static void webScrape​(Part part)
                              throws java.io.IOException
        Scrapes NSNCenter.com for a particular part and stores all the possible corresponding National Stock Numbers in the scrapedNSNs
        Parameters:
        part - that is being looked for while webscraping
        Throws:
        java.io.IOException - if connecting to the webpage fails
      • clearNSNList

        public static void clearNSNList()
        Clears scrapedNSNs to enable cancel button functionality and the user to navigate back and forth in the GUI without the logic breaking
      • getScrapedNSNs

        public static java.util.ArrayList<java.lang.String[]> getScrapedNSNs()
        Gets scrapedNSNs
        Returns:
        an Arraylist specifying the scraped NSNs