From 6d04f69f3dcf08da94a40f8901eefb0be1209222 Mon Sep 17 00:00:00 2001 From: ATaylor0731 Date: Tue, 2 Feb 2016 20:14:04 -0500 Subject: [PATCH] Tony Taylor Commiting Changes --- .../kevinthorley/csi280/project01/ClassRepo.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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); } + }