Leon 7 years ago
parent
commit
56cbcce3df

+ 65
- 34
.idea/workspace.xml View File

@@ -2,7 +2,8 @@
2 2
 <project version="4">
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="30b7e4a0-b899-49c3-865c-0311dfadae62" name="Default" comment="">
5
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/tools/DateUtils.java" afterPath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/tools/DateUtils.java" />
5
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonWarehouse.java" afterPath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonWarehouse.java" />
6
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/streams/conversions/TestConversionAgent.java" afterPath="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/streams/conversions/TestConversionAgent.java" />
6 7
     </list>
7 8
     <ignored path="$PROJECT_DIR$/out/" />
8 9
     <ignored path="$PROJECT_DIR$/target/" />
@@ -27,21 +28,21 @@
27 28
           </provider>
28 29
         </entry>
29 30
       </file>
30
-      <file leaf-file-name="StringUtils.java" pinned="false" current-in-tab="false">
31
-        <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/tools/StringUtils.java">
31
+      <file leaf-file-name="PersonWarehouse.java" pinned="false" current-in-tab="false">
32
+        <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonWarehouse.java">
32 33
           <provider selected="true" editor-type-id="text-editor">
33
-            <state relative-caret-position="272">
34
-              <caret line="28" column="0" lean-forward="true" selection-start-line="28" selection-start-column="0" selection-end-line="28" selection-end-column="0" />
34
+            <state relative-caret-position="414">
35
+              <caret line="36" column="32" lean-forward="true" selection-start-line="36" selection-start-column="32" selection-end-line="36" selection-end-column="32" />
35 36
               <folding />
36 37
             </state>
37 38
           </provider>
38 39
         </entry>
39 40
       </file>
40
-      <file leaf-file-name="PersonWarehouse.java" pinned="false" current-in-tab="true">
41
-        <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonWarehouse.java">
41
+      <file leaf-file-name="TestConversionAgent.java" pinned="false" current-in-tab="true">
42
+        <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcodewilmington/streams/conversions/TestConversionAgent.java">
42 43
           <provider selected="true" editor-type-id="text-editor">
43
-            <state relative-caret-position="945">
44
-              <caret line="72" column="15" lean-forward="true" selection-start-line="72" selection-start-column="15" selection-end-line="72" selection-end-column="15" />
44
+            <state relative-caret-position="272">
45
+              <caret line="28" column="55" lean-forward="true" selection-start-line="28" selection-start-column="55" selection-end-line="28" selection-end-column="55" />
45 46
               <folding />
46 47
             </state>
47 48
           </provider>
@@ -198,7 +199,6 @@
198 199
         <option value="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/streams/TestStreamMap.java" />
199 200
         <option value="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/streams/TestSuiteFullRegression.java" />
200 201
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/tools/logging/LoggerWarehouse.java" />
201
-        <option value="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/streams/conversions/TestConversionAgent.java" />
202 202
         <option value="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/streams/TestConstants.java" />
203 203
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/tools/logging/LoggerHandler.java" />
204 204
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/StreamMap.java" />
@@ -211,13 +211,14 @@
211 211
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/Person.java" />
212 212
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonFactory.java" />
213 213
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/tools/StringUtils.java" />
214
-        <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonWarehouse.java" />
215 214
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/ArrayConverter.java" />
216 215
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/ListConverter.java" />
217 216
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/StreamConverter.java" />
218 217
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/PersonConversionAgent.java" />
219 218
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/ConversionAgent.java" />
220 219
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/tools/DateUtils.java" />
220
+        <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonWarehouse.java" />
221
+        <option value="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/streams/conversions/TestConversionAgent.java" />
221 222
       </list>
222 223
     </option>
223 224
   </component>
@@ -324,6 +325,36 @@
324 325
               <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
325 326
             </PATH_ELEMENT>
326 327
             <PATH_ELEMENT>
328
+              <option name="myItemId" value="conversions" />
329
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
330
+            </PATH_ELEMENT>
331
+          </PATH>
332
+          <PATH>
333
+            <PATH_ELEMENT>
334
+              <option name="myItemId" value="looptest" />
335
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
336
+            </PATH_ELEMENT>
337
+            <PATH_ELEMENT>
338
+              <option name="myItemId" value="looptest" />
339
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
340
+            </PATH_ELEMENT>
341
+            <PATH_ELEMENT>
342
+              <option name="myItemId" value="src" />
343
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
344
+            </PATH_ELEMENT>
345
+            <PATH_ELEMENT>
346
+              <option name="myItemId" value="test" />
347
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
348
+            </PATH_ELEMENT>
349
+            <PATH_ELEMENT>
350
+              <option name="myItemId" value="java" />
351
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
352
+            </PATH_ELEMENT>
353
+            <PATH_ELEMENT>
354
+              <option name="myItemId" value="streams" />
355
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
356
+            </PATH_ELEMENT>
357
+            <PATH_ELEMENT>
327 358
               <option name="myItemId" value="anthropoid" />
328 359
               <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
329 360
             </PATH_ELEMENT>
@@ -910,7 +941,7 @@
910 941
       <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
911 942
       <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3277849" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
912 943
       <window_info id="Nl-Palette" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
913
-      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32866243" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
944
+      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32778355" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
914 945
       <window_info id="Palette&#9;" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
915 946
       <window_info id="Image Layers" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
916 947
       <window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
@@ -919,7 +950,7 @@
919 950
       <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
920 951
       <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3149808" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
921 952
       <window_info id="Properties" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
922
-      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.264308" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
953
+      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.264308" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
923 954
       <window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
924 955
       <window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
925 956
       <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.17944622" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
@@ -1077,14 +1108,6 @@
1077 1108
         </state>
1078 1109
       </provider>
1079 1110
     </entry>
1080
-    <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcodewilmington/streams/conversions/TestConversionAgent.java">
1081
-      <provider selected="true" editor-type-id="text-editor">
1082
-        <state relative-caret-position="0">
1083
-          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
1084
-          <folding />
1085
-        </state>
1086
-      </provider>
1087
-    </entry>
1088 1111
     <entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/src.zip!/java/time/LocalDate.java">
1089 1112
       <provider selected="true" editor-type-id="text-editor">
1090 1113
         <state relative-caret-position="415">
@@ -1255,17 +1278,6 @@
1255 1278
         </state>
1256 1279
       </provider>
1257 1280
     </entry>
1258
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/PersonConversionAgent.java">
1259
-      <provider selected="true" editor-type-id="text-editor">
1260
-        <state relative-caret-position="135">
1261
-          <caret line="9" column="22" lean-forward="false" selection-start-line="9" selection-start-column="22" selection-end-line="9" selection-end-column="22" />
1262
-          <folding>
1263
-            <element signature="e#504#505#0" expanded="true" />
1264
-            <element signature="e#547#548#0" expanded="true" />
1265
-          </folding>
1266
-        </state>
1267
-      </provider>
1268
-    </entry>
1269 1281
     <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/StreamConverter.java">
1270 1282
       <provider selected="true" editor-type-id="text-editor">
1271 1283
         <state relative-caret-position="165">
@@ -1312,8 +1324,27 @@
1312 1324
     </entry>
1313 1325
     <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonWarehouse.java">
1314 1326
       <provider selected="true" editor-type-id="text-editor">
1315
-        <state relative-caret-position="945">
1316
-          <caret line="72" column="15" lean-forward="true" selection-start-line="72" selection-start-column="15" selection-end-line="72" selection-end-column="15" />
1327
+        <state relative-caret-position="414">
1328
+          <caret line="36" column="32" lean-forward="true" selection-start-line="36" selection-start-column="32" selection-end-line="36" selection-end-column="32" />
1329
+          <folding />
1330
+        </state>
1331
+      </provider>
1332
+    </entry>
1333
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/PersonConversionAgent.java">
1334
+      <provider selected="true" editor-type-id="text-editor">
1335
+        <state relative-caret-position="135">
1336
+          <caret line="9" column="22" lean-forward="false" selection-start-line="9" selection-start-column="22" selection-end-line="9" selection-end-column="22" />
1337
+          <folding>
1338
+            <element signature="e#504#505#0" expanded="true" />
1339
+            <element signature="e#547#548#0" expanded="true" />
1340
+          </folding>
1341
+        </state>
1342
+      </provider>
1343
+    </entry>
1344
+    <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcodewilmington/streams/conversions/TestConversionAgent.java">
1345
+      <provider selected="true" editor-type-id="text-editor">
1346
+        <state relative-caret-position="272">
1347
+          <caret line="28" column="55" lean-forward="true" selection-start-line="28" selection-start-column="55" selection-end-line="28" selection-end-column="55" />
1317 1348
           <folding />
1318 1349
         </state>
1319 1350
       </provider>

+ 4
- 3
src/main/java/com/zipcodewilmington/streams/anthropoid/PersonWarehouse.java View File

@@ -5,6 +5,7 @@ import com.zipcodewilmington.streams.tools.logging.LoggerHandler;
5 5
 import com.zipcodewilmington.streams.tools.logging.LoggerWarehouse;
6 6
 
7 7
 import java.util.ArrayList;
8
+import java.util.List;
8 9
 import java.util.Map;
9 10
 import java.util.stream.Collectors;
10 11
 import java.util.stream.Stream;
@@ -12,6 +13,7 @@ import java.util.stream.Stream;
12 13
 /**
13 14
  * Created by leon on 5/29/17.
14 15
  * The warehouse is responsible for storing, retrieving, and filtering personSequence
16
+ *
15 17
  * @ATTENTION_TO_STUDENTS You are FORBIDDEN from using loops of any sort within the definition of this class.
16 18
  */
17 19
 public class PersonWarehouse {
@@ -29,9 +31,8 @@ public class PersonWarehouse {
29 31
      * @return list of uniquely named Person objects
30 32
      */ //TODO
31 33
     public static Stream<Person> getUniquelyNamedPeople() {
32
-        ArrayList<String> names = new ArrayList<>();
33
-        return people.parallelStream().filter(
34
-                person -> !names.contains(person.getName()));
34
+        List<String> names = people.parallelStream().map(p -> p.getName()).collect(Collectors.toList());
35
+        return people.parallelStream().filter(person -> !names.contains(person.getName()));
35 36
     }
36 37
 
37 38
     /**

+ 1
- 1
src/test/java/com/zipcodewilmington/streams/conversions/TestConversionAgent.java View File

@@ -13,7 +13,7 @@ import java.util.stream.Stream;
13 13
  * Created by leon on 5/25/17.
14 14
  * @ATTENTION_TO_STUDENTS You are FORBIDDEN from modifying this class
15 15
  */
16
-public class TestConversionAgent<T extends ConversionAgent> {
16
+public class TestConversionAgent<T extends PersonConversionAgent<Person>> {
17 17
     private final T conversionAgent;
18 18
 
19 19
     private List<Person> personList;

+ 123072
- 123072
target/PersonWarehouse.leonlog
File diff suppressed because it is too large
View File


BIN
target/classes/com/zipcodewilmington/streams/anthropoid/Person.class View File


BIN
target/classes/com/zipcodewilmington/streams/anthropoid/PersonFactory.class View File


BIN
target/classes/com/zipcodewilmington/streams/anthropoid/PersonWarehouse.class View File


BIN
target/classes/com/zipcodewilmington/streams/conversions/ArrayConverter.class View File


BIN
target/classes/com/zipcodewilmington/streams/conversions/ConversionAgent.class View File


BIN
target/classes/com/zipcodewilmington/streams/conversions/ListConverter.class View File


BIN
target/classes/com/zipcodewilmington/streams/conversions/PersonConversionAgent.class View File


BIN
target/classes/com/zipcodewilmington/streams/conversions/StreamConverter.class View File


BIN
target/classes/com/zipcodewilmington/streams/tools/DateUtils.class View File


+ 1
- 1
target/global.leonlog View File

@@ -1,2 +1,2 @@
1
-May 31, 2017 7:13:01 AM com.zipcodewilmington.streams.tools.logging.LoggerHandler log
1
+May 31, 2017 1:35:31 PM com.zipcodewilmington.streams.tools.logging.LoggerHandler log
2 2
 INFO: Instantiating logger for [ com.zipcodewilmington.streams.anthropoid.PersonWarehouse ] ... 

BIN
target/test-classes/com/zipcodewilmington/streams/conversions/TestConversionAgent.class View File


BIN
target/test-classes/com/zipcodewilmington/streams/conversions/TestConverterArray.class View File


BIN
target/test-classes/com/zipcodewilmington/streams/conversions/TestConverterList.class View File


BIN
target/test-classes/com/zipcodewilmington/streams/conversions/TestConverterStream.class View File