This class will contain the method necessary to read and parse the .csv file of stock information. This class shall contain a default constructor with no parameters. The constructor should be made private. . This is to prevent the class from being instantiated since the class will only contain static methods. This class shall contain no data fields. This class shall have a method called readStockData: . This method shall be a public, static, method. . This method shall return a StockList object once all data has been processed. . This method will take a File object as a parameter. This File object should link to the stock market data in your files folder created previously. • This method must validate that the given File object is a .csv file. If it is not, then this method shall throw an IllegalArgumentException. . This method shall read the File object and process all of the stock data into TeslaStock objects and store each object in a StockList. ▪ NOTE: The data must be parsed so each piece of data is correctly assigned to its respective data field in the TeslaStock class. ▪ NOTE: You will want to ignore the first line of data as this line contains the header labels for each column of data. No other methods are allowed.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter4: More Object Concepts
Section: Chapter Questions
Problem 11PE
icon
Related questions
Question
StockReader
Class
• This class will contain the method necessary to read and parse the .csv file of stock information.
• This class shall contain a default constructor with no parameters. The constructor should be made private.
. This is to prevent the class from being instantiated since the class will only contain static methods.
• This class shall contain no data fields.
• This class shall have a method called readStockData:
. This method shall be a public, static, method.
. This method shall return a StockList object once all data has been processed.
. This method will take a File object as a parameter. This File object should link to the stock market data in your files
folder created previously.
. This method must validate that the given File object is a .csv file. If it is not, then this method shall throw an
IllegalArgumentException.
. This method shall read the File object and process all of the stock data into TeslaStock objects and store each object
in a StockList.
NOTE: The data must be parsed so each piece of data is correctly assigned to its respective data field in the
TeslaStock class.
▪ NOTE: You will want to ignore the first line of data as this line contains the header labels for each column of data.
• No other methods are allowed.
Transcribed Image Text:StockReader Class • This class will contain the method necessary to read and parse the .csv file of stock information. • This class shall contain a default constructor with no parameters. The constructor should be made private. . This is to prevent the class from being instantiated since the class will only contain static methods. • This class shall contain no data fields. • This class shall have a method called readStockData: . This method shall be a public, static, method. . This method shall return a StockList object once all data has been processed. . This method will take a File object as a parameter. This File object should link to the stock market data in your files folder created previously. . This method must validate that the given File object is a .csv file. If it is not, then this method shall throw an IllegalArgumentException. . This method shall read the File object and process all of the stock data into TeslaStock objects and store each object in a StockList. NOTE: The data must be parsed so each piece of data is correctly assigned to its respective data field in the TeslaStock class. ▪ NOTE: You will want to ignore the first line of data as this line contains the header labels for each column of data. • No other methods are allowed.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Unreferenced Objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage