浏览代码

Completed

NiraParikh 6 年前
父节点
当前提交
ce5fbdf8a4

+ 170
- 76
.idea/workspace.xml 查看文件

@@ -2,12 +2,13 @@
2 2
 <project version="4">
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="be130449-c3aa-4705-ba79-3d5ee871a889" name="Default Changelist" comment="">
5
-      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__junit_junit_4_12.xml" afterDir="false" />
6
-      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml" afterDir="false" />
7
-      <change afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
8
-      <change afterPath="$PROJECT_DIR$/src/main/java/MyArrayList.java" afterDir="false" />
9
-      <change afterPath="$PROJECT_DIR$/src/test/java/ListTest.java" afterDir="false" />
10
-      <change afterPath="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" afterDir="false" />
5
+      <change afterPath="$PROJECT_DIR$/src/main/java/MyMap.java" afterDir="false" />
6
+      <change afterPath="$PROJECT_DIR$/src/main/java/MySet.java" afterDir="false" />
7
+      <change afterPath="$PROJECT_DIR$/src/test/java/MyMapTest.java" afterDir="false" />
8
+      <change afterPath="$PROJECT_DIR$/src/test/java/TestMySet.java" afterDir="false" />
9
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
10
+      <change beforePath="$PROJECT_DIR$/src/main/java/MyArrayList.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/MyArrayList.java" afterDir="false" />
11
+      <change beforePath="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" afterDir="false" />
11 12
     </list>
12 13
     <ignored path="$PROJECT_DIR$/target/" />
13 14
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@@ -20,36 +21,37 @@
20 21
     <session id="-1611425401">
21 22
       <usages-collector id="statistics.lifecycle.project">
22 23
         <counts>
23
-          <entry key="project.closed" value="7" />
24
+          <entry key="project.closed" value="8" />
24 25
           <entry key="project.open.time.1" value="3" />
26
+          <entry key="project.open.time.10" value="1" />
25 27
           <entry key="project.open.time.2" value="2" />
26 28
           <entry key="project.open.time.3" value="1" />
27 29
           <entry key="project.open.time.8" value="1" />
28
-          <entry key="project.opened" value="7" />
30
+          <entry key="project.opened" value="8" />
29 31
         </counts>
30 32
       </usages-collector>
31 33
       <usages-collector id="statistics.file.extensions.open">
32 34
         <counts>
33 35
           <entry key="deleteme" value="1" />
34
-          <entry key="java" value="4" />
35
-          <entry key="md" value="4" />
36
+          <entry key="java" value="17" />
37
+          <entry key="md" value="6" />
36 38
         </counts>
37 39
       </usages-collector>
38 40
       <usages-collector id="statistics.file.types.open">
39 41
         <counts>
40
-          <entry key="JAVA" value="4" />
41
-          <entry key="Markdown" value="4" />
42
+          <entry key="JAVA" value="17" />
43
+          <entry key="Markdown" value="6" />
42 44
           <entry key="PLAIN_TEXT" value="1" />
43 45
         </counts>
44 46
       </usages-collector>
45 47
       <usages-collector id="statistics.file.extensions.edit">
46 48
         <counts>
47
-          <entry key="java" value="6571" />
49
+          <entry key="java" value="10074" />
48 50
         </counts>
49 51
       </usages-collector>
50 52
       <usages-collector id="statistics.file.types.edit">
51 53
         <counts>
52
-          <entry key="JAVA" value="6571" />
54
+          <entry key="JAVA" value="10074" />
53 55
         </counts>
54 56
       </usages-collector>
55 57
     </session>
@@ -57,50 +59,52 @@
57 59
   <component name="FileEditorManager">
58 60
     <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
59 61
       <file pinned="false" current-in-tab="false">
60
-        <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
62
+        <entry file="file://$PROJECT_DIR$/src/main/java/MyMap.java">
61 63
           <provider selected="true" editor-type-id="text-editor">
62
-            <state relative-caret-position="53">
63
-              <caret line="86" column="9" lean-forward="true" selection-start-line="86" selection-start-column="9" selection-end-line="86" selection-end-column="9" />
64
+            <state relative-caret-position="-139">
65
+              <caret line="72" column="28" lean-forward="true" selection-start-line="72" selection-start-column="28" selection-end-line="72" selection-end-column="28" />
64 66
               <folding>
65
-                <element signature="e#102#103#0" expanded="true" />
66
-                <element signature="e#137#138#0" expanded="true" />
67
-                <element signature="e#177#178#0" expanded="true" />
68
-                <element signature="e#207#208#0" expanded="true" />
69
-                <element signature="e#239#240#0" expanded="true" />
70
-                <element signature="e#265#266#0" expanded="true" />
71
-                <element signature="e#301#302#0" expanded="true" />
72
-                <element signature="e#339#340#0" expanded="true" />
73
-                <element signature="e#364#365#0" expanded="true" />
74
-                <element signature="e#397#398#0" expanded="true" />
75
-                <element signature="method#add#0;class#MyArrayList#0" />
76
-                <element signature="method#add#1;class#MyArrayList#0" />
77
-                <element signature="method#get#0;class#MyArrayList#0" />
78
-                <element signature="method#remove#0;class#MyArrayList#0" />
79
-                <element signature="e#1516#1517#0" expanded="true" />
80
-                <element signature="e#1548#1549#0" expanded="true" />
81
-                <element signature="e#1575#1576#0" expanded="true" />
82
-                <element signature="e#1610#1611#0" expanded="true" />
67
+                <element signature="imports" expanded="true" />
68
+                <element signature="e#497#498#0" expanded="true" />
69
+                <element signature="e#530#531#0" expanded="true" />
70
+                <element signature="e#882#883#0" expanded="true" />
71
+                <element signature="e#926#927#0" expanded="true" />
72
+                <element signature="e#1547#1548#0" expanded="true" />
73
+                <element signature="e#1582#1583#0" expanded="true" />
83 74
               </folding>
84 75
             </state>
85 76
           </provider>
86 77
         </entry>
87 78
       </file>
88 79
       <file pinned="false" current-in-tab="false">
89
-        <entry file="file://$PROJECT_DIR$/src/test/java/ListTest.java">
80
+        <entry file="file://$PROJECT_DIR$/src/test/java/MyMapTest.java">
90 81
           <provider selected="true" editor-type-id="text-editor">
91
-            <state>
92
-              <caret column="13" selection-start-column="13" selection-end-column="13" />
82
+            <state relative-caret-position="1845">
83
+              <caret line="165" lean-forward="true" selection-start-line="165" selection-end-line="165" />
84
+              <folding>
85
+                <element signature="imports" expanded="true" />
86
+                <element signature="method#containsKeyTrueTest#0;class#MyMapTest#0" />
87
+                <element signature="method#containsKeyFalseTest#0;class#MyMapTest#0" />
88
+                <element signature="method#containsKeyTrueTest#1;class#MyMapTest#0" />
89
+                <element signature="method#containsKeyFalseTest#1;class#MyMapTest#0" />
90
+                <element signature="method#entrySetTest#0;class#MyMapTest#0" />
91
+                <element signature="method#entryTrueTest#0;class#MyMapTest#0" />
92
+              </folding>
93 93
             </state>
94 94
           </provider>
95 95
         </entry>
96 96
       </file>
97 97
       <file pinned="false" current-in-tab="true">
98
-        <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
98
+        <entry file="file://$PROJECT_DIR$/src/main/java/MySet.java">
99 99
           <provider selected="true" editor-type-id="text-editor">
100
-            <state relative-caret-position="390">
101
-              <caret line="184" column="36" lean-forward="true" selection-start-line="184" selection-start-column="36" selection-end-line="184" selection-end-column="36" />
100
+            <state relative-caret-position="389">
101
+              <caret line="40" column="8" selection-start-line="40" selection-start-column="8" selection-end-line="40" selection-end-column="8" />
102 102
               <folding>
103 103
                 <element signature="imports" expanded="true" />
104
+                <element signature="e#191#192#0" expanded="true" />
105
+                <element signature="e#228#229#0" expanded="true" />
106
+                <element signature="e#258#259#0" expanded="true" />
107
+                <element signature="e#298#299#0" expanded="true" />
104 108
               </folding>
105 109
             </state>
106 110
           </provider>
@@ -129,7 +133,11 @@
129 133
       <list>
130 134
         <option value="$PROJECT_DIR$/src/test/java/ListTest.java" />
131 135
         <option value="$PROJECT_DIR$/src/main/java/MyArrayList.java" />
136
+        <option value="$PROJECT_DIR$/src/test/java/TestMySet.java" />
132 137
         <option value="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" />
138
+        <option value="$PROJECT_DIR$/src/main/java/MyMap.java" />
139
+        <option value="$PROJECT_DIR$/src/test/java/MyMapTest.java" />
140
+        <option value="$PROJECT_DIR$/src/main/java/MySet.java" />
133 141
       </list>
134 142
     </option>
135 143
   </component>
@@ -140,10 +148,10 @@
140 148
     <sorting>DEFINITION_ORDER</sorting>
141 149
   </component>
142 150
   <component name="ProjectFrameBounds">
143
-    <option name="x" value="189" />
144
-    <option name="y" value="23" />
151
+    <option name="x" value="502" />
152
+    <option name="y" value="28" />
145 153
     <option name="width" value="1280" />
146
-    <option name="height" value="722" />
154
+    <option name="height" value="723" />
147 155
   </component>
148 156
   <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
149 157
   <component name="ProjectView">
@@ -151,8 +159,6 @@
151 159
       <foldersAlwaysOnTop value="true" />
152 160
     </navigator>
153 161
     <panes>
154
-      <pane id="PackagesPane" />
155
-      <pane id="Scope" />
156 162
       <pane id="ProjectPane">
157 163
         <subPane>
158 164
           <expand>
@@ -195,12 +201,14 @@
195 201
           <select />
196 202
         </subPane>
197 203
       </pane>
204
+      <pane id="Scope" />
205
+      <pane id="PackagesPane" />
198 206
     </panes>
199 207
   </component>
200 208
   <component name="PropertiesComponent">
201 209
     <property name="WebServerToolWindowFactoryState" value="false" />
202 210
     <property name="aspect.path.notification.shown" value="true" />
203
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1542573981058" />
211
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1542587995702" />
204 212
     <property name="last_opened_file_path" value="$PROJECT_DIR$/pom.xml" />
205 213
     <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
206 214
     <property name="nodejs_npm_path_reset_for_default_project" value="true" />
@@ -220,7 +228,7 @@
220 228
       </list>
221 229
     </option>
222 230
   </component>
223
-  <component name="RunManager" selected="JUnit.MyArrayListTest">
231
+  <component name="RunManager" selected="JUnit.MyMapTest">
224 232
     <configuration name="MyArrayListTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
225 233
       <module name="generics" />
226 234
       <option name="PACKAGE_NAME" value="" />
@@ -239,50 +247,48 @@
239 247
         <option name="Make" enabled="true" />
240 248
       </method>
241 249
     </configuration>
242
-    <configuration name="MyArrayListTest.emptyFalseTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
250
+    <configuration name="MyArrayListTest.indexOfNoTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
243 251
       <module name="generics" />
244 252
       <option name="PACKAGE_NAME" value="" />
245 253
       <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
246
-      <option name="METHOD_NAME" value="emptyFalseTest" />
254
+      <option name="METHOD_NAME" value="indexOfNoTest" />
247 255
       <option name="TEST_OBJECT" value="method" />
248 256
       <method v="2">
249 257
         <option name="Make" enabled="true" />
250 258
       </method>
251 259
     </configuration>
252
-    <configuration name="MyArrayListTest.indexOfNoTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
260
+    <configuration name="MyArrayListTest.indexOfTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
253 261
       <module name="generics" />
254 262
       <option name="PACKAGE_NAME" value="" />
255 263
       <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
256
-      <option name="METHOD_NAME" value="indexOfNoTest" />
264
+      <option name="METHOD_NAME" value="indexOfTest" />
257 265
       <option name="TEST_OBJECT" value="method" />
258 266
       <method v="2">
259 267
         <option name="Make" enabled="true" />
260 268
       </method>
261 269
     </configuration>
262
-    <configuration name="MyArrayListTest.indexOfTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
270
+    <configuration name="MyMapTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
263 271
       <module name="generics" />
264 272
       <option name="PACKAGE_NAME" value="" />
265
-      <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
266
-      <option name="METHOD_NAME" value="indexOfTest" />
267
-      <option name="TEST_OBJECT" value="method" />
273
+      <option name="MAIN_CLASS_NAME" value="MyMapTest" />
268 274
       <method v="2">
269 275
         <option name="Make" enabled="true" />
270 276
       </method>
271 277
     </configuration>
272 278
     <list>
273 279
       <item itemvalue="JUnit.MyArrayListTest" />
274
-      <item itemvalue="JUnit.MyArrayListTest.emptyFalseTest" />
275 280
       <item itemvalue="JUnit.MyArrayListTest.containsFalseTest" />
276 281
       <item itemvalue="JUnit.MyArrayListTest.indexOfTest" />
277 282
       <item itemvalue="JUnit.MyArrayListTest.indexOfNoTest" />
283
+      <item itemvalue="JUnit.MyMapTest" />
278 284
     </list>
279 285
     <recent_temporary>
280 286
       <list>
287
+        <item itemvalue="JUnit.MyMapTest" />
281 288
         <item itemvalue="JUnit.MyArrayListTest" />
282 289
         <item itemvalue="JUnit.MyArrayListTest.indexOfNoTest" />
283 290
         <item itemvalue="JUnit.MyArrayListTest.indexOfTest" />
284 291
         <item itemvalue="JUnit.MyArrayListTest.containsFalseTest" />
285
-        <item itemvalue="JUnit.MyArrayListTest.emptyFalseTest" />
286 292
       </list>
287 293
     </recent_temporary>
288 294
   </component>
@@ -303,6 +309,7 @@
303 309
       <workItem from="1542305899245" duration="880000" />
304 310
       <workItem from="1542404955761" duration="15038000" />
305 311
       <workItem from="1542573276093" duration="717000" />
312
+      <workItem from="1542574394712" duration="7539000" />
306 313
     </task>
307 314
     <servers />
308 315
   </component>
@@ -339,10 +346,10 @@
339 346
     </history-entry>
340 347
   </component>
341 348
   <component name="TimeTrackingManager">
342
-    <option name="totallyTimeSpent" value="23727000" />
349
+    <option name="totallyTimeSpent" value="31266000" />
343 350
   </component>
344 351
   <component name="ToolWindowManager">
345
-    <frame x="189" y="23" width="1280" height="722" extended-state="0" />
352
+    <frame x="502" y="28" width="1280" height="723" extended-state="0" />
346 353
     <editor active="true" />
347 354
     <layout>
348 355
       <window_info content_ui="combo" id="Project" order="0" weight="0.2536349" />
@@ -353,7 +360,7 @@
353 360
       <window_info id="Capture Tool" order="5" />
354 361
       <window_info id="Favorites" order="6" side_tool="true" />
355 362
       <window_info anchor="bottom" id="Message" order="0" />
356
-      <window_info anchor="bottom" id="Find" order="1" />
363
+      <window_info anchor="bottom" id="Find" order="1" weight="0.3296355" />
357 364
       <window_info anchor="bottom" id="Run" order="2" weight="0.31269842" />
358 365
       <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
359 366
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
@@ -363,7 +370,7 @@
363 370
       <window_info anchor="bottom" id="Terminal" order="8" />
364 371
       <window_info anchor="bottom" id="Event Log" order="9" side_tool="true" />
365 372
       <window_info anchor="bottom" id="Version Control" order="10" show_stripe_button="false" />
366
-      <window_info anchor="bottom" id="Messages" order="11" weight="0.32857144" />
373
+      <window_info anchor="bottom" id="Messages" order="11" weight="0.3280507" />
367 374
       <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
368 375
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
369 376
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
@@ -412,20 +419,22 @@
412 419
   <component name="VcsContentAnnotationSettings">
413 420
     <option name="myLimit" value="2678400000" />
414 421
   </component>
422
+  <component name="XDebuggerManager">
423
+    <breakpoint-manager>
424
+      <breakpoints>
425
+        <line-breakpoint enabled="true" type="java-line">
426
+          <url>file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java</url>
427
+          <line>176</line>
428
+          <properties />
429
+          <option name="timeStamp" value="1" />
430
+        </line-breakpoint>
431
+      </breakpoints>
432
+    </breakpoint-manager>
433
+  </component>
415 434
   <component name="editorHistoryManager">
416 435
     <entry file="file://$PROJECT_DIR$/src/main/java/.deleteme">
417 436
       <provider selected="true" editor-type-id="text-editor" />
418 437
     </entry>
419
-    <entry file="file://$PROJECT_DIR$/README.md">
420
-      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
421
-        <state split_layout="SECOND">
422
-          <first_editor relative-caret-position="195">
423
-            <caret line="13" selection-start-line="13" selection-end-line="13" />
424
-          </first_editor>
425
-          <second_editor />
426
-        </state>
427
-      </provider>
428
-    </entry>
429 438
     <entry file="file://$PROJECT_DIR$/src/test/java/ListTest.java">
430 439
       <provider selected="true" editor-type-id="text-editor">
431 440
         <state>
@@ -435,8 +444,8 @@
435 444
     </entry>
436 445
     <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
437 446
       <provider selected="true" editor-type-id="text-editor">
438
-        <state relative-caret-position="53">
439
-          <caret line="86" column="9" lean-forward="true" selection-start-line="86" selection-start-column="9" selection-end-line="86" selection-end-column="9" />
447
+        <state relative-caret-position="990">
448
+          <caret line="84" column="28" lean-forward="true" selection-start-line="84" selection-start-column="28" selection-end-line="84" selection-end-column="28" />
440 449
           <folding>
441 450
             <element signature="e#102#103#0" expanded="true" />
442 451
             <element signature="e#137#138#0" expanded="true" />
@@ -462,10 +471,95 @@
462 471
     </entry>
463 472
     <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
464 473
       <provider selected="true" editor-type-id="text-editor">
465
-        <state relative-caret-position="390">
466
-          <caret line="184" column="36" lean-forward="true" selection-start-line="184" selection-start-column="36" selection-end-line="184" selection-end-column="36" />
474
+        <state relative-caret-position="125">
475
+          <caret line="17" column="5" lean-forward="true" selection-start-line="17" selection-start-column="5" selection-end-line="17" selection-end-column="5" />
476
+          <folding>
477
+            <element signature="imports" expanded="true" />
478
+            <element signature="method#getTestInt#0;class#MyArrayListTest#0" />
479
+            <element signature="method#removeIntTest#0;class#MyArrayListTest#0" />
480
+            <element signature="method#setIntTest#0;class#MyArrayListTest#0" />
481
+            <element signature="method#clearIntTest#0;class#MyArrayListTest#0" />
482
+            <element signature="method#addTestString#0;class#MyArrayListTest#0" />
483
+            <element signature="method#getTestString#0;class#MyArrayListTest#0" />
484
+            <element signature="method#removeStringTest#0;class#MyArrayListTest#0" />
485
+            <element signature="method#setStringTest#0;class#MyArrayListTest#0" />
486
+            <element signature="method#clearStringTest#0;class#MyArrayListTest#0" />
487
+            <element signature="method#emptyTrueTest#0;class#MyArrayListTest#0" />
488
+            <element signature="method#containsTrueTest#0;class#MyArrayListTest#0" />
489
+            <element signature="method#emptyFalseTest#0;class#MyArrayListTest#0" />
490
+            <element signature="method#containsFalseTest#0;class#MyArrayListTest#0" />
491
+            <element signature="method#indexOfTest#0;class#MyArrayListTest#0" />
492
+            <element signature="method#indexOfNoTest#0;class#MyArrayListTest#0" />
493
+            <element signature="method#addAtIndex#0;class#MyArrayListTest#0" />
494
+            <element signature="method#equalsTrueTest#0;class#MyArrayListTest#0" />
495
+            <element signature="method#equalsTrueTest#1;class#MyArrayListTest#0" />
496
+            <element signature="method#equalsFalseTest2#0;class#MyArrayListTest#0" />
497
+          </folding>
498
+        </state>
499
+      </provider>
500
+    </entry>
501
+    <entry file="file://$PROJECT_DIR$/src/test/java/TestMySet.java">
502
+      <provider selected="true" editor-type-id="text-editor">
503
+        <state relative-caret-position="464">
504
+          <caret line="40" lean-forward="true" selection-start-line="40" selection-end-line="40" />
505
+          <folding>
506
+            <element signature="imports" expanded="true" />
507
+          </folding>
508
+        </state>
509
+      </provider>
510
+    </entry>
511
+    <entry file="file://$PROJECT_DIR$/README.md">
512
+      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
513
+        <state split_layout="SECOND">
514
+          <first_editor relative-caret-position="195">
515
+            <caret line="13" selection-start-line="13" selection-end-line="13" />
516
+          </first_editor>
517
+          <second_editor />
518
+        </state>
519
+      </provider>
520
+    </entry>
521
+    <entry file="file://$PROJECT_DIR$/src/test/java/MyMapTest.java">
522
+      <provider selected="true" editor-type-id="text-editor">
523
+        <state relative-caret-position="1845">
524
+          <caret line="165" lean-forward="true" selection-start-line="165" selection-end-line="165" />
525
+          <folding>
526
+            <element signature="imports" expanded="true" />
527
+            <element signature="method#containsKeyTrueTest#0;class#MyMapTest#0" />
528
+            <element signature="method#containsKeyFalseTest#0;class#MyMapTest#0" />
529
+            <element signature="method#containsKeyTrueTest#1;class#MyMapTest#0" />
530
+            <element signature="method#containsKeyFalseTest#1;class#MyMapTest#0" />
531
+            <element signature="method#entrySetTest#0;class#MyMapTest#0" />
532
+            <element signature="method#entryTrueTest#0;class#MyMapTest#0" />
533
+          </folding>
534
+        </state>
535
+      </provider>
536
+    </entry>
537
+    <entry file="file://$PROJECT_DIR$/src/main/java/MyMap.java">
538
+      <provider selected="true" editor-type-id="text-editor">
539
+        <state relative-caret-position="-139">
540
+          <caret line="72" column="28" lean-forward="true" selection-start-line="72" selection-start-column="28" selection-end-line="72" selection-end-column="28" />
541
+          <folding>
542
+            <element signature="imports" expanded="true" />
543
+            <element signature="e#497#498#0" expanded="true" />
544
+            <element signature="e#530#531#0" expanded="true" />
545
+            <element signature="e#882#883#0" expanded="true" />
546
+            <element signature="e#926#927#0" expanded="true" />
547
+            <element signature="e#1547#1548#0" expanded="true" />
548
+            <element signature="e#1582#1583#0" expanded="true" />
549
+          </folding>
550
+        </state>
551
+      </provider>
552
+    </entry>
553
+    <entry file="file://$PROJECT_DIR$/src/main/java/MySet.java">
554
+      <provider selected="true" editor-type-id="text-editor">
555
+        <state relative-caret-position="389">
556
+          <caret line="40" column="8" selection-start-line="40" selection-start-column="8" selection-end-line="40" selection-end-column="8" />
467 557
           <folding>
468 558
             <element signature="imports" expanded="true" />
559
+            <element signature="e#191#192#0" expanded="true" />
560
+            <element signature="e#228#229#0" expanded="true" />
561
+            <element signature="e#258#259#0" expanded="true" />
562
+            <element signature="e#298#299#0" expanded="true" />
469 563
           </folding>
470 564
         </state>
471 565
       </provider>

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

@@ -97,4 +97,13 @@ public class MyArrayList <E> {
97 97
         return -1;
98 98
     }
99 99
 
100
+    public boolean equals(Object [] o){
101
+        for(int i = 0; i < arr.length;i++){
102
+            if (arr[i] != o[i]){
103
+                return false;
104
+            }
105
+        }
106
+        return true;
107
+    }
108
+
100 109
 }

+ 115
- 0
src/main/java/MyMap.java 查看文件

@@ -0,0 +1,115 @@
1
+import java.util.ArrayList;
2
+import java.util.concurrent.LinkedBlockingDeque;
3
+
4
+public class MyMap {
5
+
6
+    MySet set;
7
+    ArrayList arrayList;
8
+
9
+    public MyMap(){
10
+        set = new MySet();
11
+        arrayList = new ArrayList();
12
+    }
13
+
14
+    /*
15
+    public MySet getSet(){return set;}
16
+
17
+    public void setSet(MySet set){this.set = set;}
18
+
19
+    public ArrayList getArrayList(){return arrayList;}
20
+
21
+    public void setArrayList(ArrayList arrayList){this.arrayList = arrayList;}
22
+     */
23
+
24
+    public int size() {
25
+        return set.size();
26
+    }
27
+
28
+    public void add(Object key, Object value) {
29
+        set.add(key);
30
+        arrayList.add(value);
31
+    }
32
+
33
+    public boolean containsKey(Object o) {
34
+
35
+        return set.contains(o);
36
+    }
37
+
38
+    public boolean containsValue(Object o){
39
+        return arrayList.contains(o);
40
+    }
41
+
42
+    public boolean isEmpty(){
43
+        if(set.isEmpty() && arrayList.isEmpty()){
44
+            return true;}
45
+        return false;
46
+    }
47
+
48
+    public void remove(Object key) {
49
+        for (int i = 0; i <set.size();i++){
50
+            if (set.getArr()[i] == key){
51
+                set.remove(i);
52
+                arrayList.remove(i);
53
+            }
54
+    }
55
+    }
56
+
57
+    public void clear() {
58
+        set.clear();
59
+        arrayList.clear();
60
+
61
+    }
62
+
63
+    public Object [][] entrySet(){
64
+        Object [] [] entrySet = new Object [set.size()][2];
65
+        for(int i = 0; i < set.size(); i++){
66
+            entrySet[i] = new Object[]{
67
+                    set.get(i),arrayList.get(i)};
68
+            }
69
+        return entrySet;
70
+
71
+    }
72
+    public Object[] valueSet(){
73
+        return set.getArr();
74
+    }
75
+
76
+    @Override
77
+    public boolean equals(Object obj) {
78
+        if (obj instanceof MyMap){
79
+            MyMap compareMap = (MyMap) obj;
80
+            for(int i =0; i < set.size(); i++) {
81
+                for (int j = 0; j < 2; j++) {
82
+                    if (compareMap.entrySet()[j][i] == this.entrySet()[i][j]) {
83
+                        return true;
84
+                    }
85
+                    return false;
86
+                }}}
87
+                return false;
88
+            }
89
+
90
+    public Object get(Object key) {
91
+        for (int i = 0; i < set.size();i++){
92
+            if(key == set.get(i)){
93
+                return arrayList.getArr()[i];
94
+            }
95
+        }
96
+        return -1;
97
+    }
98
+    public Object getOrDefault(Object key, Object o){
99
+        for (int i = 0; i< set.size();i++){
100
+            if(key==set.get(i)){
101
+                return arrayList.getArr()[i];
102
+            }
103
+        }
104
+        return o;
105
+    }
106
+    public void replace(Object key, Object value){
107
+        for (int i = 0; i < set.size();i++){
108
+            if (set.getArr()[i] ==key){
109
+                arrayList.getArr()[i]=value;
110
+            }
111
+        }
112
+    }
113
+
114
+    }
115
+

+ 48
- 0
src/main/java/MySet.java 查看文件

@@ -0,0 +1,48 @@
1
+import java.lang.reflect.Array;
2
+import java.util.ArrayList;
3
+import java.util.Arrays;
4
+
5
+public class MySet <T> extends ArrayList {
6
+
7
+    private MyArrayList <
8
+    
9
+    public MySet(){
10
+        setArr(new Object[0]);
11
+    }
12
+
13
+    public MySet (int size) {
14
+        setArr(new Object[size]);
15
+    }
16
+
17
+    private void setArr(Object[] objects) {
18
+    }
19
+
20
+    @Override
21
+    public boolean add(Object o){
22
+        if(set.contains(o)){
23
+            throw new IllegalArgumentException("value already exist in set");
24
+        }
25
+    }
26
+//        if(!contains(o)){
27
+//            Object[] temp = Arrays.copyOf(getArr(),getArr().length+1);
28
+//            temp[temp.length-1] = o;
29
+//            setArr(temp);
30
+//            return true;}
31
+//        return false;
32
+//    }
33
+
34
+
35
+    private int[] getArr() {
36
+        return Arr;
37
+
38
+    }
39
+
40
+    public void clear() {
41
+        
42
+
43
+    }
44
+    
45
+
46
+    public boolean contains(String party) {
47
+    }
48
+}

+ 34
- 0
src/test/java/MyArrayListTest.java 查看文件

@@ -7,6 +7,15 @@ import java.util.ArrayList;
7 7
 public class MyArrayListTest{
8 8
 
9 9
     ArrayList list = new ArrayList();
10
+    ArrayList list2 = new ArrayList(5);
11
+    Object [] compare = new Object[]{3,4,5};
12
+
13
+    @Test
14
+    public void sizeTest(){
15
+        int expected = 5;
16
+        int actual = list2.size();
17
+        Assert.assertEquals(expected,actual);
18
+    }
10 19
 
11 20
     @Test
12 21
     public void addTestInt(){
@@ -186,4 +195,29 @@ public class MyArrayListTest{
186 195
         System.out.println(list.get(4));
187 196
         Assert.assertEquals(expected,actual);
188 197
     }
198
+
199
+    @Test
200
+    public void equalsTrueTest(){
201
+        list.add(3);
202
+        list.add(4);
203
+        list.add(5);
204
+        Assert.assertTrue(list.equals(compare));
205
+    }
206
+    @Test
207
+    public void equalsFalseTest(){
208
+        list.add(7);
209
+        list.add(4);
210
+        list.add(5);
211
+        Assert.assertTrue(list.equals(compare));
212
+    }
213
+
214
+    @Test
215
+    public void equalsFalseTest2(){
216
+        list.add(3);
217
+        list.add(2);
218
+        list.add(5);
219
+        Assert.assertFalse(list.equals(compare));
220
+
221
+    }
222
+
189 223
 }

+ 166
- 0
src/test/java/MyMapTest.java 查看文件

@@ -0,0 +1,166 @@
1
+import org.junit.Assert;
2
+import org.junit.Test;
3
+
4
+public class MyMapTest {
5
+
6
+    MyMap map = new MyMap();
7
+    MyMap map2 = new MyMap();
8
+
9
+    @Test
10
+    public void addTest() {
11
+        map.add("keychain",4);
12
+        map.add ("chain",6);
13
+        int actual = map.size();
14
+        int expected = 2;
15
+        Assert.assertEquals(expected,actual);
16
+    }
17
+
18
+    @Test
19
+    public void clearTest() {
20
+        map.add("keychain",4);
21
+        map.add ("chain",6);
22
+        map.clear();
23
+        int actual = map.size();
24
+        int expected = 0;
25
+        Assert.assertEquals(expected,actual);
26
+    }
27
+
28
+    @Test
29
+    public void containsKeyTrueTest() {
30
+        map.add(3,4);
31
+        map.add(7,5);
32
+        boolean actual = map.containsKey(7);
33
+
34
+        Assert.assertTrue(actual);
35
+    }
36
+
37
+    @Test
38
+    public void containsKeyFalseTest() {
39
+        map.add(3,4);
40
+        map.add(7,5);
41
+        boolean actual = map.containsKey(2);
42
+
43
+        Assert.assertFalse(actual);
44
+    }
45
+
46
+    @Test
47
+    public void containsValueTrueTest() {
48
+        map.add(3,4);
49
+        map.add(7,5);
50
+        boolean actual = map.containsValue(7);
51
+
52
+        Assert.assertTrue(actual);
53
+    }
54
+
55
+    @Test
56
+    public void containsValueFalseTest() {
57
+        map.add(3,4);
58
+        map.add(7,5);
59
+        boolean actual = map.containsValue(2);
60
+
61
+        Assert.assertFalse(actual);
62
+    }
63
+
64
+    @Test
65
+    public void entrySetTest(){
66
+        map.add(3,4);
67
+        map.add(7,5);
68
+        map.add(5,6);
69
+
70
+        Object[][] actual = map.entrySet();
71
+        Object[][] expected = {{3,4}, {7,5}, {5,6}};
72
+
73
+        Assert.assertArrayEquals(expected,actual);
74
+
75
+    }
76
+
77
+    @Test
78
+    public void entryTrueTest(){
79
+        map.add(3,4);
80
+        map.add(7,5);
81
+        map2.add(3,4);
82
+        map2.add(7,5);
83
+
84
+       boolean actual = map.equals(map2);
85
+        Assert.assertTrue(actual);
86
+    }
87
+
88
+    @Test
89
+    public void entryFalseTest(){
90
+        map.add(3,4);
91
+        map.add(7,5);
92
+        map2.add(9,4);
93
+        map2.add(7,5);
94
+
95
+        boolean actual = map.equals(map2);
96
+        Assert.assertFalse(actual);
97
+    }
98
+
99
+    @Test
100
+    public void getTest(){
101
+        map.add(3,4);
102
+        map.add(7,5);
103
+        map2.add(5,6);
104
+        Object actual = map.get(7);
105
+        Object expected = 5;
106
+        Assert.assertEquals(expected,actual);
107
+
108
+    }
109
+
110
+    @Test
111
+    public void getOrDefaultTest(){
112
+        map.add(3,4);
113
+        map.add(7,5);
114
+        map.add(5,6);
115
+        Object actual = map.getOrDefault(9, "default");
116
+        Object expected = "default";
117
+        Assert.assertEquals(expected, actual);
118
+    }
119
+
120
+    @Test
121
+    public void isEmptyTrueTest(){
122
+        boolean actual = map.isEmpty();
123
+        Assert.assertTrue(actual);
124
+    }
125
+
126
+    @Test
127
+    public void isEmptyFalseTest(){
128
+        map.add(3,4);
129
+        boolean actual = map.isEmpty();
130
+        Assert.assertFalse(actual);
131
+    }
132
+
133
+    @Test
134
+    public void removeTest(){
135
+        map.add(3,4);
136
+        map.add(7,5);
137
+        map.add(5,6);
138
+        map.remove(7);
139
+        int actual = map.size();
140
+        int expected = 2;
141
+        Assert.assertEquals(expected, actual);
142
+    }
143
+
144
+    @Test
145
+    public void replaceTest(){
146
+        map.add(3,4);
147
+        map.add(7,5);
148
+        map.add(5,6);
149
+        map.replace(3,9);
150
+        Object actual = map. get(3);
151
+        Object expected = 9;
152
+        Assert.assertEquals(expected, actual);
153
+    }
154
+
155
+    @Test
156
+    public void valueSetTest(){
157
+        map.add(3,4);
158
+        map.add(7,5);
159
+        map.add(5,6);
160
+        Object[] actual = map.valueSet();
161
+        Object[] expected = {3,7,5};
162
+        Assert.assertArrayEquals(expected, actual);
163
+    }
164
+
165
+}
166
+

+ 76
- 0
src/test/java/TestMySet.java 查看文件

@@ -0,0 +1,76 @@
1
+import org.junit.Assert;
2
+import org.junit.Test;
3
+
4
+public class TestMySet {
5
+
6
+    MySet set = new MySet();
7
+    Object [] compare = new Object[]{3,4,5};
8
+
9
+    @Test
10
+    public void testAdd(){
11
+        set.add(3);
12
+        set.add(4);
13
+        set.add(3);
14
+        boolean actual = set.add(3);
15
+        boolean expected = false;
16
+        Assert.assertEquals(expected,actual);
17
+    }
18
+
19
+    @Test
20
+    public void testClear(){
21
+        set.add(9);
22
+        set.add(3);
23
+        set.add(5);
24
+        set.add(4);
25
+        set.clear();
26
+        int expected = 0;
27
+        int actual = set.size();
28
+        Assert.assertEquals(expected,actual);
29
+    }
30
+
31
+    @Test
32
+    public void testContainsTrue(){
33
+        set.add("Let's go");
34
+        set.add("Party");
35
+        set.add("Today");
36
+        set.add("is");
37
+        set.add("Friday");
38
+        boolean actual = set.contains("Party");
39
+        Assert.assertTrue(actual);
40
+    }
41
+
42
+    @Test
43
+    public void testContainsFalse(){
44
+        set.add("Let's go");
45
+        set.add("Party");
46
+        set.add("Today");
47
+        set.add("is");
48
+        set.add("Friday");
49
+        boolean actual = set.contains("When");
50
+        Assert.assertFalse(actual);
51
+
52
+    }
53
+    @Test
54
+    public void testEqualsTrue(){
55
+        set.add(3);
56
+        set.add(4);
57
+        set.add(5);
58
+        Assert.assertTrue(set.equals(compare));
59
+    }
60
+
61
+    @Test
62
+    public void testEqualsFalse(){
63
+        set.add(7);
64
+        set.add(4);
65
+        set.add(5);
66
+        Assert.assertFalse(set.equals(compare));
67
+    }
68
+
69
+    @Test
70
+    public void testEqualsFalse2(){
71
+        set.add(3);
72
+        set.add(2);
73
+        set.add(5);
74
+        Assert.assertFalse(set.equals(compare));
75
+    }
76
+}