Skip to content

YuriiJavaDev/JavaBasics_Task_448_V0.1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Streaming Service: List Search & State Management (JavaBasics_Task_448_V0.1)

📖 Description

User experience in streaming platforms depends heavily on the ability to manage personal watchlists. This project demonstrates advanced ArrayList operations for a "To Watch" feature. Key functionalities include:

  • Index Search: Using indexOf() to identify the position of specific elements (e.g., tracking duplicate entries).
  • Membership Verification: Using contains() to check for the presence of a title without iterating manually.
  • Bulk Reset: Utilizing clear() to perform a complete state reset of the collection. These operations are essential for maintaining clean and responsive user interfaces.

📋 Requirements Compliance

  • Predictable Search: Correctly identified the zero-based index of "The Shmatrix".
  • Conditional Checking: Implemented a boolean check for "Arvatar" to handle missing data gracefully.
  • Resource Management: Demonstrated the clear() method for efficient memory cleanup of the list contents.
  • Type Safety: Strictly used ArrayList<String> to maintain a consistent data model for movie titles.

🚀 Architectural Stack

  • Java 8+ (Collections Framework, ArrayList)

🏗️ Implementation Details

  • StreamingManagerApp: The main class orchestrating the lifecycle of the user's movie list.

📋 Expected result

Index of The Shmatrix: 1
Is Arvatar in the list? false
List after clearing: []

💻 Code Example

Project Structure:

JavaBasics_Task_448/
├── src/
│   └── com/yurii/pavlenko/
│                 └── app/
│                     └── StreamingManagerApp.java
├── LICENSE
├── TASK.md
├── THEORY.md
└── README.md

Code

package com.yurii.pavlenko.app;

import java.util.ArrayList;
import java.util.List;

public class StreamingManagerApp {

  public static void main(String[] args) {

    List<String> watchList = new ArrayList<>();

    watchList.add("Titanic");
    watchList.add("The Shmatrix");
    watchList.add("Interstellar");

    watchList.add("The Shmatrix");

    int shmatrixIndex = watchList.indexOf("The Shmatrix");
    System.out.println("Index of The Shmatrix: " + shmatrixIndex);

    boolean hasArvatar = watchList.contains("Arvatar");
    System.out.println("Is Arvatar in the list? " + hasArvatar);

    watchList.clear();

    System.out.println("List after clearing: " + watchList);
  }
}

⚖️ License

This project is licensed under the MIT License.

Copyright (c) 2026 Yurii Pavlenko

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files...

License: MIT

About

This is a tutorial project. JavaBasics_Task_448_V0.1 Streaming Service: implementing "To Watch" list management with duplicate tracking, presence verification, and bulk collection clearing. 110526_1059

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages