Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA Code Aircraft Class AirQuery Class You are required to create an AirQuery class which will have the following Stream Based Static methods associated with

JAVA Code

Aircraft Class

AirQuery Class

You are required to create an AirQuery class which will have the following Stream Based Static methods associated with it. Note that you must use a stream-based approach when implementing each of these methods.

public static List loadInfo(String sPath)

This method will load the information stored in the given csv (identified by the path) into a List item that is returned. You must use a streams-based approach to this question.

public static List getCountryList(List obList)

This method will return a list of (unique) country names of all countries that produced Aircraft for the 2nd world War. The list should be sorted by country name.

public static ArrayList identifyTypes(List obList)

This method will return a list of (unique) types of planes that were produced for WWII.

public static int getCount(List obList, String sCountry)

This method will return an integer that identifies the number of aircraft that the given country produced for WWII.

public static List getListByType(List obList, String sType )

This method will return a List of Aircraft that are of the given type.

private static List getListByTypeSortYear(List olList, String sType)

This method will return a List of Aircraft that are of the given type. The list will be sorted by the year the plane was introduced in.

public static List getNamesBySubTypeYear(List obList, String sSubType, int nYear)

This method will return a List of Aircraft names that are of the given Sub-type and first appeared in the given year.

public static List getCountByCountry(List obList)

This method will return a List of Strings where colon separated entry in the list details the Country and the number of planes they produced. For example, Germany:158 would indicate that Germany produced 158 different types of Aircraft in WWII.

public static List getCountByType(List obList, int Year)

This method will determine for each Type of Aircraft in the list, the number of aircraft that first appeared of that type in the given year. Each string in the list will be a colon separated string that identifies the type, the year it was introduced, and the number of that type introduced that year. For example, one of the individual strings might be Seaplanes:1941:7 which would indicate that in 1941, 7 new types of Seaplanes were introduced.

public static List getSubTypes(List obList)

This method will return a List off all the unique sub types in the aircraft list. This is probably the hardest question on this assignment (given that this must be written using streams).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Heikki Topi, Jeffrey A Hoffer, Ramesh Venkataraman

13th Edition

0134773659, 978-0134773650

More Books

Students also viewed these Databases questions