浏览代码

{more progress Friday eve}

Jacqueline Joson 6 年前
父节点
当前提交
9f23eb1f3d
共有 4 个文件被更改,包括 306 次插入168 次删除
  1. 192
    160
      .idea/workspace.xml
  2. 0
    7
      src/main/java/MyArrayList.java
  3. 43
    1
      src/main/java/MySet.java
  4. 71
    0
      src/test/java/MySetTest.java

+ 192
- 160
.idea/workspace.xml 查看文件

@@ -3,7 +3,7 @@
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="ada34df4-dfd8-4fb3-8f80-b9a79b2fcc05" name="Default Changelist" comment="">
5 5
       <change beforePath="$PROJECT_DIR$/src/main/java/MyArrayList.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/MyArrayList.java" afterDir="false" />
6
-      <change beforePath="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" afterDir="false" />
6
+      <change beforePath="$PROJECT_DIR$/src/main/java/MySet.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/MySet.java" afterDir="false" />
7 7
     </list>
8 8
     <ignored path="$PROJECT_DIR$/target/" />
9 9
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@@ -22,12 +22,12 @@
22 22
       </usages-collector>
23 23
       <usages-collector id="statistics.file.extensions.open">
24 24
         <counts>
25
-          <entry key="JAVA/" value="2" />
25
+          <entry key="JAVA/" value="3" />
26 26
           <entry key="JAVA/MyArrayList" value="1" />
27 27
           <entry key="MODULES/mdl-generics" value="1" />
28 28
           <entry key="class" value="4" />
29 29
           <entry key="iml" value="1" />
30
-          <entry key="java" value="3" />
30
+          <entry key="java" value="4" />
31 31
           <entry key="md" value="1" />
32 32
         </counts>
33 33
       </usages-collector>
@@ -35,20 +35,20 @@
35 35
         <counts>
36 36
           <entry key="CLASS" value="4" />
37 37
           <entry key="IDEA_MODULE" value="1" />
38
-          <entry key="JAVA" value="3" />
38
+          <entry key="JAVA" value="4" />
39 39
           <entry key="Markdown" value="1" />
40
-          <entry key="UML" value="4" />
40
+          <entry key="UML" value="5" />
41 41
         </counts>
42 42
       </usages-collector>
43 43
       <usages-collector id="statistics.file.extensions.edit">
44 44
         <counts>
45
-          <entry key="java" value="4322" />
45
+          <entry key="java" value="6987" />
46 46
           <entry key="txt" value="59" />
47 47
         </counts>
48 48
       </usages-collector>
49 49
       <usages-collector id="statistics.file.types.edit">
50 50
         <counts>
51
-          <entry key="JAVA" value="4322" />
51
+          <entry key="JAVA" value="6987" />
52 52
           <entry key="PLAIN_TEXT" value="59" />
53 53
         </counts>
54 54
       </usages-collector>
@@ -57,20 +57,10 @@
57 57
   <component name="FileEditorManager">
58 58
     <leaf>
59 59
       <file pinned="false" current-in-tab="false">
60
-        <entry file="file://$PROJECT_DIR$/README.md">
61
-          <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
62
-            <state split_layout="SPLIT">
63
-              <first_editor />
64
-              <second_editor />
65
-            </state>
66
-          </provider>
67
-        </entry>
68
-      </file>
69
-      <file pinned="false" current-in-tab="false">
70 60
         <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
71 61
           <provider selected="true" editor-type-id="text-editor">
72
-            <state relative-caret-position="335">
73
-              <caret line="89" lean-forward="true" selection-start-line="89" selection-end-line="89" />
62
+            <state relative-caret-position="251">
63
+              <caret line="58" selection-start-line="58" selection-end-line="58" />
74 64
               <folding>
75 65
                 <element signature="e#67#68#0" expanded="true" />
76 66
                 <element signature="e#107#108#0" expanded="true" />
@@ -86,46 +76,49 @@
86 76
       <file pinned="false" current-in-tab="false">
87 77
         <entry file="file://$PROJECT_DIR$/src/main/java/MySet.java">
88 78
           <provider selected="true" editor-type-id="text-editor">
89
-            <state relative-caret-position="17">
90
-              <caret line="1" lean-forward="true" selection-start-line="1" selection-end-line="1" />
79
+            <state relative-caret-position="56">
80
+              <caret line="10" column="46" lean-forward="true" selection-start-line="10" selection-start-column="46" selection-end-line="10" selection-end-column="46" />
81
+              <folding>
82
+                <element signature="e#84#85#0" expanded="true" />
83
+                <element signature="e#128#129#0" expanded="true" />
84
+                <element signature="e#155#156#0" expanded="true" />
85
+                <element signature="e#207#208#0" expanded="true" />
86
+                <element signature="e#233#234#0" expanded="true" />
87
+                <element signature="e#272#273#0" expanded="true" />
88
+                <element signature="e#432#433#0" expanded="true" />
89
+                <element signature="e#461#462#0" expanded="true" />
90
+                <element signature="e#494#495#0" expanded="true" />
91
+                <element signature="e#524#525#0" expanded="true" />
92
+                <element signature="e#559#560#0" expanded="true" />
93
+                <element signature="e#579#580#0" expanded="true" />
94
+                <element signature="e#679#680#0" expanded="true" />
95
+                <element signature="e#706#707#0" expanded="true" />
96
+              </folding>
91 97
             </state>
92 98
           </provider>
93 99
         </entry>
94 100
       </file>
95 101
       <file pinned="false" current-in-tab="true">
96
-        <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
102
+        <entry file="file://$PROJECT_DIR$/src/test/java/MySetTest.java">
97 103
           <provider selected="true" editor-type-id="text-editor">
98
-            <state relative-caret-position="148">
99
-              <caret line="129" column="82" lean-forward="true" selection-start-line="129" selection-start-column="82" selection-end-line="129" selection-end-column="82" />
104
+            <state relative-caret-position="248">
105
+              <caret line="55" column="29" selection-start-line="55" selection-start-column="29" selection-end-line="55" selection-end-column="29" />
100 106
               <folding>
101 107
                 <element signature="imports" expanded="true" />
102
-                <element signature="e#282#291#0" expanded="true" />
108
+                <element signature="e#210#219#0" expanded="true" />
103 109
               </folding>
104 110
             </state>
105 111
           </provider>
106 112
         </entry>
107 113
       </file>
108 114
       <file pinned="false" current-in-tab="false">
109
-        <entry file="uml://JAVA/MyArrayList">
110
-          <provider selected="true" editor-type-id="UmlEditorProvider">
111
-            <state>
112
-              <ID>JAVA</ID>
113
-              <OriginalElement>MyArrayList</OriginalElement>
114
-              <nodes>
115
-                <node x="0.0" y="0.0">MyArrayList</node>
116
-              </nodes>
117
-              <notes />
118
-              <edges />
119
-              <settings layout="Hierarchic Group" zoom="1.0" x="-164.0" y="190.0" />
120
-              <SelectedNodes />
121
-              <Categories>
122
-                <Category>Methods</Category>
123
-                <Category>Constructors</Category>
124
-                <Category>Fields</Category>
125
-                <Category>Inner Classes</Category>
126
-              </Categories>
127
-              <SCOPE>All</SCOPE>
128
-              <VISIBILITY>private</VISIBILITY>
115
+        <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
116
+          <provider selected="true" editor-type-id="text-editor">
117
+            <state relative-caret-position="109">
118
+              <caret line="11" column="66" selection-start-line="11" selection-start-column="59" selection-end-line="11" selection-end-column="66" />
119
+              <folding>
120
+                <element signature="imports" expanded="true" />
121
+              </folding>
129 122
             </state>
130 123
           </provider>
131 124
         </entry>
@@ -135,8 +128,8 @@
135 128
   <component name="FileTemplateManagerImpl">
136 129
     <option name="RECENT_TEMPLATES">
137 130
       <list>
138
-        <option value="JUnit4 Test Class" />
139 131
         <option value="Class" />
132
+        <option value="JUnit4 Test Class" />
140 133
       </list>
141 134
     </option>
142 135
   </component>
@@ -146,9 +139,10 @@
146 139
   <component name="IdeDocumentHistory">
147 140
     <option name="CHANGED_PATHS">
148 141
       <list>
142
+        <option value="$PROJECT_DIR$/src/main/java/MyArrayList.java" />
149 143
         <option value="$PROJECT_DIR$/src/main/java/MySet.java" />
150 144
         <option value="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" />
151
-        <option value="$PROJECT_DIR$/src/main/java/MyArrayList.java" />
145
+        <option value="$PROJECT_DIR$/src/test/java/MySetTest.java" />
152 146
       </list>
153 147
     </option>
154 148
   </component>
@@ -222,15 +216,16 @@
222 216
   <component name="PropertiesComponent">
223 217
     <property name="WebServerToolWindowFactoryState" value="false" />
224 218
     <property name="aspect.path.notification.shown" value="true" />
225
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1542386512999" />
219
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1542409926473" />
226 220
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit4" />
227 221
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrarySuperClass.JUnit4" value="" />
222
+    <property name="com.intellij.testIntegration.createTest.CreateTestDialog.includeInheritedMembers" value="true" />
228 223
     <property name="last_opened_file_path" value="$PROJECT_DIR$/pom.xml" />
229 224
     <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
230 225
     <property name="nodejs_npm_path_reset_for_default_project" value="true" />
231
-    <property name="project.structure.last.edited" value="Modules" />
232
-    <property name="project.structure.proportion" value="0.0" />
233
-    <property name="project.structure.side.proportion" value="0.0" />
226
+    <property name="project.structure.last.edited" value="SDKs" />
227
+    <property name="project.structure.proportion" value="0.15" />
228
+    <property name="project.structure.side.proportion" value="0.2" />
234 229
     <property name="settings.editor.selected.configurable" value="reference.projectsettings.compiler.javacompiler" />
235 230
   </component>
236 231
   <component name="RecentsManager">
@@ -253,69 +248,69 @@
253 248
       </list>
254 249
     </option>
255 250
   </component>
256
-  <component name="RunManager" selected="JUnit.MyArrayListTest">
257
-    <configuration name="MyArrayListTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
251
+  <component name="RunManager" selected="JUnit.MySetTest">
252
+    <configuration name="MySetTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
258 253
       <module name="generics" />
259 254
       <option name="PACKAGE_NAME" value="" />
260
-      <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
255
+      <option name="MAIN_CLASS_NAME" value="MySetTest" />
261 256
       <method v="2">
262 257
         <option name="Make" enabled="true" />
263 258
       </method>
264 259
     </configuration>
265
-    <configuration name="MyArrayListTest.addOverrideTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
260
+    <configuration name="MySetTest.addTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
266 261
       <module name="generics" />
267 262
       <option name="PACKAGE_NAME" value="" />
268
-      <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
269
-      <option name="METHOD_NAME" value="addOverrideTest" />
263
+      <option name="MAIN_CLASS_NAME" value="MySetTest" />
264
+      <option name="METHOD_NAME" value="addTest" />
270 265
       <option name="TEST_OBJECT" value="method" />
271 266
       <method v="2">
272 267
         <option name="Make" enabled="true" />
273 268
       </method>
274 269
     </configuration>
275
-    <configuration name="MyArrayListTest.containsFalseTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
270
+    <configuration name="MySetTest.clearTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
276 271
       <module name="generics" />
277 272
       <option name="PACKAGE_NAME" value="" />
278
-      <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
279
-      <option name="METHOD_NAME" value="containsFalseTest" />
273
+      <option name="MAIN_CLASS_NAME" value="MySetTest" />
274
+      <option name="METHOD_NAME" value="clearTest" />
280 275
       <option name="TEST_OBJECT" value="method" />
281 276
       <method v="2">
282 277
         <option name="Make" enabled="true" />
283 278
       </method>
284 279
     </configuration>
285
-    <configuration name="MyArrayListTest.containsTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
280
+    <configuration name="MySetTest.getTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
286 281
       <module name="generics" />
287 282
       <option name="PACKAGE_NAME" value="" />
288
-      <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
289
-      <option name="METHOD_NAME" value="containsTest" />
283
+      <option name="MAIN_CLASS_NAME" value="MySetTest" />
284
+      <option name="METHOD_NAME" value="getTest" />
290 285
       <option name="TEST_OBJECT" value="method" />
291 286
       <method v="2">
292 287
         <option name="Make" enabled="true" />
293 288
       </method>
294 289
     </configuration>
295
-    <configuration name="MyArrayListTest.isEmptyTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
290
+    <configuration name="MySetTest.sizeTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
296 291
       <module name="generics" />
297 292
       <option name="PACKAGE_NAME" value="" />
298
-      <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
299
-      <option name="METHOD_NAME" value="isEmptyTest" />
293
+      <option name="MAIN_CLASS_NAME" value="MySetTest" />
294
+      <option name="METHOD_NAME" value="sizeTest" />
300 295
       <option name="TEST_OBJECT" value="method" />
301 296
       <method v="2">
302 297
         <option name="Make" enabled="true" />
303 298
       </method>
304 299
     </configuration>
305 300
     <list>
306
-      <item itemvalue="JUnit.MyArrayListTest" />
307
-      <item itemvalue="JUnit.MyArrayListTest.isEmptyTest" />
308
-      <item itemvalue="JUnit.MyArrayListTest.containsTest" />
309
-      <item itemvalue="JUnit.MyArrayListTest.containsFalseTest" />
310
-      <item itemvalue="JUnit.MyArrayListTest.addOverrideTest" />
301
+      <item itemvalue="JUnit.MySetTest" />
302
+      <item itemvalue="JUnit.MySetTest.addTest" />
303
+      <item itemvalue="JUnit.MySetTest.getTest" />
304
+      <item itemvalue="JUnit.MySetTest.sizeTest" />
305
+      <item itemvalue="JUnit.MySetTest.clearTest" />
311 306
     </list>
312 307
     <recent_temporary>
313 308
       <list>
314
-        <item itemvalue="JUnit.MyArrayListTest" />
315
-        <item itemvalue="JUnit.MyArrayListTest.addOverrideTest" />
316
-        <item itemvalue="JUnit.MyArrayListTest.containsFalseTest" />
317
-        <item itemvalue="JUnit.MyArrayListTest.containsTest" />
318
-        <item itemvalue="JUnit.MyArrayListTest.isEmptyTest" />
309
+        <item itemvalue="JUnit.MySetTest" />
310
+        <item itemvalue="JUnit.MySetTest.clearTest" />
311
+        <item itemvalue="JUnit.MySetTest.sizeTest" />
312
+        <item itemvalue="JUnit.MySetTest.getTest" />
313
+        <item itemvalue="JUnit.MySetTest.addTest" />
319 314
       </list>
320 315
     </recent_temporary>
321 316
   </component>
@@ -329,44 +324,44 @@
329 324
       <option name="number" value="Default" />
330 325
       <option name="presentableId" value="Default" />
331 326
       <updated>1542236797011</updated>
332
-      <workItem from="1542236798436" duration="20962000" />
327
+      <workItem from="1542236798436" duration="35275000" />
333 328
     </task>
334 329
     <servers />
335 330
   </component>
336 331
   <component name="TestHistory">
337
-    <history-entry file="MyArrayListTest_addOverrideTest - 2018.11.16 at 08h 56m 05s.xml">
338
-      <configuration name="MyArrayListTest.addOverrideTest" configurationId="JUnit" />
332
+    <history-entry file="MySetTest_addTest - 2018.11.16 at 17h 40m 43s.xml">
333
+      <configuration name="MySetTest.addTest" configurationId="JUnit" />
339 334
     </history-entry>
340
-    <history-entry file="MyArrayListTest_addOverrideTest - 2018.11.16 at 08h 56m 16s.xml">
341
-      <configuration name="MyArrayListTest.addOverrideTest" configurationId="JUnit" />
335
+    <history-entry file="MySetTest_addTest - 2018.11.16 at 17h 54m 24s.xml">
336
+      <configuration name="MySetTest.addTest" configurationId="JUnit" />
342 337
     </history-entry>
343
-    <history-entry file="MyArrayListTest_addOverrideTest - 2018.11.16 at 08h 58m 50s.xml">
344
-      <configuration name="MyArrayListTest.addOverrideTest" configurationId="JUnit" />
338
+    <history-entry file="MySetTest_addTest - 2018.11.16 at 17h 57m 59s.xml">
339
+      <configuration name="MySetTest.addTest" configurationId="JUnit" />
345 340
     </history-entry>
346
-    <history-entry file="MyArrayListTest_addOverrideTest - 2018.11.16 at 10h 57m 57s.xml">
347
-      <configuration name="MyArrayListTest.addOverrideTest" configurationId="JUnit" />
341
+    <history-entry file="MySetTest_addTest - 2018.11.16 at 18h 00m 09s.xml">
342
+      <configuration name="MySetTest.addTest" configurationId="JUnit" />
348 343
     </history-entry>
349
-    <history-entry file="MyArrayListTest_addOverrideTest - 2018.11.16 at 10h 58m 04s.xml">
350
-      <configuration name="MyArrayListTest.addOverrideTest" configurationId="JUnit" />
344
+    <history-entry file="MySetTest_addTest - 2018.11.16 at 18h 00m 13s.xml">
345
+      <configuration name="MySetTest.addTest" configurationId="JUnit" />
351 346
     </history-entry>
352
-    <history-entry file="MyArrayListTest_addOverrideTest - 2018.11.16 at 10h 59m 54s.xml">
353
-      <configuration name="MyArrayListTest.addOverrideTest" configurationId="JUnit" />
347
+    <history-entry file="MySetTest_addTest - 2018.11.16 at 18h 00m 16s.xml">
348
+      <configuration name="MySetTest.addTest" configurationId="JUnit" />
354 349
     </history-entry>
355
-    <history-entry file="MyArrayListTest_addOverrideTest - 2018.11.16 at 11h 00m 33s.xml">
356
-      <configuration name="MyArrayListTest.addOverrideTest" configurationId="JUnit" />
350
+    <history-entry file="MySetTest_addTest - 2018.11.16 at 18h 02m 23s.xml">
351
+      <configuration name="MySetTest.addTest" configurationId="JUnit" />
357 352
     </history-entry>
358
-    <history-entry file="MyArrayListTest_addOverrideTest - 2018.11.16 at 11h 02m 07s.xml">
359
-      <configuration name="MyArrayListTest.addOverrideTest" configurationId="JUnit" />
353
+    <history-entry file="MySetTest_addTest - 2018.11.16 at 18h 02m 27s.xml">
354
+      <configuration name="MySetTest.addTest" configurationId="JUnit" />
360 355
     </history-entry>
361
-    <history-entry file="MyArrayListTest_addOverrideTest - 2018.11.16 at 11h 02m 10s.xml">
362
-      <configuration name="MyArrayListTest.addOverrideTest" configurationId="JUnit" />
356
+    <history-entry file="MySetTest_addTest - 2018.11.16 at 18h 02m 31s.xml">
357
+      <configuration name="MySetTest.addTest" configurationId="JUnit" />
363 358
     </history-entry>
364
-    <history-entry file="MyArrayListTest_addOverrideTest - 2018.11.16 at 11h 35m 04s.xml">
365
-      <configuration name="MyArrayListTest.addOverrideTest" configurationId="JUnit" />
359
+    <history-entry file="MySetTest_getTest - 2018.11.16 at 18h 04m 18s.xml">
360
+      <configuration name="MySetTest.getTest" configurationId="JUnit" />
366 361
     </history-entry>
367 362
   </component>
368 363
   <component name="TimeTrackingManager">
369
-    <option name="totallyTimeSpent" value="20962000" />
364
+    <option name="totallyTimeSpent" value="35275000" />
370 365
   </component>
371 366
   <component name="ToolWindowManager">
372 367
     <frame x="0" y="23" width="1280" height="712" extended-state="0" />
@@ -382,10 +377,10 @@
382 377
       <window_info anchor="bottom" id="Messages" weight="0.32903227" />
383 378
       <window_info anchor="bottom" id="Version Control" order="0" show_stripe_button="false" />
384 379
       <window_info anchor="bottom" id="Terminal" order="1" />
385
-      <window_info anchor="bottom" id="Event Log" order="2" side_tool="true" />
380
+      <window_info anchor="bottom" id="Event Log" order="2" sideWeight="0.50080776" side_tool="true" weight="0.32903227" />
386 381
       <window_info anchor="bottom" id="Message" order="3" />
387 382
       <window_info anchor="bottom" id="Find" order="4" weight="0.32903227" />
388
-      <window_info active="true" anchor="bottom" id="Run" order="5" visible="true" weight="0.32903227" />
383
+      <window_info active="true" anchor="bottom" id="Run" order="5" sideWeight="0.49919224" visible="true" weight="0.32903227" />
389 384
       <window_info anchor="bottom" id="Database Changes" order="6" show_stripe_button="false" />
390 385
       <window_info anchor="bottom" id="Debug" order="7" weight="0.4" />
391 386
       <window_info anchor="bottom" id="Cvs" order="8" weight="0.25" />
@@ -412,12 +407,12 @@
412 407
     <breakpoint-manager>
413 408
       <breakpoints>
414 409
         <line-breakpoint enabled="true" type="java-method">
415
-          <url>file://$PROJECT_DIR$/src/main/java/MyArrayList.java</url>
416
-          <line>71</line>
417
-          <properties class="MyArrayList" method="add">
410
+          <url>file://$PROJECT_DIR$/src/main/java/MySet.java</url>
411
+          <line>17</line>
412
+          <properties class="MySet" method="add">
418 413
             <option name="EMULATED" value="true" />
419 414
           </properties>
420
-          <option name="timeStamp" value="9" />
415
+          <option name="timeStamp" value="14" />
421 416
         </line-breakpoint>
422 417
       </breakpoints>
423 418
     </breakpoint-manager>
@@ -442,38 +437,67 @@
442 437
         </state>
443 438
       </provider>
444 439
     </entry>
440
+    <entry file="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/org/junit/internal/runners/model/ReflectiveCallable.class">
441
+      <provider selected="true" editor-type-id="text-editor">
442
+        <state relative-caret-position="221">
443
+          <caret line="16" selection-start-line="16" selection-end-line="16" />
444
+        </state>
445
+      </provider>
446
+    </entry>
447
+    <entry file="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/org/junit/Assert.class">
448
+      <provider selected="true" editor-type-id="text-editor">
449
+        <state relative-caret-position="94">
450
+          <caret line="333" selection-start-line="333" selection-end-line="333" />
451
+          <folding>
452
+            <element signature="e#8323#8324#0" expanded="true" />
453
+            <element signature="e#8383#8384#0" expanded="true" />
454
+          </folding>
455
+        </state>
456
+      </provider>
457
+    </entry>
445 458
     <entry file="uml://JAVA/">
446 459
       <provider selected="true" editor-type-id="UmlEditorProvider">
447 460
         <state>
448 461
           <ID>JAVA</ID>
449 462
           <OriginalElement />
450 463
           <nodes>
451
-            <node x="" y="">com</node>
452
-            <node x="" y="">netscape</node>
453
-            <node x="" y="">junit</node>
454
-            <node x="" y="">oracle</node>
455
-            <node x="" y="">org</node>
456
-            <node x="" y="">resources</node>
457
-            <node x="" y="">toolbarButtonGraphics</node>
458
-            <node x="" y="">MyArrayList</node>
459
-            <node x="" y="">sun</node>
460
-            <node x="" y="">META-INF</node>
461
-            <node x="" y="">jdk</node>
462
-            <node x="" y="">apple</node>
463
-            <node x="" y="">groovyjarjarasm</node>
464
-            <node x="" y="">java</node>
465
-            <node x="" y="">groovy</node>
466
-            <node x="" y="">javax</node>
467
-            <node x="" y="">groovyjarjarcommonscli</node>
468
-            <node x="" y="">javafx</node>
469
-            <node x="" y="">groovyjarjarantlr</node>
464
+            <node x="159.0" y="664.0">com</node>
465
+            <node x="617.0" y="516.0">netscape</node>
466
+            <node x="0.0" y="664.0">junit</node>
467
+            <node x="175.0" y="590.0">oracle</node>
468
+            <node x="53.0" y="368.0">MySet</node>
469
+            <node x="516.0" y="0.0">MySetTest</node>
470
+            <node x="628.0" y="664.0">org</node>
471
+            <node x="424.0" y="516.0">resources</node>
472
+            <node x="278.0" y="442.0">toolbarButtonGraphics</node>
473
+            <node x="0.0" y="0.0">MyArrayList</node>
474
+            <node x="473.0" y="664.0">sun</node>
475
+            <node x="230.0" y="516.0">META-INF</node>
476
+            <node x="0.0" y="738.0">jdk</node>
477
+            <node x="512.0" y="590.0">apple</node>
478
+            <node x="0.0" y="516.0">groovyjarjarasm</node>
479
+            <node x="317.0" y="664.0">java</node>
480
+            <node x="0.0" y="590.0">groovy</node>
481
+            <node x="677.0" y="590.0">javax</node>
482
+            <node x="0.0" y="442.0">groovyjarjarcommonscli</node>
483
+            <node x="344.0" y="590.0">javafx</node>
484
+            <node x="237.0" y="0.0">MyArrayListTest</node>
485
+            <node x="552.0" y="442.0">groovyjarjarantlr</node>
470 486
           </nodes>
471 487
           <notes />
472
-          <edges />
473
-          <settings layout="Hierarchic Group" zoom="1.0" x="253.5" y="264.5" />
474
-          <SelectedNodes />
488
+          <edges>
489
+            <edge source="MySet" target="MyArrayList">
490
+              <point x="0.0" y="-14.5" />
491
+              <point x="0.0" y="159.0" />
492
+            </edge>
493
+          </edges>
494
+          <settings layout="Hierarchic Group" zoom="0.6381118881118881" x="-55.3191780821918" y="356.1095890410959" />
495
+          <SelectedNodes>
496
+            <node>MyArrayList</node>
497
+          </SelectedNodes>
475 498
           <Categories>
476 499
             <Category>Constructors</Category>
500
+            <Category>Fields</Category>
477 501
             <Category>Methods</Category>
478 502
             <Category>Properties</Category>
479 503
             <Category>Inner Classes</Category>
@@ -483,25 +507,17 @@
483 507
         </state>
484 508
       </provider>
485 509
     </entry>
486
-    <entry file="file://$PROJECT_DIR$/README.md">
487
-      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
488
-        <state split_layout="SPLIT">
489
-          <first_editor />
490
-          <second_editor />
491
-        </state>
492
-      </provider>
493
-    </entry>
494 510
     <entry file="uml://JAVA/MyArrayList">
495 511
       <provider selected="true" editor-type-id="UmlEditorProvider">
496 512
         <state>
497 513
           <ID>JAVA</ID>
498 514
           <OriginalElement>MyArrayList</OriginalElement>
499 515
           <nodes>
500
-            <node x="0.0" y="0.0">MyArrayList</node>
516
+            <node x="" y="">MyArrayList</node>
501 517
           </nodes>
502 518
           <notes />
503 519
           <edges />
504
-          <settings layout="Hierarchic Group" zoom="1.0" x="-164.0" y="190.0" />
520
+          <settings layout="Hierarchic Group" zoom="1.0" x="60.5" y="132.5" />
505 521
           <SelectedNodes />
506 522
           <Categories>
507 523
             <Category>Methods</Category>
@@ -514,53 +530,69 @@
514 530
         </state>
515 531
       </provider>
516 532
     </entry>
517
-    <entry file="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/org/junit/internal/runners/model/ReflectiveCallable.class">
518
-      <provider selected="true" editor-type-id="text-editor">
519
-        <state relative-caret-position="221">
520
-          <caret line="16" selection-start-line="16" selection-end-line="16" />
533
+    <entry file="file://$PROJECT_DIR$/README.md">
534
+      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
535
+        <state split_layout="SPLIT">
536
+          <first_editor />
537
+          <second_editor />
521 538
         </state>
522 539
       </provider>
523 540
     </entry>
524
-    <entry file="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/org/junit/Assert.class">
541
+    <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
525 542
       <provider selected="true" editor-type-id="text-editor">
526
-        <state relative-caret-position="94">
527
-          <caret line="333" selection-start-line="333" selection-end-line="333" />
543
+        <state relative-caret-position="251">
544
+          <caret line="58" selection-start-line="58" selection-end-line="58" />
528 545
           <folding>
529
-            <element signature="e#8323#8324#0" expanded="true" />
530
-            <element signature="e#8383#8384#0" expanded="true" />
546
+            <element signature="e#67#68#0" expanded="true" />
547
+            <element signature="e#107#108#0" expanded="true" />
548
+            <element signature="e#216#217#0" expanded="true" />
549
+            <element signature="e#250#251#0" expanded="true" />
550
+            <element signature="e#1551#1552#0" expanded="true" />
551
+            <element signature="e#1596#1597#0" expanded="true" />
531 552
           </folding>
532 553
         </state>
533 554
       </provider>
534 555
     </entry>
535 556
     <entry file="file://$PROJECT_DIR$/src/main/java/MySet.java">
536 557
       <provider selected="true" editor-type-id="text-editor">
537
-        <state relative-caret-position="17">
538
-          <caret line="1" lean-forward="true" selection-start-line="1" selection-end-line="1" />
558
+        <state relative-caret-position="56">
559
+          <caret line="10" column="46" lean-forward="true" selection-start-line="10" selection-start-column="46" selection-end-line="10" selection-end-column="46" />
560
+          <folding>
561
+            <element signature="e#84#85#0" expanded="true" />
562
+            <element signature="e#128#129#0" expanded="true" />
563
+            <element signature="e#155#156#0" expanded="true" />
564
+            <element signature="e#207#208#0" expanded="true" />
565
+            <element signature="e#233#234#0" expanded="true" />
566
+            <element signature="e#272#273#0" expanded="true" />
567
+            <element signature="e#432#433#0" expanded="true" />
568
+            <element signature="e#461#462#0" expanded="true" />
569
+            <element signature="e#494#495#0" expanded="true" />
570
+            <element signature="e#524#525#0" expanded="true" />
571
+            <element signature="e#559#560#0" expanded="true" />
572
+            <element signature="e#579#580#0" expanded="true" />
573
+            <element signature="e#679#680#0" expanded="true" />
574
+            <element signature="e#706#707#0" expanded="true" />
575
+          </folding>
539 576
         </state>
540 577
       </provider>
541 578
     </entry>
542
-    <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
579
+    <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
543 580
       <provider selected="true" editor-type-id="text-editor">
544
-        <state relative-caret-position="335">
545
-          <caret line="89" lean-forward="true" selection-start-line="89" selection-end-line="89" />
581
+        <state relative-caret-position="109">
582
+          <caret line="11" column="66" selection-start-line="11" selection-start-column="59" selection-end-line="11" selection-end-column="66" />
546 583
           <folding>
547
-            <element signature="e#67#68#0" expanded="true" />
548
-            <element signature="e#107#108#0" expanded="true" />
549
-            <element signature="e#216#217#0" expanded="true" />
550
-            <element signature="e#250#251#0" expanded="true" />
551
-            <element signature="e#1551#1552#0" expanded="true" />
552
-            <element signature="e#1596#1597#0" expanded="true" />
584
+            <element signature="imports" expanded="true" />
553 585
           </folding>
554 586
         </state>
555 587
       </provider>
556 588
     </entry>
557
-    <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
589
+    <entry file="file://$PROJECT_DIR$/src/test/java/MySetTest.java">
558 590
       <provider selected="true" editor-type-id="text-editor">
559
-        <state relative-caret-position="148">
560
-          <caret line="129" column="82" lean-forward="true" selection-start-line="129" selection-start-column="82" selection-end-line="129" selection-end-column="82" />
591
+        <state relative-caret-position="248">
592
+          <caret line="55" column="29" selection-start-line="55" selection-start-column="29" selection-end-line="55" selection-end-column="29" />
561 593
           <folding>
562 594
             <element signature="imports" expanded="true" />
563
-            <element signature="e#282#291#0" expanded="true" />
595
+            <element signature="e#210#219#0" expanded="true" />
564 596
           </folding>
565 597
         </state>
566 598
       </provider>

+ 0
- 7
src/main/java/MyArrayList.java 查看文件

@@ -71,7 +71,6 @@ public class MyArrayList<T> {
71 71
 
72 72
         public void add(int index, T elementToAdd) {
73 73
             T[] newArray = (T[]) new Object[theArray.length + 1];
74
-//            int track = 0;
75 74
             for (int i = 0; i < theArray.length; i++) {
76 75
                 newArray[i] = theArray[i];
77 76
                 if (i == index) {
@@ -79,11 +78,5 @@ public class MyArrayList<T> {
79 78
                     i = i+1;
80 79
                 }
81 80
             }
82
-//                if (i == index) {
83
-//                    newArray[track] = elementToAdd;
84
-//                }
85
-//                newArray[track] = theArray[i];
86
-//                track++;
87
-//            }
88 81
         }
89 82
 }

+ 43
- 1
src/main/java/MySet.java 查看文件

@@ -1,3 +1,45 @@
1
-public class MySet <T, E> extends MyArrayList {
1
+
2
+public class MySet <T> {
3
+
4
+    MyArrayList <T> mySet;
5
+
6
+    public MySet() {
7
+        mySet = new MyArrayList<>();
8
+    }
9
+
10
+    public MySet(T [] array) {
11
+        this.mySet = new MyArrayList<>(array);
12
+    }
13
+
14
+    public T get(int index) {
15
+        return mySet.get(index);
16
+    }
17
+
18
+    public void add(T elementToAdd) {
19
+        if(!mySet.contains(elementToAdd)) {
20
+            mySet.add(elementToAdd);
21
+        }
22
+    }
23
+
24
+    public void clear() {
25
+        this.mySet.clear();
26
+    }
27
+
28
+    public boolean isEmpty() {
29
+        return this.mySet.isEmpty();
30
+    }
31
+
32
+    public boolean contains(T elementToCheck) {
33
+        return this.mySet.contains(elementToCheck);
34
+    }
35
+
36
+    public int size() {
37
+        return mySet.size();
38
+    }
39
+
40
+//    public int size() {
41
+//        return this.mySet.size();
42
+//    }
2 43
 
3 44
 }
45
+

+ 71
- 0
src/test/java/MySetTest.java 查看文件

@@ -0,0 +1,71 @@
1
+import org.junit.Assert;
2
+import org.junit.Test;
3
+
4
+public class MySetTest {
5
+
6
+    @Test
7
+    public void addTest() {
8
+        //given
9
+        Integer [] numbers = {1, 2, 3};
10
+        MySet <Integer> mySet = new MySet<Integer>(numbers);
11
+        int expected = 3;
12
+        //when
13
+        mySet.add(1);
14
+        mySet.add(1);
15
+        int actual = mySet.size();
16
+        //then
17
+        Assert.assertEquals(expected, actual);
18
+    }
19
+
20
+    @Test
21
+    public void getTest() {
22
+        //given
23
+        Integer [] numbers = {1, 2, 3};
24
+        MySet <Integer> mySet = new MySet<>(numbers);
25
+        mySet.add(1);
26
+        mySet.add(2);
27
+        mySet.add(4);
28
+        int expected = 4;
29
+        //when
30
+        int actual = mySet.get(3);
31
+        //then
32
+        Assert.assertEquals(expected, actual);
33
+    }
34
+
35
+    @Test
36
+    public void clearTest() {
37
+        //given
38
+        Integer [] numbers = {1, 2, 3};
39
+        MySet<Integer> mySet = new MySet<>(numbers);
40
+        //when
41
+        mySet.clear();
42
+        //then
43
+        
44
+
45
+    }
46
+
47
+    @Test
48
+    public void isEmptyTest() {
49
+    }
50
+
51
+    @Test
52
+    public void containsTest() {
53
+    }
54
+
55
+    @Test
56
+    public void sizeTest() {
57
+        //given
58
+        String [] wordies = {"I", "almost", "threw", "my", "computer", "out", "the", "window"};
59
+        MySet<String> wordsSet = new MySet<>(wordies);
60
+        wordsSet.add("but");
61
+        wordsSet.add("nah");
62
+        int expected = 10;
63
+        //when
64
+        int actual = wordsSet.size();
65
+        //then
66
+        Assert.assertEquals(expected, actual);
67
+    }
68
+
69
+
70
+
71
+}