Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iang/wordcounter
A simple Java project that shows how to use the Java 8 stream API to process data
https://github.com/iang/wordcounter
Last synced: 2 days ago
JSON representation
A simple Java project that shows how to use the Java 8 stream API to process data
- Host: GitHub
- URL: https://github.com/iang/wordcounter
- Owner: IanG
- Created: 2018-03-15T15:25:20.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-02-17T10:55:21.000Z (almost 3 years ago)
- Last Synced: 2024-11-30T11:08:48.221Z (2 months ago)
- Language: Java
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# wordcounter
A simple Java project that shows how to use the Java 8 stream API to process dataThis project demonstrates how to use the Java Stream API to process data to perform map, reduce and aggregate
operations.The uk.co.aspian.wordcounter.WordCounter utility class allows you to perform the following operations on a File object you provide it.
1. Count the number of words in a given file.
2. Obtain a List of the distinct words in a given file.
3. Obtain a Map of all the distinct words and the number of occurrences in a given file.The JUnit test uk.co.aspian.wordcounter.WordCounterTest.java carries out various tests on the WordCounter utility class
making use of file resources EmptyFile.txt and ValidFile.txt to ensure the class gives predictable results.To run the tests run:
mvn test
To build the .jar file run:
mvn package