소스 검색

Trhough Part 9

Nathan Hall 5 년 전
부모
커밋
4a25cfafc9

+ 121
- 33
src/.idea/workspace.xml 파일 보기

@@ -2,10 +2,13 @@
2 2
 <project version="4">
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="c08e742d-ec86-4dda-b948-e67c704654a9" name="Default Changelist" comment="">
5
-      <change afterPath="$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/Students.java" afterDir="false" />
5
+      <change afterPath="$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/Classroom.java" afterDir="false" />
6
+      <change afterPath="$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/Instructors.java" afterDir="false" />
7
+      <change afterPath="$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/StudentConfig.java" afterDir="false" />
6 8
       <change beforePath="$PROJECT_DIR$/../README.md" beforeDir="false" />
7 9
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
8 10
       <change beforePath="$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/People.java" beforeDir="false" afterPath="$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/People.java" afterDir="false" />
11
+      <change beforePath="$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/Students.java" beforeDir="false" afterPath="$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/Students.java" afterDir="false" />
9 12
     </list>
10 13
     <ignored path="$PROJECT_DIR$/target/" />
11 14
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@@ -24,12 +27,12 @@
24 27
       </usages-collector>
25 28
       <usages-collector id="statistics.file.types.open">
26 29
         <counts>
27
-          <entry key="JAVA" value="7" />
30
+          <entry key="JAVA" value="10" />
28 31
         </counts>
29 32
       </usages-collector>
30 33
       <usages-collector id="statistics.file.types.edit">
31 34
         <counts>
32
-          <entry key="JAVA" value="1332" />
35
+          <entry key="JAVA" value="1949" />
33 36
         </counts>
34 37
       </usages-collector>
35 38
     </session>
@@ -97,11 +100,11 @@
97 100
           </provider>
98 101
         </entry>
99 102
       </file>
100
-      <file pinned="false" current-in-tab="true">
103
+      <file pinned="false" current-in-tab="false">
101 104
         <entry file="file://$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/People.java">
102 105
           <provider selected="true" editor-type-id="text-editor">
103
-            <state relative-caret-position="279">
104
-              <caret line="49" column="19" selection-start-line="49" selection-start-column="19" selection-end-line="49" selection-end-column="19" />
106
+            <state relative-caret-position="250">
107
+              <caret line="62" column="37" selection-start-line="62" selection-start-column="37" selection-end-line="62" selection-end-column="37" />
105 108
               <folding>
106 109
                 <element signature="imports" expanded="true" />
107 110
                 <element signature="e#318#319#0" expanded="true" />
@@ -116,6 +119,10 @@
116 119
                 <element signature="e#680#681#0" expanded="true" />
117 120
                 <element signature="e#707#708#0" expanded="true" />
118 121
                 <element signature="e#741#742#0" expanded="true" />
122
+                <element signature="e#1121#1122#0" expanded="true" />
123
+                <element signature="e#1154#1155#0" expanded="true" />
124
+                <element signature="e#1350#1351#0" expanded="true" />
125
+                <element signature="e#1382#1383#0" expanded="true" />
119 126
               </folding>
120 127
             </state>
121 128
           </provider>
@@ -124,8 +131,48 @@
124 131
       <file pinned="false" current-in-tab="false">
125 132
         <entry file="file://$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/Students.java">
126 133
           <provider selected="true" editor-type-id="text-editor">
127
-            <state relative-caret-position="45">
128
-              <caret line="3" lean-forward="true" selection-start-line="3" selection-end-line="3" />
134
+            <state relative-caret-position="195">
135
+              <caret line="13" lean-forward="true" selection-start-line="13" selection-end-line="13" />
136
+              <folding>
137
+                <element signature="imports" expanded="true" />
138
+                <element signature="e#219#220#0" expanded="true" />
139
+                <element signature="e#243#244#0" expanded="true" />
140
+              </folding>
141
+            </state>
142
+          </provider>
143
+        </entry>
144
+      </file>
145
+      <file pinned="false" current-in-tab="false">
146
+        <entry file="file://$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/Instructors.java">
147
+          <provider selected="true" editor-type-id="text-editor">
148
+            <state relative-caret-position="135">
149
+              <caret line="9" lean-forward="true" selection-start-line="9" selection-end-line="9" />
150
+              <folding>
151
+                <element signature="e#176#177#0" expanded="true" />
152
+                <element signature="e#196#197#0" expanded="true" />
153
+              </folding>
154
+            </state>
155
+          </provider>
156
+        </entry>
157
+      </file>
158
+      <file pinned="false" current-in-tab="false">
159
+        <entry file="file://$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/Classroom.java">
160
+          <provider selected="true" editor-type-id="text-editor">
161
+            <state relative-caret-position="232">
162
+              <caret line="16" column="49" lean-forward="true" selection-start-line="16" selection-start-column="49" selection-end-line="16" selection-end-column="49" />
163
+              <folding>
164
+                <element signature="e#366#367#0" expanded="true" />
165
+                <element signature="e#399#400#0" expanded="true" />
166
+              </folding>
167
+            </state>
168
+          </provider>
169
+        </entry>
170
+      </file>
171
+      <file pinned="false" current-in-tab="true">
172
+        <entry file="file://$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/StudentConfig.java">
173
+          <provider selected="true" editor-type-id="text-editor">
174
+            <state relative-caret-position="120">
175
+              <caret line="8" column="8" lean-forward="true" selection-start-line="8" selection-start-column="8" selection-end-line="8" selection-end-column="8" />
129 176
             </state>
130 177
           </provider>
131 178
         </entry>
@@ -152,7 +199,10 @@
152 199
         <option value="$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/Teacher.java" />
153 200
         <option value="$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/Instructor.java" />
154 201
         <option value="$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/Students.java" />
202
+        <option value="$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/Instructors.java" />
155 203
         <option value="$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/People.java" />
204
+        <option value="$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/Classroom.java" />
205
+        <option value="$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/StudentConfig.java" />
156 206
       </list>
157 207
     </option>
158 208
   </component>
@@ -163,9 +213,9 @@
163 213
     <sorting>DEFINITION_ORDER</sorting>
164 214
   </component>
165 215
   <component name="ProjectFrameBounds">
166
-    <option name="x" value="-292" />
167
-    <option name="y" value="-940" />
168
-    <option name="width" value="1181" />
216
+    <option name="x" value="-116" />
217
+    <option name="y" value="-881" />
218
+    <option name="width" value="1031" />
169 219
     <option name="height" value="740" />
170 220
   </component>
171 221
   <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
@@ -221,7 +271,7 @@
221 271
   <component name="PropertiesComponent">
222 272
     <property name="WebServerToolWindowFactoryState" value="false" />
223 273
     <property name="aspect.path.notification.shown" value="true" />
224
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544833396310" />
274
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1545063695027" />
225 275
     <property name="last_opened_file_path" value="$PROJECT_DIR$/pom.xml" />
226 276
     <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
227 277
     <property name="nodejs_npm_path_reset_for_default_project" value="true" />
@@ -248,15 +298,15 @@
248 298
       <option name="number" value="Default" />
249 299
       <option name="presentableId" value="Default" />
250 300
       <updated>1544810070163</updated>
251
-      <workItem from="1544810074468" duration="10417000" />
301
+      <workItem from="1544810074468" duration="14007000" />
252 302
     </task>
253 303
     <servers />
254 304
   </component>
255 305
   <component name="TimeTrackingManager">
256
-    <option name="totallyTimeSpent" value="10417000" />
306
+    <option name="totallyTimeSpent" value="14007000" />
257 307
   </component>
258 308
   <component name="ToolWindowManager">
259
-    <frame x="-292" y="-940" width="1181" height="740" extended-state="0" />
309
+    <frame x="-116" y="-881" width="1031" height="740" extended-state="0" />
260 310
     <editor active="true" />
261 311
     <layout>
262 312
       <window_info id="Designer" />
@@ -265,16 +315,16 @@
265 315
       <window_info id="Favorites" side_tool="true" />
266 316
       <window_info id="Capture Tool" />
267 317
       <window_info id="Web" side_tool="true" />
268
-      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.2712906" />
318
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.13751264" />
269 319
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
270 320
       <window_info anchor="bottom" id="Spring" />
271
-      <window_info active="true" anchor="bottom" id="Terminal" visible="true" weight="0.3344" />
321
+      <window_info anchor="bottom" id="Terminal" weight="0.3344" />
272 322
       <window_info anchor="bottom" id="Event Log" side_tool="true" />
273 323
       <window_info anchor="bottom" id="Java Enterprise" />
274 324
       <window_info anchor="bottom" id="Database Changes" show_stripe_button="false" />
275 325
       <window_info anchor="bottom" id="Version Control" show_stripe_button="false" />
276 326
       <window_info anchor="bottom" id="Message" order="0" />
277
-      <window_info anchor="bottom" id="Find" order="1" weight="0.38643533" />
327
+      <window_info active="true" anchor="bottom" id="Find" order="1" visible="true" weight="0.3856" />
278 328
       <window_info anchor="bottom" id="Run" order="2" />
279 329
       <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
280 330
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
@@ -325,17 +375,6 @@
325 375
         </state>
326 376
       </provider>
327 377
     </entry>
328
-    <entry file="file://$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/Instructor.java">
329
-      <provider selected="true" editor-type-id="text-editor">
330
-        <state relative-caret-position="375">
331
-          <caret line="25" lean-forward="true" selection-start-line="25" selection-end-line="25" />
332
-          <folding>
333
-            <element signature="e#146#147#0" expanded="true" />
334
-            <element signature="e#177#178#0" expanded="true" />
335
-          </folding>
336
-        </state>
337
-      </provider>
338
-    </entry>
339 378
     <entry file="file://$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/Person.java">
340 379
       <provider selected="true" editor-type-id="text-editor">
341 380
         <state relative-caret-position="164">
@@ -350,17 +389,33 @@
350 389
         </state>
351 390
       </provider>
352 391
     </entry>
392
+    <entry file="file://$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/Instructor.java">
393
+      <provider selected="true" editor-type-id="text-editor">
394
+        <state relative-caret-position="375">
395
+          <caret line="25" lean-forward="true" selection-start-line="25" selection-end-line="25" />
396
+          <folding>
397
+            <element signature="e#146#147#0" expanded="true" />
398
+            <element signature="e#177#178#0" expanded="true" />
399
+          </folding>
400
+        </state>
401
+      </provider>
402
+    </entry>
353 403
     <entry file="file://$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/Students.java">
354 404
       <provider selected="true" editor-type-id="text-editor">
355
-        <state relative-caret-position="45">
356
-          <caret line="3" lean-forward="true" selection-start-line="3" selection-end-line="3" />
405
+        <state relative-caret-position="195">
406
+          <caret line="13" lean-forward="true" selection-start-line="13" selection-end-line="13" />
407
+          <folding>
408
+            <element signature="imports" expanded="true" />
409
+            <element signature="e#219#220#0" expanded="true" />
410
+            <element signature="e#243#244#0" expanded="true" />
411
+          </folding>
357 412
         </state>
358 413
       </provider>
359 414
     </entry>
360 415
     <entry file="file://$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/People.java">
361 416
       <provider selected="true" editor-type-id="text-editor">
362
-        <state relative-caret-position="279">
363
-          <caret line="49" column="19" selection-start-line="49" selection-start-column="19" selection-end-line="49" selection-end-column="19" />
417
+        <state relative-caret-position="250">
418
+          <caret line="62" column="37" selection-start-line="62" selection-start-column="37" selection-end-line="62" selection-end-column="37" />
364 419
           <folding>
365 420
             <element signature="imports" expanded="true" />
366 421
             <element signature="e#318#319#0" expanded="true" />
@@ -375,9 +430,42 @@
375 430
             <element signature="e#680#681#0" expanded="true" />
376 431
             <element signature="e#707#708#0" expanded="true" />
377 432
             <element signature="e#741#742#0" expanded="true" />
433
+            <element signature="e#1121#1122#0" expanded="true" />
434
+            <element signature="e#1154#1155#0" expanded="true" />
435
+            <element signature="e#1350#1351#0" expanded="true" />
436
+            <element signature="e#1382#1383#0" expanded="true" />
378 437
           </folding>
379 438
         </state>
380 439
       </provider>
381 440
     </entry>
441
+    <entry file="file://$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/Instructors.java">
442
+      <provider selected="true" editor-type-id="text-editor">
443
+        <state relative-caret-position="135">
444
+          <caret line="9" lean-forward="true" selection-start-line="9" selection-end-line="9" />
445
+          <folding>
446
+            <element signature="e#176#177#0" expanded="true" />
447
+            <element signature="e#196#197#0" expanded="true" />
448
+          </folding>
449
+        </state>
450
+      </provider>
451
+    </entry>
452
+    <entry file="file://$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/Classroom.java">
453
+      <provider selected="true" editor-type-id="text-editor">
454
+        <state relative-caret-position="232">
455
+          <caret line="16" column="49" lean-forward="true" selection-start-line="16" selection-start-column="49" selection-end-line="16" selection-end-column="49" />
456
+          <folding>
457
+            <element signature="e#366#367#0" expanded="true" />
458
+            <element signature="e#399#400#0" expanded="true" />
459
+          </folding>
460
+        </state>
461
+      </provider>
462
+    </entry>
463
+    <entry file="file://$PROJECT_DIR$/main/java/com/zipcode/wilmington/beanjawn/StudentConfig.java">
464
+      <provider selected="true" editor-type-id="text-editor">
465
+        <state relative-caret-position="120">
466
+          <caret line="8" column="8" lean-forward="true" selection-start-line="8" selection-start-column="8" selection-end-line="8" selection-end-column="8" />
467
+        </state>
468
+      </provider>
469
+    </entry>
382 470
   </component>
383 471
 </project>

+ 19
- 0
src/main/java/com/zipcode/wilmington/beanjawn/Classroom.java 파일 보기

@@ -0,0 +1,19 @@
1
+package com.zipcode.wilmington.beanjawn;
2
+
3
+public class Classroom {
4
+
5
+    Students students;
6
+    Instructors instrustors;
7
+
8
+    public Classroom() {
9
+    }
10
+
11
+    public Classroom(Instructors instructors, Students students){
12
+        this.instrustors = instructors;
13
+        this.students = students;
14
+    }
15
+
16
+    public void hostLecture(Teacher teacher, double numberOfHours){
17
+        teacher.lecture(students, numberOfHours);
18
+    }
19
+}

+ 11
- 0
src/main/java/com/zipcode/wilmington/beanjawn/Instructors.java 파일 보기

@@ -0,0 +1,11 @@
1
+package com.zipcode.wilmington.beanjawn;
2
+
3
+import java.util.Iterator;
4
+
5
+public class Instructors extends People<Instructor> {
6
+
7
+    public Instructors(Instructor ... instructors) {
8
+        super(instructors);
9
+    }
10
+
11
+}

+ 4
- 0
src/main/java/com/zipcode/wilmington/beanjawn/InstructorsConfig.java 파일 보기

@@ -0,0 +1,4 @@
1
+package com.zipcode.wilmington.beanjawn;
2
+
3
+public class InstructorsConfig {
4
+}

+ 15
- 7
src/main/java/com/zipcode/wilmington/beanjawn/People.java 파일 보기

@@ -1,6 +1,7 @@
1 1
 package com.zipcode.wilmington.beanjawn;
2 2
 
3 3
 import java.util.ArrayList;
4
+import java.util.Arrays;
4 5
 import java.util.Iterator;
5 6
 import java.util.List;
6 7
 import java.util.stream.StreamSupport;
@@ -10,24 +11,24 @@ public abstract class People<PersonType extends Person> implements Iterable<Pers
10 11
     private ArrayList<PersonType> personList;
11 12
 
12 13
     public People() {
13
-        this.personList = new ArrayList<>();
14
+        personList = new ArrayList<>();
14 15
     }
15 16
 
16 17
 
17
-    public People(ArrayList<PersonType> ptList) {
18
-        this.personList = ptList;
18
+    public People(PersonType...p) {
19
+        this.personList = new ArrayList<>(Arrays.asList(p));
19 20
     }
20 21
 
21 22
     public void add(PersonType pt) {
22
-        personList.add(pt);
23
+        this.personList.add(pt);
23 24
     }
24 25
 
25 26
     public void remove(PersonType pt) {
26
-        personList.remove(pt);
27
+        this.personList.remove(pt);
27 28
     }
28 29
 
29 30
     public Integer size() {
30
-        return personList.size();
31
+        return this.personList.size();
31 32
     }
32 33
 
33 34
     public void clear() {
@@ -35,7 +36,10 @@ public abstract class People<PersonType extends Person> implements Iterable<Pers
35 36
     }
36 37
 
37 38
     public void addAll(Iterable<PersonType> ptIterable) {
38
-        ptIterable.forEach(personList::add);
39
+        //ptIterable.forEach(personList::add);
40
+        for (PersonType p: ptIterable){
41
+            this.personList.add(p);
42
+        }
39 43
 
40 44
 
41 45
     }
@@ -54,5 +58,9 @@ public abstract class People<PersonType extends Person> implements Iterable<Pers
54 58
         return this.personList;
55 59
     }
56 60
 
61
+    @Override
62
+    public Iterator<PersonType> iterator(){
63
+        return personList.iterator();
64
+    }
57 65
 
58 66
 }

+ 18
- 0
src/main/java/com/zipcode/wilmington/beanjawn/StudentConfig.java 파일 보기

@@ -0,0 +1,18 @@
1
+package com.zipcode.wilmington.beanjawn;
2
+
3
+import org.springframework.context.annotation.Bean;
4
+
5
+public class StudentConfig {
6
+
7
+    @Bean(name = "students")
8
+    public Students currentStudents(){
9
+        return new Students();
10
+
11
+    }
12
+
13
+    @Bean(name = "previousStudents")
14
+    public Students previousStudents(){
15
+        return new Students();
16
+
17
+    }
18
+}

+ 9
- 1
src/main/java/com/zipcode/wilmington/beanjawn/Students.java 파일 보기

@@ -1,5 +1,13 @@
1 1
 package com.zipcode.wilmington.beanjawn;
2 2
 
3
-public class Students extends People {
3
+import java.util.Iterator;
4
+import java.util.Spliterator;
5
+import java.util.function.Consumer;
6
+
7
+public class Students extends People<Student> {
8
+
9
+    public Students(Student... students) {
10
+        super(students);
11
+    }
4 12
 
5 13
 }