diff --git a/java/src/main/java/com/kevinthorley/csi280/project01/ClassRepo.java b/java/src/main/java/com/kevinthorley/csi280/project01/ClassRepo.java index abe78b1..26b1870 100644 --- a/java/src/main/java/com/kevinthorley/csi280/project01/ClassRepo.java +++ b/java/src/main/java/com/kevinthorley/csi280/project01/ClassRepo.java @@ -15,11 +15,19 @@ public ClassRepo() { } public Section findById(String id) { - // TODO: find a section by its id - return null; - } + for(int i = 0; i < this.sections.size(); i++) + { + if(this.sections.get(i).getId() == id) + { + return this.sections.get(i); + } + } + + return null; +} public void addSection(Section section) { - // TODO: add a section to the repository + this.sections.add(section); } + }