https://github.com/kgniewek/filereader-dataprocessorpractise
2021 Java practice project focused on file reading and data processing. It includes functions for custom exception handling, data conversion into objects, and basic filtering of records based on specific criteria. A practice of Java fundamentals
https://github.com/kgniewek/filereader-dataprocessorpractise
2021 data-conversion data-filtering data-processing error-handling java reading-data
Last synced: about 1 year ago
JSON representation
2021 Java practice project focused on file reading and data processing. It includes functions for custom exception handling, data conversion into objects, and basic filtering of records based on specific criteria. A practice of Java fundamentals
- Host: GitHub
- URL: https://github.com/kgniewek/filereader-dataprocessorpractise
- Owner: kgniewek
- Created: 2024-04-24T13:11:34.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-26T13:25:02.000Z (about 2 years ago)
- Last Synced: 2025-01-24T17:45:03.720Z (over 1 year ago)
- Topics: 2021, data-conversion, data-filtering, data-processing, error-handling, java, reading-data
- Language: Java
- Homepage:
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 2021 Java Practice Project - Simple File Reader and Data Processor
### Overview
This small Java project serves as a practice exercise to explore basic file operations, exception handling, and data manipulation in Java. The application reads from a simple text file containing details of individuals, processes the information, and performs basic filtering based on criteria.
### Functionality
- **Reading Data**: The application reads data from `people.txt` using `FileHelper`, which stores each line as a string in a list.
- **Data Conversion**: `PersonOperationHelper` converts these string entries into `Person` objects, using a custom format specified in the text file.
- **Error Handling**: Implements custom exception handling for data conversion errors, particularly focusing on salary values.
- **Data Filtering**: The `Main` class includes a method to filter `Person` objects based on surname start, sex, and a limit to the number of results.
### Usage
To run this application, compile and execute the `Main.java`. It requires no command line arguments but will automatically process data as per the hardcoded logic in the `main` method.
### Project Structure
- **src/com/company/Main.java**: Contains the `main` method that orchestrates the reading of data from a file, processing it into `Person` objects, and filtering based on specific attributes.
- **src/First/FileHelper.java**: Handles reading lines from a file and storing them in a list.
- **src/First/InvalidSalaryException.java**: Custom exception class for handling invalid salary data.
- **src/First/Person.java**: Data model class representing an individual with attributes like name, surname, age, city, salary, and sex.
- **src/First/PersonOperationHelper.java**: Provides functionality to convert lines of text into `Person` objects.
- **src/First/people.txt**: Text file containing semi-colon separated values representing people.
Files:
- 📁 **src**
- 📁 **com**
- 📁 **company**
- `Main.java`
- 📁 **First**
- `FileHelper.java`
- `InvalidSalaryException.java`
- `people.txt`
- `Person.java`
- `PersonOperationHelper.java`