Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Java: How to Implement? Create a new class named URLWrapper with the following: 1 . Two private data members: final URL url and int

Using Java:
How to Implement?
Create a new class named URLWrapper with the following:
1. Two private data members: final URL url and int count.
2. Constructor: creates URL object with a parameter and assign it to the private member url.
3. Getter methods for private data members:
protected URL getURL()
protected int getCount()
4. The findCount method finds the number of occurrences of the user-specified search keyword in the HTML file.
Set up buffered reader.
Read from URL and count the number of occurrences of keyword.
protected void findCount(String key)
5. The extractInnerURL method gets inner URLs.
For the inner links, may use the regular expression: "href=\"((http|https):\\/\\/.*)\""
protected ArrayList extractInnerURLS(String key)
Procedures:
1. Get input from the user: base URL and search keyword from the console.
2. Get the total occurrence of search keyword for base URL.
3. Get inner URLs.
4. Get the total occurrence of search keyword for each inner URL.
5. Sort the inner URLs in descending order by count.
6. Print result to screen and write to file.

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_2

Step: 3

blur-text-image_3

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

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions

Question

Why should supply be concerned about the balance sheet?

Answered: 1 week ago

Question

Are we managing our human capital as a strategic asset?

Answered: 1 week ago