O'Reilly logo

Mastering Concurrency Programming with Java 9 - Second Edition by Javier Fernández González

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The serial version

We have implemented the serial version of our keyword algorithm in the SerialKeywordExtraction class. It defines the main() method you are going to execute to test the algorithm.

The first step is to declare the following necessary internal variables to execute the algorithm:

  • Two Date objects to measure the execution time
  • A string to store the name of the directory that contains the document collection
  • An array of File objects to store the files with the document collection
  • A HashMap to store the global vocabulary of the document collection
  • A HashMap to store the keywords
  • Two int values to measure statistic data about the execution

The following includes the declaration of these variables:

public class SerialKeywordExtraction ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required