Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The Interface it is an interface remember the interface definition Interfaces are often compared to a contract, to a promise to implement the methods described
The Interface
- it is an interface
- remember the interface definition
-
Interfaces are often compared to a contract, to a promise to implement the methods described in the interface. An interface in Java does not have any real code for implementation of its methods, it has only the skeleton of the methods. When a class decides to implement an interface, it has to contain the real code for each method in the interface.
-
- These are the five methods that FootballPlayerData has to implementf
-
public void loadTable(); It needs to be called in the constructor to make the table ready and available right away. It loads real data into the array list. The FootballPlayerData starter class has a method that help with this task. The method ReadPlayersFromXML( ) read the FootballPlayer objects from an XML file and load them into the players ArrayList.
-
public ArrayList
getTable(); Returns the full table of data. Although right now is not required, soon you will need this method to return a specific ArrayList instead of a generic ArrayList. -
public ArrayList
getHeaders(); The method will return an ArrayList of Strings with the names of the FootballPlayer fields (the "headers"). -
public ArrayList
getLine(int line); The method will return an ArrayList of Strings with the values of the FootballPlayer object in a chosen line "n" in the table. -
public ArrayList
> getLines(int firstLine, int lastLine); This methods used the getLine( ) method. It gets a set of lines (each one of them an array of Strings) from getLine( int n) and adds them to an array of arrays. It returns this array of arrays.
-
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started