CodeGym /Courses /Java Collections /Big task: Java log parser

Big task: Java log parser

Java Collections
Level 7 , Lesson 15
Available

"Hello, soldier!"

"Congratulations on upgrading your skills. We need guys who are prepared to do anything."

"I'm sure you still have many unfinished tasks. It's time to finish some of them!"

36
Task
Java Collections, level 7, lesson 15
Locked
Log parser (part 1)
Log parser (part 1)
36
Task
Java Collections, level 7, lesson 15
Locked
Log parser (part 2)
Log parser (part 2)
36
Task
Java Collections, level 7, lesson 15
Locked
Log parser (part 3)
Log parser (part 3)
36
Task
Java Collections, level 7, lesson 15
Locked
Log parser (part 4)
Log parser (part 4)
36
Task
Java Collections, level 7, lesson 15
Locked
Log parser (part 5)
Log parser (part 5)
36
Task
Java Collections, level 7, lesson 15
Locked
Log parser (part 6)
Log parser (part 6)
36
Task
Java Collections, level 7, lesson 15
Locked
Log parser (part 7)
Log parser (part 7)
9
Task
Java Collections, level 7, lesson 15
Locked
Log parser (part 8)
Log parser (part 8)
Comments (4)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
matemate123 Level 50, Kraków, Poland
12 November 2023
One of my favorite projects so far. Learn how to reuse code and expand for new features. The Validator has a mercy here too.
Justin Smith Level 41, Greenfield, USA, United States
13 February 2023
I keep coming back to edit this as I progress through the task. This is one of my favorite big tasks so far. Really good project for learning to optimize your code efficiency. After part 1 I had almost 400 lines of code. It was super bloated. After part 2, I have... almost 400 lines of code, despite more than doubling the number of methods. In between (and I recommend you do this, too), I read up on how to use Java lambdas, and how they work with collection filtering. I think CodeGym doesn't go into lambdas because they were introduced with Java 8 and CG was developed for Java 7 originally. Anyway, as a learning experience I recommend just go through Part 1 and see how much redundant code you end up with, and then with part 2, scrap the whole thing and think strategically about how to compress the redundant code into only being called once. Ideally, you want a single method that handles all the filtering of the collection, and the methods that are required for the tasks just call that central method with appropriate parameters to get what they need. I suggest creating an Enum for the data type that you want to filter by or return. If you create a flexible query method by the end of Part 2, then Parts 3 & 4 become Easy tasks! This task is a great example of how I wish we had a place to discuss our own solutions, I'm really pleased with mine!
Senned Level 41, Azov, Russia
31 December 2019
First task: minus one day becouse parameters splited only by TAB(s.split("\t")). These are not in the conditions, but validator want it!(
Senned Level 41, Azov, Russia
4 January 2020
And attention in 7th task - dates "after" and "before" must not including!