{"id":27166324,"url":"https://github.com/karynaaliushkevich14/task","last_synced_at":"2025-04-09T03:39:23.955Z","repository":{"id":128140344,"uuid":"606557244","full_name":"KarynaAliushkevich14/task","owner":"KarynaAliushkevich14","description":"Based on the existing code, write an implementation of the method findBlockByColor(), findBlocksByMaterial(), count()","archived":false,"fork":false,"pushed_at":"2023-02-27T08:35:59.000Z","size":62,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T03:39:21.586Z","etag":null,"topics":["java","oop"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KarynaAliushkevich14.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-25T21:04:43.000Z","updated_at":"2025-03-05T07:39:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"0352466a-ec60-4a44-ac40-e15b2e1593f9","html_url":"https://github.com/KarynaAliushkevich14/task","commit_stats":null,"previous_names":["karynaaliushkevich14/task"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarynaAliushkevich14%2Ftask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarynaAliushkevich14%2Ftask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarynaAliushkevich14%2Ftask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarynaAliushkevich14%2Ftask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KarynaAliushkevich14","download_url":"https://codeload.github.com/KarynaAliushkevich14/task/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247974584,"owners_count":21026742,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","oop"],"created_at":"2025-04-09T03:39:23.184Z","updated_at":"2025-04-09T03:39:23.945Z","avatar_url":"https://github.com/KarynaAliushkevich14.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zadanie:\nNa podstawie istniejącego kodu napisać implementację metod findBlockByColor(), findBlocksByMaterial(), count()\n\n# Rozwiązanie:\nW istniejącym programie możemy zauważyć, że interface CompositeBlock rozszerza interface Block, natomiast metoda List\u003cBlock\u003e getBlocks() znajduje się w interfejsie CompositeBlock.\nOznacza to, że zmienna List\u003cBlock\u003e blocks w klasie Wall może przechowywać nie tylko zwykłe bloki, ale także bloki kompozytowe składające się z innych bloków.\nWszystkie trzy metody sprawdzają typ bloku i w zależności od tego rozwiązują problem.\n\n\n# Task:\nBased on the existing code, write an implementation of the method findBlockByColor(), findBlocksByMaterial(), count()\n\n# Solution:\nIn the existing program, we can notice that interface CompositeBlock extends interface Block, while the List\u003cBlock\u003e getBlocks() method is located in the CompositeBlock interface.\nThis means that the List\u003cBlock\u003e blocks variable in the Wall class can store not only ordinary blocks, but also composite blocks consisting of other blocks.\nAll three methods check the block type and solve the problem based on this.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarynaaliushkevich14%2Ftask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarynaaliushkevich14%2Ftask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarynaaliushkevich14%2Ftask/lists"}