Browse Source

MyArrayList - Complete

Nick Satinover 6 years ago
parent
commit
a58a5d0762
4 changed files with 186 additions and 202 deletions
  1. 150
    157
      .idea/workspace.xml
  2. 1
    1
      src/main/java/MyArrayList.java
  3. 34
    43
      src/main/java/MySet.java
  4. 1
    1
      src/test/java/MySetTest.java

+ 150
- 157
.idea/workspace.xml View File

@@ -3,10 +3,8 @@
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="6eefb94a-8003-4639-a54f-0d11804b5db5" name="Default Changelist" comment="">
5 5
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
6
-      <change beforePath="$PROJECT_DIR$/src/main/java/.deleteme" beforeDir="false" />
7 6
       <change beforePath="$PROJECT_DIR$/src/main/java/MyArrayList.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/MyArrayList.java" afterDir="false" />
8 7
       <change beforePath="$PROJECT_DIR$/src/main/java/MySet.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/MySet.java" afterDir="false" />
9
-      <change beforePath="$PROJECT_DIR$/src/test/java/.deleteme" beforeDir="false" />
10 8
       <change beforePath="$PROJECT_DIR$/src/test/java/MySetTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/MySetTest.java" afterDir="false" />
11 9
     </list>
12 10
     <ignored path="$PROJECT_DIR$/target/" />
@@ -17,13 +15,13 @@
17 15
     <option name="LAST_RESOLUTION" value="IGNORE" />
18 16
   </component>
19 17
   <component name="CoverageDataManager">
20
-    <SUITE FILE_PATH="coverage/generics$MySetTest.ic" NAME="MySetTest Coverage Results" MODIFIED="1542306502632" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
21
-    <SUITE FILE_PATH="coverage/generics$All_in_generics.ic" NAME="All in generics Coverage Results" MODIFIED="1542391002111" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
18
+    <SUITE FILE_PATH="coverage/generics$MySetTest.ic" NAME="MySetTest Coverage Results" MODIFIED="1542394875742" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
19
+    <SUITE FILE_PATH="coverage/generics$All_in_generics.ic" NAME="All in generics Coverage Results" MODIFIED="1542394916012" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
22 20
     <SUITE FILE_PATH="coverage/generics$MyArrayListTest.ic" NAME="MyArrayListTest Coverage Results" MODIFIED="1542228761533" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
23 21
     <SUITE FILE_PATH="coverage/generics$MySetTest_toArrayStringTest.ic" NAME="MySetTest.toArrayStringTest Coverage Results" MODIFIED="1542391314888" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
24 22
   </component>
25 23
   <component name="CoverageViewManager">
26
-    <option name="myElementSize" value="324" />
24
+    <option name="myElementSize" value="221" />
27 25
   </component>
28 26
   <component name="FUSProjectUsageTrigger">
29 27
     <session id="914426633">
@@ -40,7 +38,7 @@
40 38
         <counts>
41 39
           <entry key="class" value="20" />
42 40
           <entry key="iml" value="2" />
43
-          <entry key="java" value="29" />
41
+          <entry key="java" value="30" />
44 42
           <entry key="snippet" value="1" />
45 43
           <entry key="xml" value="1" />
46 44
         </counts>
@@ -49,22 +47,22 @@
49 47
         <counts>
50 48
           <entry key="CLASS" value="20" />
51 49
           <entry key="IDEA_MODULE" value="2" />
52
-          <entry key="JAVA" value="29" />
50
+          <entry key="JAVA" value="30" />
53 51
           <entry key="Scratch" value="1" />
54 52
           <entry key="XML" value="1" />
55 53
         </counts>
56 54
       </usages-collector>
57 55
       <usages-collector id="statistics.file.extensions.edit">
58 56
         <counts>
59
-          <entry key="java" value="3563" />
60
-          <entry key="txt" value="134" />
57
+          <entry key="java" value="3600" />
58
+          <entry key="txt" value="168" />
61 59
           <entry key="xml" value="2" />
62 60
         </counts>
63 61
       </usages-collector>
64 62
       <usages-collector id="statistics.file.types.edit">
65 63
         <counts>
66
-          <entry key="JAVA" value="3563" />
67
-          <entry key="PLAIN_TEXT" value="134" />
64
+          <entry key="JAVA" value="3600" />
65
+          <entry key="PLAIN_TEXT" value="168" />
68 66
           <entry key="XML" value="2" />
69 67
         </counts>
70 68
       </usages-collector>
@@ -77,22 +75,22 @@
77 75
           <file pinned="false" current-in-tab="true">
78 76
             <entry file="file://$PROJECT_DIR$/src/main/java/MySet.java">
79 77
               <provider selected="true" editor-type-id="text-editor">
80
-                <state relative-caret-position="306">
81
-                  <caret line="22" column="19" selection-start-line="22" selection-start-column="16" selection-end-line="22" selection-end-column="19" />
78
+                <state relative-caret-position="212">
79
+                  <caret line="82" column="11" lean-forward="true" selection-start-line="82" selection-start-column="11" selection-end-line="82" selection-end-column="11" />
82 80
                   <folding>
83 81
                     <element signature="imports" expanded="true" />
84
-                    <element signature="e#244#245#0" expanded="true" />
82
+                    <element signature="e#242#243#0" expanded="true" />
85 83
                     <element signature="e#286#287#0" expanded="true" />
86 84
                     <element signature="e#310#311#0" expanded="true" />
87
-                    <element signature="e#348#349#0" expanded="true" />
88
-                    <element signature="e#411#412#0" expanded="true" />
89
-                    <element signature="e#448#449#0" expanded="true" />
90
-                    <element signature="e#1104#1105#0" expanded="true" />
91
-                    <element signature="e#1169#1170#0" expanded="true" />
92
-                    <element signature="e#1222#1223#0" expanded="true" />
93
-                    <element signature="e#1280#1281#0" expanded="true" />
94
-                    <element signature="e#5055#5056#0" expanded="true" />
95
-                    <element signature="e#5092#5093#0" expanded="true" />
85
+                    <element signature="e#350#351#0" expanded="true" />
86
+                    <element signature="e#1249#1250#0" expanded="true" />
87
+                    <element signature="e#1316#1317#0" expanded="true" />
88
+                    <element signature="e#1369#1370#0" expanded="true" />
89
+                    <element signature="e#1429#1430#0" expanded="true" />
90
+                    <element signature="e#1531#1532#0" expanded="true" />
91
+                    <element signature="e#1566#1567#0" expanded="true" />
92
+                    <element signature="e#5170#5171#0" expanded="true" />
93
+                    <element signature="e#5207#5208#0" expanded="true" />
96 94
                   </folding>
97 95
                 </state>
98 96
               </provider>
@@ -107,52 +105,50 @@
107 105
               </provider>
108 106
             </entry>
109 107
           </file>
110
-        </leaf>
111
-      </split-first>
112
-      <split-second>
113
-        <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
114 108
           <file pinned="false" current-in-tab="false">
115
-            <entry file="file://$PROJECT_DIR$/src/test/java/MySetTest.java">
109
+            <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
116 110
               <provider selected="true" editor-type-id="text-editor">
117
-                <state relative-caret-position="338">
118
-                  <caret line="79" column="28" selection-start-line="79" selection-start-column="28" selection-end-line="79" selection-end-column="28" />
111
+                <state relative-caret-position="45">
112
+                  <caret line="3" column="21" selection-start-line="3" selection-end-line="4" />
119 113
                   <folding>
120
-                    <element signature="imports" expanded="true" />
121
-                    <element signature="e#1474#1480#0" expanded="true" />
122
-                    <element signature="e#1815#1823#0" expanded="true" />
123
-                    <element signature="e#2182#2190#0" expanded="true" />
124
-                    <element signature="e#2583#2591#0" expanded="true" />
125
-                    <element signature="e#2969#2977#0" expanded="true" />
126
-                    <element signature="e#3343#3349#0" expanded="true" />
127
-                    <element signature="e#4161#4167#0" expanded="true" />
128
-                    <element signature="e#4305#4313#0" expanded="true" />
129
-                    <element signature="e#4764#4772#0" expanded="true" />
130
-                    <element signature="e#5216#5224#0" expanded="true" />
131
-                    <element signature="e#5842#5848#0" expanded="true" />
132
-                    <element signature="e#6095#6101#0" expanded="true" />
133
-                    <element signature="e#6641#6647#0" expanded="true" />
134
-                    <element signature="e#7059#7065#0" expanded="true" />
135
-                    <element signature="e#7536#7544#0" expanded="true" />
136
-                    <element signature="e#8053#8061#0" expanded="true" />
137
-                    <element signature="e#8540#8548#0" expanded="true" />
114
+                    <element signature="e#295#296#0" expanded="true" />
115
+                    <element signature="e#339#340#0" expanded="true" />
116
+                    <element signature="method#add#1;class#MyArrayList#0" />
117
+                    <element signature="method#isEmpty#0;class#MyArrayList#0" />
118
+                    <element signature="method#contains#0;class#MyArrayList#0" />
138 119
                   </folding>
139 120
                 </state>
140 121
               </provider>
141 122
             </entry>
142 123
           </file>
124
+        </leaf>
125
+      </split-first>
126
+      <split-second>
127
+        <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
143 128
           <file pinned="false" current-in-tab="true">
144
-            <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
129
+            <entry file="file://$PROJECT_DIR$/src/test/java/MySetTest.java">
145 130
               <provider selected="true" editor-type-id="text-editor">
146
-                <state relative-caret-position="225">
147
-                  <caret line="17" column="20" selection-start-line="17" selection-start-column="20" selection-end-line="17" selection-end-column="20" />
131
+                <state relative-caret-position="233">
132
+                  <caret line="80" column="30" selection-start-line="80" selection-start-column="23" selection-end-line="80" selection-end-column="30" />
148 133
                   <folding>
149
-                    <element signature="e#151#152#0" expanded="true" />
150
-                    <element signature="e#197#198#0" expanded="true" />
151
-                    <element signature="e#293#294#0" expanded="true" />
152
-                    <element signature="e#337#338#0" expanded="true" />
153
-                    <element signature="method#add#1;class#MyArrayList#0" />
154
-                    <element signature="method#isEmpty#0;class#MyArrayList#0" />
155
-                    <element signature="method#contains#0;class#MyArrayList#0" />
134
+                    <element signature="imports" expanded="true" />
135
+                    <element signature="e#1474#1480#0" expanded="true" />
136
+                    <element signature="e#1872#1880#0" expanded="true" />
137
+                    <element signature="e#2245#2253#0" expanded="true" />
138
+                    <element signature="e#2653#2661#0" expanded="true" />
139
+                    <element signature="e#3036#3044#0" expanded="true" />
140
+                    <element signature="e#3616#3622#0" expanded="true" />
141
+                    <element signature="e#4158#4164#0" expanded="true" />
142
+                    <element signature="e#4812#4820#0" expanded="true" />
143
+                    <element signature="e#5255#5263#0" expanded="true" />
144
+                    <element signature="e#5704#5712#0" expanded="true" />
145
+                    <element signature="e#6242#6248#0" expanded="true" />
146
+                    <element signature="e#6630#6636#0" expanded="true" />
147
+                    <element signature="e#7104#7110#0" expanded="true" />
148
+                    <element signature="e#7595#7601#0" expanded="true" />
149
+                    <element signature="e#8079#8087#0" expanded="true" />
150
+                    <element signature="e#8588#8596#0" expanded="true" />
151
+                    <element signature="e#9077#9085#0" expanded="true" />
156 152
                   </folding>
157 153
                 </state>
158 154
               </provider>
@@ -179,8 +175,12 @@
179 175
       <find>retainAll</find>
180 176
       <find>containsAll</find>
181 177
       <find>toA</find>
178
+      <find>this.generic</find>
182 179
       <find>toArray</find>
183 180
     </findStrings>
181
+    <replaceStrings>
182
+      <replace>super.generic</replace>
183
+    </replaceStrings>
184 184
   </component>
185 185
   <component name="Git.Settings">
186 186
     <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
@@ -191,8 +191,8 @@
191 191
         <option value="$PROJECT_DIR$/src/main/java/ReadThenDelete.java" />
192 192
         <option value="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" />
193 193
         <option value="$PROJECT_DIR$/pom.xml" />
194
-        <option value="$PROJECT_DIR$/src/test/java/MySetTest.java" />
195 194
         <option value="$PROJECT_DIR$/src/main/java/MyArrayList.java" />
195
+        <option value="$PROJECT_DIR$/src/test/java/MySetTest.java" />
196 196
         <option value="$PROJECT_DIR$/src/main/java/MySet.java" />
197 197
       </list>
198 198
     </option>
@@ -211,10 +211,9 @@
211 211
     </option>
212 212
   </component>
213 213
   <component name="ProjectFrameBounds" extendedState="6">
214
-    <option name="x" value="-309" />
215
-    <option name="y" value="-1057" />
216
-    <option name="width" value="1920" />
217
-    <option name="height" value="1057" />
214
+    <option name="y" value="23" />
215
+    <option name="width" value="1280" />
216
+    <option name="height" value="709" />
218 217
   </component>
219 218
   <component name="ProjectLevelVcsManager" settingsEditedManually="true">
220 219
     <ConfirmationsSetting value="2" id="Add" />
@@ -273,7 +272,7 @@
273 272
   <component name="PropertiesComponent">
274 273
     <property name="WebServerToolWindowFactoryState" value="false" />
275 274
     <property name="aspect.path.notification.shown" value="true" />
276
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1542393662901" />
275
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1542395059432" />
277 276
     <property name="last_opened_file_path" value="$PROJECT_DIR$/pom.xml" />
278 277
     <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
279 278
     <property name="nodejs_npm_path_reset_for_default_project" value="true" />
@@ -291,7 +290,7 @@
291 290
       </list>
292 291
     </option>
293 292
   </component>
294
-  <component name="RunManager" selected="JUnit.MySetTest.toArrayObjectTest">
293
+  <component name="RunManager" selected="JUnit.All in generics">
295 294
     <configuration default="true" type="Application" factoryName="Application" show_console_on_std_err="true" show_console_on_std_out="true">
296 295
       <method v="2">
297 296
         <option name="Make" enabled="true" />
@@ -305,21 +304,19 @@
305 304
         <option name="Make" enabled="true" />
306 305
       </method>
307 306
     </configuration>
308
-    <configuration name="MySetTest.containsAllLongBooleanTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
307
+    <configuration name="MySetTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
309 308
       <module name="generics" />
310 309
       <option name="PACKAGE_NAME" value="" />
311 310
       <option name="MAIN_CLASS_NAME" value="MySetTest" />
312
-      <option name="METHOD_NAME" value="containsAllLongBooleanTest" />
313
-      <option name="TEST_OBJECT" value="method" />
314 311
       <method v="2">
315 312
         <option name="Make" enabled="true" />
316 313
       </method>
317 314
     </configuration>
318
-    <configuration name="MySetTest.retainAllStringBooleanTest1" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
315
+    <configuration name="MySetTest.removeStringTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
319 316
       <module name="generics" />
320 317
       <option name="PACKAGE_NAME" value="" />
321 318
       <option name="MAIN_CLASS_NAME" value="MySetTest" />
322
-      <option name="METHOD_NAME" value="retainAllStringBooleanTest1" />
319
+      <option name="METHOD_NAME" value="removeStringTest" />
323 320
       <option name="TEST_OBJECT" value="method" />
324 321
       <method v="2">
325 322
         <option name="Make" enabled="true" />
@@ -369,19 +366,19 @@
369 366
       <method v="2" />
370 367
     </configuration>
371 368
     <list>
372
-      <item itemvalue="JUnit.MySetTest.retainAllStringBooleanTest1" />
373
-      <item itemvalue="JUnit.MySetTest.containsAllLongBooleanTest" />
374 369
       <item itemvalue="JUnit.All in generics" />
375 370
       <item itemvalue="JUnit.MySetTest.toArrayStringTest" />
376 371
       <item itemvalue="JUnit.MySetTest.toArrayObjectTest" />
372
+      <item itemvalue="JUnit.MySetTest" />
373
+      <item itemvalue="JUnit.MySetTest.removeStringTest" />
377 374
     </list>
378 375
     <recent_temporary>
379 376
       <list>
377
+        <item itemvalue="JUnit.All in generics" />
378
+        <item itemvalue="JUnit.MySetTest" />
380 379
         <item itemvalue="JUnit.MySetTest.toArrayObjectTest" />
380
+        <item itemvalue="JUnit.MySetTest.removeStringTest" />
381 381
         <item itemvalue="JUnit.MySetTest.toArrayStringTest" />
382
-        <item itemvalue="JUnit.All in generics" />
383
-        <item itemvalue="JUnit.MySetTest.containsAllLongBooleanTest" />
384
-        <item itemvalue="JUnit.MySetTest.retainAllStringBooleanTest1" />
385 382
       </list>
386 383
     </recent_temporary>
387 384
   </component>
@@ -399,7 +396,7 @@
399 396
       <workItem from="1542145228816" duration="418000" />
400 397
       <workItem from="1542165623771" duration="4833000" />
401 398
       <workItem from="1542225031291" duration="12159000" />
402
-      <workItem from="1542293882069" duration="25706000" />
399
+      <workItem from="1542293882069" duration="27205000" />
403 400
     </task>
404 401
     <task id="LOCAL-00001" summary="MyArrayList&#10;Get, Add">
405 402
       <created>1542167642899</created>
@@ -499,43 +496,50 @@
499 496
       <option name="project" value="LOCAL" />
500 497
       <updated>1542390949972</updated>
501 498
     </task>
502
-    <option name="localTasksCounter" value="15" />
499
+    <task id="LOCAL-00015" summary="MyArrayList - Complete&#10;MySet - working set&#10;Changing name to array">
500
+      <created>1542393826034</created>
501
+      <option name="number" value="00015" />
502
+      <option name="presentableId" value="LOCAL-00015" />
503
+      <option name="project" value="LOCAL" />
504
+      <updated>1542393826034</updated>
505
+    </task>
506
+    <option name="localTasksCounter" value="16" />
503 507
     <servers />
504 508
   </component>
505 509
   <component name="TestHistory">
506
-    <history-entry file="MySetTest_retainAllStringBooleanTest - 2018.11.16 at 12h 49m 25s.xml">
507
-      <configuration name="MySetTest.retainAllStringBooleanTest" configurationId="JUnit" />
508
-    </history-entry>
509
-    <history-entry file="MySetTest_retainAllStringBooleanTest - 2018.11.16 at 12h 49m 52s.xml">
510
-      <configuration name="MySetTest.retainAllStringBooleanTest" configurationId="JUnit" />
510
+    <history-entry file="MySetTest_toArrayObjectTest - 2018.11.16 at 13h 47m 25s.xml">
511
+      <configuration name="MySetTest.toArrayObjectTest" configurationId="JUnit" />
511 512
     </history-entry>
512
-    <history-entry file="MySetTest_retainAllStringBooleanTest1 - 2018.11.16 at 12h 50m 16s.xml">
513
-      <configuration name="MySetTest.retainAllStringBooleanTest1" configurationId="JUnit" />
513
+    <history-entry file="MySetTest - 2018.11.16 at 13h 50m 07s.xml">
514
+      <configuration name="MySetTest" configurationId="JUnit" />
514 515
     </history-entry>
515
-    <history-entry file="MySetTest_retainAllStringBooleanTest1 - 2018.11.16 at 12h 50m 24s.xml">
516
-      <configuration name="MySetTest.retainAllStringBooleanTest1" configurationId="JUnit" />
516
+    <history-entry file="MySetTest - 2018.11.16 at 13h 57m 43s.xml">
517
+      <configuration name="MySetTest" configurationId="JUnit" />
517 518
     </history-entry>
518
-    <history-entry file="MySetTest_containsAllLongBooleanTest - 2018.11.16 at 12h 54m 59s.xml">
519
-      <configuration name="MySetTest.containsAllLongBooleanTest" configurationId="JUnit" />
519
+    <history-entry file="MySetTest_toArrayObjectTest - 2018.11.16 at 13h 58m 46s.xml">
520
+      <configuration name="MySetTest.toArrayObjectTest" configurationId="JUnit" />
520 521
     </history-entry>
521
-    <history-entry file="MySetTest_containsAllLongBooleanTest - 2018.11.16 at 12h 55m 07s.xml">
522
-      <configuration name="MySetTest.containsAllLongBooleanTest" configurationId="JUnit" />
522
+    <history-entry file="MySetTest - 2018.11.16 at 13h 58m 53s.xml">
523
+      <configuration name="MySetTest" configurationId="JUnit" />
523 524
     </history-entry>
524
-    <history-entry file="All_in_generics - 2018.11.16 at 12h 56m 45s.xml">
525
+    <history-entry file="All_in_generics - 2018.11.16 at 13h 59m 04s.xml">
525 526
       <configuration name="All in generics" configurationId="JUnit" />
526 527
     </history-entry>
527
-    <history-entry file="MySetTest_toArrayStringTest - 2018.11.16 at 13h 01m 57s.xml">
528
-      <configuration name="MySetTest.toArrayStringTest" configurationId="JUnit" />
528
+    <history-entry file="MySetTest_toArrayObjectTest - 2018.11.16 at 14h 00m 27s.xml">
529
+      <configuration name="MySetTest.toArrayObjectTest" configurationId="JUnit" />
529 530
     </history-entry>
530
-    <history-entry file="MySetTest_toArrayStringTest - 2018.11.16 at 13h 10m 37s.xml">
531
-      <configuration name="MySetTest.toArrayStringTest" configurationId="JUnit" />
531
+    <history-entry file="MySetTest - 2018.11.16 at 14h 00m 39s.xml">
532
+      <configuration name="MySetTest" configurationId="JUnit" />
532 533
     </history-entry>
533
-    <history-entry file="MySetTest_toArrayObjectTest - 2018.11.16 at 13h 12m 56s.xml">
534
-      <configuration name="MySetTest.toArrayObjectTest" configurationId="JUnit" />
534
+    <history-entry file="MySetTest - 2018.11.16 at 14h 01m 18s.xml">
535
+      <configuration name="MySetTest" configurationId="JUnit" />
536
+    </history-entry>
537
+    <history-entry file="All_in_generics - 2018.11.16 at 14h 01m 58s.xml">
538
+      <configuration name="All in generics" configurationId="JUnit" />
535 539
     </history-entry>
536 540
   </component>
537 541
   <component name="TimeTrackingManager">
538
-    <option name="totallyTimeSpent" value="43196000" />
542
+    <option name="totallyTimeSpent" value="44695000" />
539 543
   </component>
540 544
   <component name="TodoView">
541 545
     <todo-panel id="selected-file">
@@ -547,10 +551,10 @@
547 551
     </todo-panel>
548 552
   </component>
549 553
   <component name="ToolWindowManager">
550
-    <frame x="-309" y="-1057" width="1920" height="1057" extended-state="6" />
554
+    <frame x="0" y="23" width="1280" height="709" extended-state="6" />
551 555
     <editor active="true" />
552 556
     <layout>
553
-      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.17252396" />
557
+      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.26171243" />
554 558
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
555 559
       <window_info id="Image Layers" order="2" />
556 560
       <window_info id="Designer" order="3" />
@@ -559,7 +563,7 @@
559 563
       <window_info id="Favorites" order="6" side_tool="true" />
560 564
       <window_info anchor="bottom" id="Message" order="0" />
561 565
       <window_info anchor="bottom" id="Find" order="1" weight="0.32953367" />
562
-      <window_info anchor="bottom" id="Run" order="2" sideWeight="0.4983845" weight="0.18134715" />
566
+      <window_info anchor="bottom" id="Run" order="2" sideWeight="0.4983845" visible="true" weight="0.28363046" />
563 567
       <window_info anchor="bottom" id="Debug" order="3" sideWeight="0.49757674" weight="0.44145077" />
564 568
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
565 569
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
@@ -568,7 +572,7 @@
568 572
       <window_info anchor="bottom" id="Terminal" order="8" sideWeight="0.4983845" weight="0.20907618" />
569 573
       <window_info anchor="bottom" id="Event Log" order="9" sideWeight="0.5016155" side_tool="true" weight="0.20907618" />
570 574
       <window_info anchor="bottom" id="Version Control" order="10" show_stripe_button="false" />
571
-      <window_info active="true" anchor="bottom" id="Messages" order="11" visible="true" weight="0.32642487" />
575
+      <window_info anchor="bottom" id="Messages" order="11" weight="0.32642487" />
572 576
       <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
573 577
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
574 578
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
@@ -578,7 +582,7 @@
578 582
       <window_info anchor="right" id="Palette&#9;" order="6" />
579 583
       <window_info anchor="right" id="Database" order="7" />
580 584
       <window_info anchor="right" id="Maven Projects" order="8" />
581
-      <window_info anchor="right" id="Coverage" order="9" side_tool="true" weight="0.32960597" />
585
+      <window_info anchor="right" id="Coverage" order="9" side_tool="true" weight="0.24920128" />
582 586
     </layout>
583 587
   </component>
584 588
   <component name="TypeScriptGeneratedFilesManager">
@@ -600,19 +604,10 @@
600 604
     <MESSAGE value="MyArrayList - Complete&#10;MySet - Working&#10;add, otherAdd get, contains, remove, addAll, clear, iterator" />
601 605
     <MESSAGE value="MyArrayList - Complete&#10;MySet - Working&#10;add, otherAdd get, contains, remove, addAll, clear, iterator, removeAll" />
602 606
     <MESSAGE value="MyArrayList - Complete&#10;MySet - Complete" />
603
-    <option name="LAST_COMMIT_MESSAGE" value="MyArrayList - Complete&#10;MySet - Complete" />
607
+    <MESSAGE value="MyArrayList - Complete&#10;MySet - working set&#10;Changing name to array" />
608
+    <option name="LAST_COMMIT_MESSAGE" value="MyArrayList - Complete&#10;MySet - working set&#10;Changing name to array" />
604 609
   </component>
605 610
   <component name="XDebuggerManager">
606
-    <breakpoint-manager>
607
-      <breakpoints>
608
-        <line-breakpoint enabled="true" type="java-line">
609
-          <url>file://$PROJECT_DIR$/src/test/java/MySetTest.java</url>
610
-          <line>79</line>
611
-          <properties />
612
-          <option name="timeStamp" value="9" />
613
-        </line-breakpoint>
614
-      </breakpoints>
615
-    </breakpoint-manager>
616 611
     <watches-manager>
617 612
       <configuration name="JUnit">
618 613
         <watch expression="newGenericArray[i]" language="JAVA" />
@@ -736,67 +731,65 @@
736 731
         </state>
737 732
       </provider>
738 733
     </entry>
739
-    <entry file="file://$PROJECT_DIR$/src/test/java/MySetTest.java">
734
+    <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
740 735
       <provider selected="true" editor-type-id="text-editor">
741
-        <state relative-caret-position="338">
742
-          <caret line="79" column="28" selection-start-line="79" selection-start-column="28" selection-end-line="79" selection-end-column="28" />
736
+        <state relative-caret-position="45">
737
+          <caret line="3" column="21" selection-start-line="3" selection-end-line="4" />
743 738
           <folding>
744
-            <element signature="imports" expanded="true" />
745
-            <element signature="e#1474#1480#0" expanded="true" />
746
-            <element signature="e#1815#1823#0" expanded="true" />
747
-            <element signature="e#2182#2190#0" expanded="true" />
748
-            <element signature="e#2583#2591#0" expanded="true" />
749
-            <element signature="e#2969#2977#0" expanded="true" />
750
-            <element signature="e#3343#3349#0" expanded="true" />
751
-            <element signature="e#4161#4167#0" expanded="true" />
752
-            <element signature="e#4305#4313#0" expanded="true" />
753
-            <element signature="e#4764#4772#0" expanded="true" />
754
-            <element signature="e#5216#5224#0" expanded="true" />
755
-            <element signature="e#5842#5848#0" expanded="true" />
756
-            <element signature="e#6095#6101#0" expanded="true" />
757
-            <element signature="e#6641#6647#0" expanded="true" />
758
-            <element signature="e#7059#7065#0" expanded="true" />
759
-            <element signature="e#7536#7544#0" expanded="true" />
760
-            <element signature="e#8053#8061#0" expanded="true" />
761
-            <element signature="e#8540#8548#0" expanded="true" />
739
+            <element signature="e#295#296#0" expanded="true" />
740
+            <element signature="e#339#340#0" expanded="true" />
741
+            <element signature="method#add#1;class#MyArrayList#0" />
742
+            <element signature="method#isEmpty#0;class#MyArrayList#0" />
743
+            <element signature="method#contains#0;class#MyArrayList#0" />
762 744
           </folding>
763 745
         </state>
764 746
       </provider>
765 747
     </entry>
766
-    <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
748
+    <entry file="file://$PROJECT_DIR$/src/test/java/MySetTest.java">
767 749
       <provider selected="true" editor-type-id="text-editor">
768
-        <state relative-caret-position="225">
769
-          <caret line="17" column="20" selection-start-line="17" selection-start-column="20" selection-end-line="17" selection-end-column="20" />
750
+        <state relative-caret-position="233">
751
+          <caret line="80" column="30" selection-start-line="80" selection-start-column="23" selection-end-line="80" selection-end-column="30" />
770 752
           <folding>
771
-            <element signature="e#151#152#0" expanded="true" />
772
-            <element signature="e#197#198#0" expanded="true" />
773
-            <element signature="e#293#294#0" expanded="true" />
774
-            <element signature="e#337#338#0" expanded="true" />
775
-            <element signature="method#add#1;class#MyArrayList#0" />
776
-            <element signature="method#isEmpty#0;class#MyArrayList#0" />
777
-            <element signature="method#contains#0;class#MyArrayList#0" />
753
+            <element signature="imports" expanded="true" />
754
+            <element signature="e#1474#1480#0" expanded="true" />
755
+            <element signature="e#1872#1880#0" expanded="true" />
756
+            <element signature="e#2245#2253#0" expanded="true" />
757
+            <element signature="e#2653#2661#0" expanded="true" />
758
+            <element signature="e#3036#3044#0" expanded="true" />
759
+            <element signature="e#3616#3622#0" expanded="true" />
760
+            <element signature="e#4158#4164#0" expanded="true" />
761
+            <element signature="e#4812#4820#0" expanded="true" />
762
+            <element signature="e#5255#5263#0" expanded="true" />
763
+            <element signature="e#5704#5712#0" expanded="true" />
764
+            <element signature="e#6242#6248#0" expanded="true" />
765
+            <element signature="e#6630#6636#0" expanded="true" />
766
+            <element signature="e#7104#7110#0" expanded="true" />
767
+            <element signature="e#7595#7601#0" expanded="true" />
768
+            <element signature="e#8079#8087#0" expanded="true" />
769
+            <element signature="e#8588#8596#0" expanded="true" />
770
+            <element signature="e#9077#9085#0" expanded="true" />
778 771
           </folding>
779 772
         </state>
780 773
       </provider>
781 774
     </entry>
782 775
     <entry file="file://$PROJECT_DIR$/src/main/java/MySet.java">
783 776
       <provider selected="true" editor-type-id="text-editor">
784
-        <state relative-caret-position="306">
785
-          <caret line="22" column="19" selection-start-line="22" selection-start-column="16" selection-end-line="22" selection-end-column="19" />
777
+        <state relative-caret-position="212">
778
+          <caret line="82" column="11" lean-forward="true" selection-start-line="82" selection-start-column="11" selection-end-line="82" selection-end-column="11" />
786 779
           <folding>
787 780
             <element signature="imports" expanded="true" />
788
-            <element signature="e#244#245#0" expanded="true" />
781
+            <element signature="e#242#243#0" expanded="true" />
789 782
             <element signature="e#286#287#0" expanded="true" />
790 783
             <element signature="e#310#311#0" expanded="true" />
791
-            <element signature="e#348#349#0" expanded="true" />
792
-            <element signature="e#411#412#0" expanded="true" />
793
-            <element signature="e#448#449#0" expanded="true" />
794
-            <element signature="e#1104#1105#0" expanded="true" />
795
-            <element signature="e#1169#1170#0" expanded="true" />
796
-            <element signature="e#1222#1223#0" expanded="true" />
797
-            <element signature="e#1280#1281#0" expanded="true" />
798
-            <element signature="e#5055#5056#0" expanded="true" />
799
-            <element signature="e#5092#5093#0" expanded="true" />
784
+            <element signature="e#350#351#0" expanded="true" />
785
+            <element signature="e#1249#1250#0" expanded="true" />
786
+            <element signature="e#1316#1317#0" expanded="true" />
787
+            <element signature="e#1369#1370#0" expanded="true" />
788
+            <element signature="e#1429#1430#0" expanded="true" />
789
+            <element signature="e#1531#1532#0" expanded="true" />
790
+            <element signature="e#1566#1567#0" expanded="true" />
791
+            <element signature="e#5170#5171#0" expanded="true" />
792
+            <element signature="e#5207#5208#0" expanded="true" />
800 793
           </folding>
801 794
         </state>
802 795
       </provider>

+ 1
- 1
src/main/java/MyArrayList.java View File

@@ -1,7 +1,7 @@
1 1
 import java.lang.reflect.Array;
2 2
 
3 3
 public class MyArrayList<T> {
4
-    private T[] genericArray;
4
+    protected T[] genericArray;
5 5
 
6 6
     MyArrayList(){
7 7
     }

+ 34
- 43
src/main/java/MySet.java View File

@@ -5,30 +5,23 @@ import java.util.Iterator;
5 5
 import java.util.Set;
6 6
 
7 7
 
8
-public class MySet<T> extends MyArrayList implements Set {
9
-
10
-    private T[] genericSet;
11
-
8
+public class MySet<T> extends MyArrayList<T> implements Set<T> {
12 9
     MySet(){
13 10
     }
14 11
 
15 12
     MySet(T[] inputSet){
16
-        this.genericSet = inputSet;
13
+        this.genericArray = inputSet;
17 14
     }
18 15
 
19 16
     public T[] get() {
20
-        return this.genericSet;
21
-    }
22
-
23
-    public void set(T[] setList) {
24
-        this.genericSet = setList;
17
+        return this.genericArray;
25 18
     }
26 19
 
27 20
     @Override
28 21
     public int size() {
29 22
         int countSize = 0;
30 23
 
31
-        for (T elem: this.genericSet) {
24
+        for (T elem: this.genericArray) {
32 25
             countSize++;
33 26
         }
34 27
 
@@ -39,7 +32,7 @@ public class MySet<T> extends MyArrayList implements Set {
39 32
     public boolean isEmpty() {
40 33
         boolean returnValue;
41 34
 
42
-        if (genericSet == null) {
35
+        if (genericArray == null) {
43 36
             returnValue = true;
44 37
         } else {
45 38
             returnValue = false;
@@ -51,7 +44,7 @@ public class MySet<T> extends MyArrayList implements Set {
51 44
     public boolean contains(Object o) {
52 45
         boolean returnValue = false;
53 46
 
54
-        for (T element: genericSet) {
47
+        for (T element: genericArray) {
55 48
             if (element.equals(o)){
56 49
                 returnValue = true;
57 50
                 break;
@@ -67,12 +60,12 @@ public class MySet<T> extends MyArrayList implements Set {
67 60
 
68 61
             @Override
69 62
             public boolean hasNext() {
70
-                return index <  genericSet.length;
63
+                return index <  genericArray.length;
71 64
             }
72 65
 
73 66
             @Override
74 67
             public T next() {
75
-                return genericSet[index++];
68
+                return genericArray[index++];
76 69
             }
77 70
         };
78 71
         return genericSetIterator;
@@ -80,19 +73,17 @@ public class MySet<T> extends MyArrayList implements Set {
80 73
 
81 74
     @Override
82 75
     public Object[] toArray() {
83
-        Object[] retArr = genericSet;
84
-
85
-        return retArr;
76
+        return this.genericArray;
86 77
     }
87 78
 
88 79
     @Override
89 80
     public Object[] toArray(Object[] a) {
90
-        int length = a.length > genericSet.length ? a.length : genericSet.length;
91
-        Object[] object = (Object[]) Array.newInstance(genericSet.getClass().getComponentType(),
81
+        int length = a.length > genericArray.length ? a.length : genericArray.length;
82
+        Object[] object = (Object[]) Array.newInstance(genericArray.getClass().getComponentType(),
92 83
                 length);
93 84
 
94
-        for (int i = 0; i < genericSet.length; i++) {
95
-            object[i] = genericSet[i];
85
+        for (int i = 0; i < genericArray.length; i++) {
86
+            object[i] = genericArray[i];
96 87
         }
97 88
 
98 89
         return object;
@@ -100,15 +91,15 @@ public class MySet<T> extends MyArrayList implements Set {
100 91
 
101 92
     @Override
102 93
     public boolean add(Object o) {
103
-        T[] newGenericSet = (T[]) Array.newInstance(this.genericSet.getClass().getComponentType(),
104
-                genericSet.length + 1);
94
+        T[] newGenericSet = (T[]) Array.newInstance(this.genericArray.getClass().getComponentType(),
95
+                genericArray.length + 1);
105 96
 
106 97
         int i = 0;
107
-        for (; i < genericSet.length; i++) {
108
-            newGenericSet[i] = genericSet[i];
98
+        for (; i < genericArray.length; i++) {
99
+            newGenericSet[i] = genericArray[i];
109 100
         }
110 101
         newGenericSet[i] = ((T) o);
111
-        genericSet = newGenericSet;
102
+        genericArray = newGenericSet;
112 103
 
113 104
         return false;
114 105
     }
@@ -119,21 +110,21 @@ public class MySet<T> extends MyArrayList implements Set {
119 110
         if (this.contains(o)){
120 111
 
121 112
             int objectCount = 0;
122
-            for (T element: genericSet) {
113
+            for (T element: genericArray) {
123 114
                 if (element.equals(o)){
124 115
                     objectCount++;
125 116
                 }
126 117
             }
127
-            T[] newGenericSet = (T[]) Array.newInstance(this.genericSet.getClass().getComponentType(),
128
-                    genericSet.length - objectCount);
118
+            T[] newGenericSet = (T[]) Array.newInstance(this.genericArray.getClass().getComponentType(),
119
+                    genericArray.length - objectCount);
129 120
             int i = 0;
130
-            for (T element: genericSet) {
121
+            for (T element: genericArray) {
131 122
                 if (!element.equals(o)){
132 123
                     newGenericSet[i] = element;
133 124
                     i++;
134 125
                 }
135 126
             }
136
-            genericSet = newGenericSet;
127
+            genericArray = newGenericSet;
137 128
             return true;
138 129
         }
139 130
         else {
@@ -145,37 +136,37 @@ public class MySet<T> extends MyArrayList implements Set {
145 136
     public boolean addAll(Collection c) {
146 137
         boolean returnValue = false;
147 138
 
148
-        T[] newGenericSet = Arrays.copyOf(this.genericSet, size());
139
+        T[] newGenericSet = Arrays.copyOf(this.genericArray, size());
149 140
 
150 141
         int i = size();
151 142
         for (Object elem: c) {
152 143
             if (!this.contains(elem)){
153
-                newGenericSet = Arrays.copyOf(genericSet, genericSet.length + 1);
144
+                newGenericSet = Arrays.copyOf(genericArray, genericArray.length + 1);
154 145
                 newGenericSet[i] = (T)elem;
155
-                genericSet = newGenericSet;
146
+                genericArray = newGenericSet;
156 147
 
157 148
                 i++;
158 149
                 returnValue = true;
159 150
             }
160 151
         }
161
-        genericSet = newGenericSet;
152
+        genericArray = newGenericSet;
162 153
         return returnValue;
163 154
     }
164 155
 
165 156
     @Override
166 157
     public void clear() {
167 158
         T[] newGenericSet = null;
168
-        genericSet = newGenericSet;
159
+        genericArray = newGenericSet;
169 160
     }
170 161
 
171 162
     @Override
172 163
     public boolean removeAll(Collection c) {
173 164
         boolean returnValue = false;
174 165
 
175
-        T[] newGenericSet = (T[]) Array.newInstance(this.genericSet.getClass().getComponentType(), 0);
166
+        T[] newGenericSet = (T[]) Array.newInstance(this.genericArray.getClass().getComponentType(), 0);
176 167
 
177 168
         int i = 0;
178
-        for (Object elem: genericSet) {
169
+        for (Object elem: genericArray) {
179 170
             if (!c.contains(elem)){
180 171
                 newGenericSet = Arrays.copyOf(newGenericSet, newGenericSet.length + 1);
181 172
                 newGenericSet[i] = (T)elem;
@@ -184,7 +175,7 @@ public class MySet<T> extends MyArrayList implements Set {
184 175
                 i++;
185 176
             }
186 177
         }
187
-        genericSet = newGenericSet;
178
+        genericArray = newGenericSet;
188 179
         return returnValue;
189 180
     }
190 181
 
@@ -193,10 +184,10 @@ public class MySet<T> extends MyArrayList implements Set {
193 184
 
194 185
         boolean returnValue = false;
195 186
 
196
-        T[] newGenericSet = (T[]) Array.newInstance(this.genericSet.getClass().getComponentType(), 0);
187
+        T[] newGenericSet = (T[]) Array.newInstance(this.genericArray.getClass().getComponentType(), 0);
197 188
 
198 189
         int i = 0;
199
-        for (Object elem: genericSet) {
190
+        for (Object elem: genericArray) {
200 191
             if (c.contains(elem)){
201 192
                 newGenericSet = Arrays.copyOf(newGenericSet, newGenericSet.length + 1);
202 193
                 newGenericSet[i] = (T)elem;
@@ -205,7 +196,7 @@ public class MySet<T> extends MyArrayList implements Set {
205 196
                 i++;
206 197
             }
207 198
         }
208
-        genericSet = newGenericSet;
199
+        genericArray = newGenericSet;
209 200
         return returnValue;
210 201
     }
211 202
 

+ 1
- 1
src/test/java/MySetTest.java View File

@@ -74,7 +74,7 @@ public class MySetTest {
74 74
         // Given
75 75
         Object[] expected = {"1", "2", "8", "4"};
76 76
         Object[] actual = {"1", "2", "8", "4"};
77
-        MySet<String> mySet = new MySet<String>();
77
+        MySet<Object> mySet = new MySet<Object>();
78 78
 
79 79
         // When
80 80
         mySet.set(expected);