Procházet zdrojové kódy

Completed MyArrayList,MySet & MyMap

Chaitali Patel před 6 roky
rodič
revize
6586b8568b

+ 276
- 178
.idea/workspace.xml Zobrazit soubor

@@ -1,19 +1,16 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <project version="4">
3 3
   <component name="ChangeListManager">
4
-    <list default="true" id="bd9afb1f-4a0c-42e6-baa9-fc6ee9e3a973" name="Default Changelist" comment="">
5
-      <change afterPath="$PROJECT_DIR$/.idea/codeStyles/Project.xml" afterDir="false" />
6
-      <change afterPath="$PROJECT_DIR$/.idea/codeStyles/codeStyleConfig.xml" afterDir="false" />
7
-      <change afterPath="$PROJECT_DIR$/.idea/dictionaries/chaitalipatel.xml" afterDir="false" />
8
-      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__junit_junit_4_12.xml" afterDir="false" />
9
-      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml" afterDir="false" />
10
-      <change afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
11
-      <change afterPath="$PROJECT_DIR$/src/main/java/MyArrayList.java" afterDir="false" />
12
-      <change afterPath="$PROJECT_DIR$/src/main/java/MyMap.java" afterDir="false" />
13
-      <change afterPath="$PROJECT_DIR$/src/main/java/MySet.java" afterDir="false" />
14
-      <change afterPath="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" afterDir="false" />
15
-      <change afterPath="$PROJECT_DIR$/src/test/java/MyMapTest.java" afterDir="false" />
16
-      <change afterPath="$PROJECT_DIR$/src/test/java/MySetTest.java" afterDir="false" />
4
+    <list default="true" id="754017dc-358c-44e9-9247-586e10ce519a" name="Default Changelist" comment="">
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
+      <change beforePath="$PROJECT_DIR$/src/main/java/MyArrayList.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/MyArrayList.java" afterDir="false" />
8
+      <change beforePath="$PROJECT_DIR$/src/main/java/MyMap.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/MyMap.java" afterDir="false" />
9
+      <change beforePath="$PROJECT_DIR$/src/main/java/MySet.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/MySet.java" afterDir="false" />
10
+      <change beforePath="$PROJECT_DIR$/src/test/java/.deleteme" beforeDir="false" />
11
+      <change beforePath="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" afterDir="false" />
12
+      <change beforePath="$PROJECT_DIR$/src/test/java/MyMapTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/MyMapTest.java" afterDir="false" />
13
+      <change beforePath="$PROJECT_DIR$/src/test/java/MySetTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/MySetTest.java" afterDir="false" />
17 14
     </list>
18 15
     <ignored path="$PROJECT_DIR$/target/" />
19 16
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@@ -28,50 +25,48 @@
28 25
         <counts>
29 26
           <entry key="project.closed" value="1" />
30 27
           <entry key="project.open.time.1" value="1" />
31
-          <entry key="project.open.time.15" value="1" />
28
+          <entry key="project.open.time.2" value="1" />
32 29
           <entry key="project.opened" value="2" />
33 30
         </counts>
34 31
       </usages-collector>
35 32
       <usages-collector id="statistics.file.extensions.open">
36 33
         <counts>
37
-          <entry key="deleteme" value="2" />
38
-          <entry key="java" value="8" />
34
+          <entry key="java" value="16" />
39 35
         </counts>
40 36
       </usages-collector>
41 37
       <usages-collector id="statistics.file.types.open">
42 38
         <counts>
43
-          <entry key="JAVA" value="8" />
44
-          <entry key="PLAIN_TEXT" value="2" />
39
+          <entry key="JAVA" value="16" />
45 40
         </counts>
46 41
       </usages-collector>
47 42
       <usages-collector id="statistics.file.extensions.edit">
48 43
         <counts>
49
-          <entry key="java" value="1856" />
44
+          <entry key="java" value="2375" />
50 45
         </counts>
51 46
       </usages-collector>
52 47
       <usages-collector id="statistics.file.types.edit">
53 48
         <counts>
54
-          <entry key="JAVA" value="1856" />
49
+          <entry key="JAVA" value="2375" />
55 50
         </counts>
56 51
       </usages-collector>
57
-      <usages-collector id="statistics.spring.boot.run.usages" />
58
-      <usages-collector id="statistics.spring.boot.mvc.usages" />
59
-      <usages-collector id="statistics.js.language.service.starts" />
60
-      <usages-collector id="statistics.vcs.git.usages" />
61 52
     </session>
62 53
   </component>
63 54
   <component name="FileEditorManager">
64 55
     <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
65
-      <file pinned="false" current-in-tab="false">
56
+      <file pinned="false" current-in-tab="true">
66 57
         <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
67 58
           <provider selected="true" editor-type-id="text-editor">
68
-            <state relative-caret-position="177">
69
-              <caret line="64" column="15" lean-forward="true" selection-start-line="64" selection-start-column="15" selection-end-line="64" selection-end-column="15" />
59
+            <state relative-caret-position="255">
60
+              <caret line="17" column="5" lean-forward="true" selection-start-line="17" selection-start-column="5" selection-end-line="17" selection-end-column="5" />
70 61
               <folding>
71
-                <element signature="e#207#208#0" expanded="true" />
72
-                <element signature="e#234#235#0" expanded="true" />
73
-                <element signature="e#924#925#0" expanded="true" />
74
-                <element signature="e#959#960#0" expanded="true" />
62
+                <element signature="e#185#186#0" expanded="true" />
63
+                <element signature="e#227#228#0" expanded="true" />
64
+                <element signature="e#263#264#0" expanded="true" />
65
+                <element signature="e#308#309#0" expanded="true" />
66
+                <element signature="e#332#333#0" expanded="true" />
67
+                <element signature="e#367#368#0" expanded="true" />
68
+                <element signature="e#1599#1600#0" expanded="true" />
69
+                <element signature="e#1636#1637#0" expanded="true" />
75 70
               </folding>
76 71
             </state>
77 72
           </provider>
@@ -80,62 +75,53 @@
80 75
       <file pinned="false" current-in-tab="false">
81 76
         <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
82 77
           <provider selected="true" editor-type-id="text-editor">
83
-            <state relative-caret-position="825">
84
-              <caret line="55" column="9" lean-forward="true" selection-start-line="55" selection-start-column="9" selection-end-line="55" selection-end-column="9" />
85
-              <folding>
86
-                <element signature="imports" expanded="true" />
87
-              </folding>
78
+            <state relative-caret-position="207">
79
+              <caret line="79" column="23" lean-forward="true" selection-start-line="79" selection-start-column="23" selection-end-line="79" selection-end-column="23" />
88 80
             </state>
89 81
           </provider>
90 82
         </entry>
91 83
       </file>
92 84
       <file pinned="false" current-in-tab="false">
93
-        <entry file="file://$PROJECT_DIR$/src/main/java/MySet.java">
85
+        <entry file="file://$PROJECT_DIR$/src/main/java/MyMap.java">
94 86
           <provider selected="true" editor-type-id="text-editor">
95 87
             <state relative-caret-position="105">
96
-              <caret line="7" column="34" lean-forward="true" selection-start-line="7" selection-start-column="34" selection-end-line="7" selection-end-column="34" />
88
+              <caret line="7" column="13" lean-forward="true" selection-start-line="7" selection-start-column="13" selection-end-line="7" selection-end-column="13" />
97 89
               <folding>
98
-                <element signature="e#304#305#0" expanded="true" />
99
-                <element signature="e#331#332#0" expanded="true" />
100
-                <element signature="e#1042#1043#0" expanded="true" />
101
-                <element signature="e#1077#1078#0" expanded="true" />
90
+                <element signature="e#175#176#0" expanded="true" />
91
+                <element signature="e#202#203#0" expanded="true" />
92
+                <element signature="e#664#665#0" expanded="true" />
93
+                <element signature="e#692#693#0" expanded="true" />
94
+                <element signature="e#753#754#0" expanded="true" />
95
+                <element signature="e#794#795#0" expanded="true" />
96
+                <element signature="e#1560#1561#0" expanded="true" />
97
+                <element signature="e#1589#1590#0" expanded="true" />
102 98
               </folding>
103 99
             </state>
104 100
           </provider>
105 101
         </entry>
106 102
       </file>
107 103
       <file pinned="false" current-in-tab="false">
108
-        <entry file="file://$PROJECT_DIR$/src/test/java/MySetTest.java">
104
+        <entry file="file://$PROJECT_DIR$/src/main/java/MySet.java">
109 105
           <provider selected="true" editor-type-id="text-editor">
110
-            <state relative-caret-position="237">
111
-              <caret line="77" column="26" selection-start-line="77" selection-start-column="26" selection-end-line="77" selection-end-column="26" />
106
+            <state relative-caret-position="570">
107
+              <caret line="38" column="17" selection-start-line="38" selection-start-column="17" selection-end-line="38" selection-end-column="17" />
112 108
               <folding>
113
-                <element signature="imports" expanded="true" />
109
+                <element signature="e#119#120#0" expanded="true" />
110
+                <element signature="e#159#160#0" expanded="true" />
111
+                <element signature="e#189#190#0" expanded="true" />
112
+                <element signature="e#232#233#0" expanded="true" />
113
+                <element signature="e#256#257#0" expanded="true" />
114
+                <element signature="e#289#290#0" expanded="true" />
114 115
               </folding>
115 116
             </state>
116 117
           </provider>
117 118
         </entry>
118 119
       </file>
119 120
       <file pinned="false" current-in-tab="false">
120
-        <entry file="file://$PROJECT_DIR$/src/main/java/MyMap.java">
121
-          <provider selected="true" editor-type-id="text-editor">
122
-            <state relative-caret-position="30">
123
-              <caret line="2" column="26" lean-forward="true" selection-start-line="2" selection-start-column="26" selection-end-line="2" selection-end-column="26" />
124
-              <folding>
125
-                <element signature="e#217#218#0" expanded="true" />
126
-                <element signature="e#244#245#0" expanded="true" />
127
-                <element signature="e#960#961#0" expanded="true" />
128
-                <element signature="e#995#996#0" expanded="true" />
129
-              </folding>
130
-            </state>
131
-          </provider>
132
-        </entry>
133
-      </file>
134
-      <file pinned="false" current-in-tab="true">
135 121
         <entry file="file://$PROJECT_DIR$/src/test/java/MyMapTest.java">
136 122
           <provider selected="true" editor-type-id="text-editor">
137
-            <state relative-caret-position="75">
138
-              <caret line="5" column="28" lean-forward="true" selection-start-line="5" selection-start-column="28" selection-end-line="5" selection-end-column="28" />
123
+            <state relative-caret-position="1020">
124
+              <caret line="68" column="12" lean-forward="true" selection-start-line="68" selection-start-column="12" selection-end-line="68" selection-end-column="12" />
139 125
               <folding>
140 126
                 <element signature="imports" expanded="true" />
141 127
               </folding>
@@ -145,12 +131,16 @@
145 131
       </file>
146 132
     </leaf>
147 133
   </component>
148
-  <component name="FileTemplateManagerImpl">
149
-    <option name="RECENT_TEMPLATES">
150
-      <list>
151
-        <option value="Class" />
152
-      </list>
153
-    </option>
134
+  <component name="FindInProjectRecents">
135
+    <findStrings>
136
+      <find>array</find>
137
+      <find>mySet</find>
138
+    </findStrings>
139
+    <replaceStrings>
140
+      <replace />
141
+      <replace>set</replace>
142
+      <replace>map</replace>
143
+    </replaceStrings>
154 144
   </component>
155 145
   <component name="Git.Settings">
156 146
     <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
@@ -158,12 +148,12 @@
158 148
   <component name="IdeDocumentHistory">
159 149
     <option name="CHANGED_PATHS">
160 150
       <list>
161
-        <option value="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" />
162
-        <option value="$PROJECT_DIR$/src/main/java/MyArrayList.java" />
163 151
         <option value="$PROJECT_DIR$/src/test/java/MySetTest.java" />
164 152
         <option value="$PROJECT_DIR$/src/main/java/MySet.java" />
165
-        <option value="$PROJECT_DIR$/src/main/java/MyMap.java" />
166 153
         <option value="$PROJECT_DIR$/src/test/java/MyMapTest.java" />
154
+        <option value="$PROJECT_DIR$/src/main/java/MyMap.java" />
155
+        <option value="$PROJECT_DIR$/src/main/java/MyArrayList.java" />
156
+        <option value="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" />
167 157
       </list>
168 158
     </option>
169 159
   </component>
@@ -174,9 +164,9 @@
174 164
     <sorting>DEFINITION_ORDER</sorting>
175 165
   </component>
176 166
   <component name="ProjectFrameBounds">
177
-    <option name="x" value="478" />
167
+    <option name="x" value="602" />
178 168
     <option name="y" value="23" />
179
-    <option name="width" value="802" />
169
+    <option name="width" value="678" />
180 170
     <option name="height" value="715" />
181 171
   </component>
182 172
   <component name="ProjectInspectionProfilesVisibleTreeState">
@@ -230,6 +220,7 @@
230 220
     </navigator>
231 221
     <panes>
232 222
       <pane id="PackagesPane" />
223
+      <pane id="Scope" />
233 224
       <pane id="ProjectPane">
234 225
         <subPane>
235 226
           <expand>
@@ -272,18 +263,20 @@
272 263
           <select />
273 264
         </subPane>
274 265
       </pane>
275
-      <pane id="Scope" />
276 266
     </panes>
277 267
   </component>
278 268
   <component name="PropertiesComponent">
279 269
     <property name="WebServerToolWindowFactoryState" value="false" />
280 270
     <property name="aspect.path.notification.shown" value="true" />
281
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1542401172680" />
271
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1543172857979" />
282 272
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit4" />
283 273
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrarySuperClass.JUnit4" value="" />
284
-    <property name="last_opened_file_path" value="$PROJECT_DIR$/pom.xml" />
274
+    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
285 275
     <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
286 276
     <property name="nodejs_npm_path_reset_for_default_project" value="true" />
277
+    <property name="project.structure.last.edited" value="Project" />
278
+    <property name="project.structure.proportion" value="0.0" />
279
+    <property name="project.structure.side.proportion" value="0.0" />
287 280
     <property name="settings.editor.selected.configurable" value="preferences.sourceCode" />
288 281
   </component>
289 282
   <component name="RecentsManager">
@@ -306,65 +299,67 @@
306 299
       </list>
307 300
     </option>
308 301
   </component>
309
-  <component name="RunManager" selected="JUnit.MyMapTest">
310
-    <configuration name="MyArrayListTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
302
+  <component name="RunManager" selected="JUnit.MyArrayListTest.set">
303
+    <configuration name="All in generics" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
311 304
       <module name="generics" />
312 305
       <option name="PACKAGE_NAME" value="" />
313
-      <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
306
+      <option name="TEST_OBJECT" value="package" />
314 307
       <method v="2">
315 308
         <option name="Make" enabled="true" />
316 309
       </method>
317 310
     </configuration>
318
-    <configuration name="MyMapTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
311
+    <configuration name="MyArrayListTest.set" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
319 312
       <module name="generics" />
320 313
       <option name="PACKAGE_NAME" value="" />
321
-      <option name="MAIN_CLASS_NAME" value="MyMapTest" />
314
+      <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
315
+      <option name="METHOD_NAME" value="set" />
316
+      <option name="TEST_OBJECT" value="method" />
322 317
       <method v="2">
323 318
         <option name="Make" enabled="true" />
324 319
       </method>
325 320
     </configuration>
326
-    <configuration name="MySetTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
321
+    <configuration name="MyMapTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
327 322
       <module name="generics" />
328 323
       <option name="PACKAGE_NAME" value="" />
329
-      <option name="MAIN_CLASS_NAME" value="MySetTest" />
324
+      <option name="MAIN_CLASS_NAME" value="MyMapTest" />
330 325
       <method v="2">
331 326
         <option name="Make" enabled="true" />
332 327
       </method>
333 328
     </configuration>
334
-    <configuration name="MySetTest.add2" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
329
+    <configuration name="MyMapTest.testClear" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
335 330
       <module name="generics" />
336 331
       <option name="PACKAGE_NAME" value="" />
337
-      <option name="MAIN_CLASS_NAME" value="MySetTest" />
338
-      <option name="METHOD_NAME" value="add2" />
332
+      <option name="MAIN_CLASS_NAME" value="MyMapTest" />
333
+      <option name="METHOD_NAME" value="testClear" />
339 334
       <option name="TEST_OBJECT" value="method" />
340 335
       <method v="2">
341 336
         <option name="Make" enabled="true" />
342 337
       </method>
343 338
     </configuration>
344
-    <configuration name="MySetTest.isEmpty" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
339
+    <configuration name="MyMapTest.testContainsValues" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
345 340
       <module name="generics" />
346 341
       <option name="PACKAGE_NAME" value="" />
347
-      <option name="MAIN_CLASS_NAME" value="MySetTest" />
348
-      <option name="METHOD_NAME" value="isEmpty" />
342
+      <option name="MAIN_CLASS_NAME" value="MyMapTest" />
343
+      <option name="METHOD_NAME" value="testContainsValues" />
349 344
       <option name="TEST_OBJECT" value="method" />
350 345
       <method v="2">
351 346
         <option name="Make" enabled="true" />
352 347
       </method>
353 348
     </configuration>
354 349
     <list>
355
-      <item itemvalue="JUnit.MySetTest" />
356
-      <item itemvalue="JUnit.MySetTest.add2" />
357
-      <item itemvalue="JUnit.MyArrayListTest" />
358
-      <item itemvalue="JUnit.MySetTest.isEmpty" />
359 350
       <item itemvalue="JUnit.MyMapTest" />
351
+      <item itemvalue="JUnit.MyMapTest.testContainsValues" />
352
+      <item itemvalue="JUnit.MyMapTest.testClear" />
353
+      <item itemvalue="JUnit.All in generics" />
354
+      <item itemvalue="JUnit.MyArrayListTest.set" />
360 355
     </list>
361 356
     <recent_temporary>
362 357
       <list>
358
+        <item itemvalue="JUnit.MyArrayListTest.set" />
359
+        <item itemvalue="JUnit.All in generics" />
363 360
         <item itemvalue="JUnit.MyMapTest" />
364
-        <item itemvalue="JUnit.MyArrayListTest" />
365
-        <item itemvalue="JUnit.MySetTest" />
366
-        <item itemvalue="JUnit.MySetTest.isEmpty" />
367
-        <item itemvalue="JUnit.MySetTest.add2" />
361
+        <item itemvalue="JUnit.MyMapTest.testClear" />
362
+        <item itemvalue="JUnit.MyMapTest.testContainsValues" />
368 363
       </list>
369 364
     </recent_temporary>
370 365
   </component>
@@ -373,84 +368,113 @@
373 368
   </component>
374 369
   <component name="TaskManager">
375 370
     <task active="true" id="Default" summary="Default task">
376
-      <changelist id="bd9afb1f-4a0c-42e6-baa9-fc6ee9e3a973" name="Default Changelist" comment="" />
377
-      <created>1542227956091</created>
371
+      <changelist id="754017dc-358c-44e9-9247-586e10ce519a" name="Default Changelist" comment="" />
372
+      <created>1543149908731</created>
378 373
       <option name="number" value="Default" />
379 374
       <option name="presentableId" value="Default" />
380
-      <updated>1542227956091</updated>
381
-      <workItem from="1542227958635" duration="2650000" />
382
-      <workItem from="1542244291231" duration="19221000" />
375
+      <updated>1543149908731</updated>
376
+      <workItem from="1543149911743" duration="2248000" />
377
+      <workItem from="1543152959563" duration="16029000" />
383 378
     </task>
384 379
     <servers />
385 380
   </component>
386 381
   <component name="TestHistory">
387
-    <history-entry file="MySetTest - 2018.11.16 at 14h 38m 35s.xml">
388
-      <configuration name="MySetTest" configurationId="JUnit" />
382
+    <history-entry file="MyMapTest_testContainsValues - 2018.11.25 at 13h 39m 12s.xml">
383
+      <configuration name="MyMapTest.testContainsValues" configurationId="JUnit" />
389 384
     </history-entry>
390
-    <history-entry file="MySetTest_add2 - 2018.11.16 at 14h 39m 22s.xml">
391
-      <configuration name="MySetTest.add2" configurationId="JUnit" />
385
+    <history-entry file="MyMapTest_testContainsValues - 2018.11.25 at 13h 41m 53s.xml">
386
+      <configuration name="MyMapTest.testContainsValues" configurationId="JUnit" />
392 387
     </history-entry>
393
-    <history-entry file="MySetTest_size - 2018.11.16 at 14h 41m 42s.xml">
394
-      <configuration name="MySetTest.size" configurationId="JUnit" />
388
+    <history-entry file="MyMapTest_testContainsValues - 2018.11.25 at 13h 42m 16s.xml">
389
+      <configuration name="MyMapTest.testContainsValues" configurationId="JUnit" />
395 390
     </history-entry>
396
-    <history-entry file="MyArrayListTest - 2018.11.16 at 14h 41m 58s.xml">
397
-      <configuration name="MyArrayListTest" configurationId="JUnit" />
391
+    <history-entry file="MyMapTest_testClear - 2018.11.25 at 13h 42m 37s.xml">
392
+      <configuration name="MyMapTest.testClear" configurationId="JUnit" />
398 393
     </history-entry>
399
-    <history-entry file="MySetTest_add2 - 2018.11.16 at 14h 42m 56s.xml">
400
-      <configuration name="MySetTest.add2" configurationId="JUnit" />
394
+    <history-entry file="MyMapTest_testClear - 2018.11.25 at 13h 44m 04s.xml">
395
+      <configuration name="MyMapTest.testClear" configurationId="JUnit" />
401 396
     </history-entry>
402
-    <history-entry file="MySetTest - 2018.11.16 at 14h 55m 39s.xml">
403
-      <configuration name="MySetTest" configurationId="JUnit" />
397
+    <history-entry file="MyMapTest_testClear - 2018.11.25 at 13h 44m 19s.xml">
398
+      <configuration name="MyMapTest.testClear" configurationId="JUnit" />
404 399
     </history-entry>
405
-    <history-entry file="MySetTest - 2018.11.16 at 14h 57m 01s.xml">
406
-      <configuration name="MySetTest" configurationId="JUnit" />
400
+    <history-entry file="MyMapTest - 2018.11.25 at 13h 44m 40s.xml">
401
+      <configuration name="MyMapTest" configurationId="JUnit" />
407 402
     </history-entry>
408
-    <history-entry file="MySetTest - 2018.11.16 at 14h 57m 42s.xml">
409
-      <configuration name="MySetTest" configurationId="JUnit" />
403
+    <history-entry file="MyMapTest - 2018.11.25 at 13h 45m 07s.xml">
404
+      <configuration name="MyMapTest" configurationId="JUnit" />
410 405
     </history-entry>
411
-    <history-entry file="MySetTest - 2018.11.16 at 15h 23m 35s.xml">
412
-      <configuration name="MySetTest" configurationId="JUnit" />
406
+    <history-entry file="All_in_generics - 2018.11.25 at 13h 45m 19s.xml">
407
+      <configuration name="All in generics" configurationId="JUnit" />
413 408
     </history-entry>
414
-    <history-entry file="MyArrayListTest - 2018.11.16 at 15h 30m 32s.xml">
415
-      <configuration name="MyArrayListTest" configurationId="JUnit" />
409
+    <history-entry file="MyArrayListTest_set - 2018.11.25 at 14h 05m 31s.xml">
410
+      <configuration name="MyArrayListTest.set" configurationId="JUnit" />
416 411
     </history-entry>
417 412
   </component>
418 413
   <component name="TimeTrackingManager">
419
-    <option name="totallyTimeSpent" value="21871000" />
414
+    <option name="totallyTimeSpent" value="18277000" />
420 415
   </component>
421 416
   <component name="ToolWindowManager">
422
-    <frame x="478" y="23" width="802" height="715" extended-state="0" />
423
-    <editor active="true" />
417
+    <frame x="602" y="23" width="678" height="715" extended-state="0" />
424 418
     <layout>
425
-      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.2986842" />
419
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.2735849" />
426 420
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
427 421
       <window_info id="Image Layers" order="2" />
428 422
       <window_info id="Designer" order="3" />
429 423
       <window_info id="UI Designer" order="4" />
430 424
       <window_info id="Capture Tool" order="5" />
431 425
       <window_info id="Favorites" order="6" side_tool="true" />
432
-      <window_info anchor="bottom" id="Messages" weight="0.32465753" />
433 426
       <window_info anchor="bottom" id="Message" order="0" />
434 427
       <window_info anchor="bottom" id="Find" order="1" />
435
-      <window_info anchor="bottom" id="Run" order="2" visible="true" weight="0.32744783" />
428
+      <window_info anchor="bottom" id="Run" order="2" weight="0.27929375" />
436 429
       <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
437 430
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
438 431
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
439 432
       <window_info anchor="bottom" id="TODO" order="6" />
440
-      <window_info anchor="bottom" id="Database Changes" order="7" show_stripe_button="false" />
441
-      <window_info anchor="bottom" id="Terminal" order="8" />
442
-      <window_info anchor="bottom" id="Event Log" order="9" side_tool="true" />
443
-      <window_info anchor="bottom" id="Version Control" order="10" show_stripe_button="false" />
433
+      <window_info anchor="bottom" id="Version Control" order="7" show_stripe_button="false" />
434
+      <window_info anchor="bottom" id="Database Changes" order="8" show_stripe_button="false" />
435
+      <window_info active="true" anchor="bottom" id="Terminal" order="9" visible="true" weight="0.32905295" />
436
+      <window_info anchor="bottom" id="Event Log" order="10" side_tool="true" />
437
+      <window_info anchor="bottom" id="Messages" order="11" weight="0.32744783" />
444 438
       <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
445 439
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
446 440
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
447 441
       <window_info anchor="right" id="Palette" order="3" />
448 442
       <window_info anchor="right" id="Capture Analysis" order="4" />
449
-      <window_info anchor="right" id="Theme Preview" order="5" />
450
-      <window_info anchor="right" id="Palette&#9;" order="6" />
451
-      <window_info anchor="right" id="Database" order="7" />
443
+      <window_info anchor="right" id="Database" order="5" />
444
+      <window_info anchor="right" id="Theme Preview" order="6" />
445
+      <window_info anchor="right" id="Palette&#9;" order="7" />
452 446
       <window_info anchor="right" id="Maven Projects" order="8" />
453 447
     </layout>
448
+    <layout-to-restore>
449
+      <window_info content_ui="combo" id="Project" order="0" weight="0.2552504" />
450
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
451
+      <window_info id="Image Layers" order="2" />
452
+      <window_info id="Designer" order="3" />
453
+      <window_info id="UI Designer" order="4" />
454
+      <window_info id="Capture Tool" order="5" />
455
+      <window_info id="Favorites" order="6" side_tool="true" />
456
+      <window_info anchor="bottom" id="Message" order="0" />
457
+      <window_info anchor="bottom" id="Find" order="1" />
458
+      <window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.27945206" />
459
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
460
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
461
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
462
+      <window_info anchor="bottom" id="TODO" order="6" />
463
+      <window_info anchor="bottom" id="Version Control" order="7" show_stripe_button="false" />
464
+      <window_info anchor="bottom" id="Database Changes" order="8" show_stripe_button="false" />
465
+      <window_info anchor="bottom" id="Terminal" order="9" />
466
+      <window_info anchor="bottom" id="Event Log" order="10" side_tool="true" />
467
+      <window_info anchor="bottom" id="Messages" order="11" weight="0.32876712" />
468
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
469
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
470
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
471
+      <window_info anchor="right" id="Palette" order="3" />
472
+      <window_info anchor="right" id="Capture Analysis" order="4" />
473
+      <window_info anchor="right" id="Database" order="5" />
474
+      <window_info anchor="right" id="Theme Preview" order="6" />
475
+      <window_info anchor="right" id="Palette&#9;" order="7" />
476
+      <window_info anchor="right" id="Maven Projects" order="8" />
477
+    </layout-to-restore>
454 478
   </component>
455 479
   <component name="TypeScriptGeneratedFilesManager">
456 480
     <option name="version" value="1" />
@@ -459,80 +483,154 @@
459 483
     <option name="myLimit" value="2678400000" />
460 484
   </component>
461 485
   <component name="editorHistoryManager">
462
-    <entry file="file://$PROJECT_DIR$/src/test/java/.deleteme">
463
-      <provider selected="true" editor-type-id="text-editor" />
464
-    </entry>
465
-    <entry file="file://$PROJECT_DIR$/src/main/java/.deleteme">
466
-      <provider selected="true" editor-type-id="text-editor" />
467
-    </entry>
468
-    <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
486
+    <entry file="file://$PROJECT_DIR$/src/test/java/MySetTest.java">
469 487
       <provider selected="true" editor-type-id="text-editor">
470
-        <state relative-caret-position="825">
471
-          <caret line="55" column="9" lean-forward="true" selection-start-line="55" selection-start-column="9" selection-end-line="55" selection-end-column="9" />
472
-          <folding>
473
-            <element signature="imports" expanded="true" />
474
-          </folding>
488
+        <state relative-caret-position="74">
489
+          <caret line="54" column="15" selection-start-line="54" selection-start-column="15" selection-end-line="54" selection-end-column="15" />
475 490
         </state>
476 491
       </provider>
477 492
     </entry>
478
-    <entry file="file://$PROJECT_DIR$/src/main/java/MySet.java">
493
+    <entry file="file://$PROJECT_DIR$/src/test/java/MyMapTest.java">
479 494
       <provider selected="true" editor-type-id="text-editor">
480
-        <state relative-caret-position="105">
481
-          <caret line="7" column="34" lean-forward="true" selection-start-line="7" selection-start-column="34" selection-end-line="7" selection-end-column="34" />
495
+        <state relative-caret-position="1020">
496
+          <caret line="68" column="12" lean-forward="true" selection-start-line="68" selection-start-column="12" selection-end-line="68" selection-end-column="12" />
482 497
           <folding>
483
-            <element signature="e#304#305#0" expanded="true" />
484
-            <element signature="e#331#332#0" expanded="true" />
485
-            <element signature="e#1042#1043#0" expanded="true" />
486
-            <element signature="e#1077#1078#0" expanded="true" />
498
+            <element signature="imports" expanded="true" />
487 499
           </folding>
488 500
         </state>
489 501
       </provider>
490 502
     </entry>
491
-    <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
503
+    <entry file="file://$PROJECT_DIR$/src/main/java/MySet.java">
492 504
       <provider selected="true" editor-type-id="text-editor">
493
-        <state relative-caret-position="177">
494
-          <caret line="64" column="15" lean-forward="true" selection-start-line="64" selection-start-column="15" selection-end-line="64" selection-end-column="15" />
505
+        <state relative-caret-position="570">
506
+          <caret line="38" column="17" selection-start-line="38" selection-start-column="17" selection-end-line="38" selection-end-column="17" />
495 507
           <folding>
496
-            <element signature="e#207#208#0" expanded="true" />
497
-            <element signature="e#234#235#0" expanded="true" />
498
-            <element signature="e#924#925#0" expanded="true" />
499
-            <element signature="e#959#960#0" expanded="true" />
508
+            <element signature="e#119#120#0" expanded="true" />
509
+            <element signature="e#159#160#0" expanded="true" />
510
+            <element signature="e#189#190#0" expanded="true" />
511
+            <element signature="e#232#233#0" expanded="true" />
512
+            <element signature="e#256#257#0" expanded="true" />
513
+            <element signature="e#289#290#0" expanded="true" />
500 514
           </folding>
501 515
         </state>
502 516
       </provider>
503 517
     </entry>
504 518
     <entry file="file://$PROJECT_DIR$/src/main/java/MyMap.java">
505 519
       <provider selected="true" editor-type-id="text-editor">
506
-        <state relative-caret-position="30">
507
-          <caret line="2" column="26" lean-forward="true" selection-start-line="2" selection-start-column="26" selection-end-line="2" selection-end-column="26" />
520
+        <state relative-caret-position="105">
521
+          <caret line="7" column="13" lean-forward="true" selection-start-line="7" selection-start-column="13" selection-end-line="7" selection-end-column="13" />
508 522
           <folding>
509
-            <element signature="e#217#218#0" expanded="true" />
510
-            <element signature="e#244#245#0" expanded="true" />
511
-            <element signature="e#960#961#0" expanded="true" />
512
-            <element signature="e#995#996#0" expanded="true" />
523
+            <element signature="e#175#176#0" expanded="true" />
524
+            <element signature="e#202#203#0" expanded="true" />
525
+            <element signature="e#664#665#0" expanded="true" />
526
+            <element signature="e#692#693#0" expanded="true" />
527
+            <element signature="e#753#754#0" expanded="true" />
528
+            <element signature="e#794#795#0" expanded="true" />
529
+            <element signature="e#1560#1561#0" expanded="true" />
530
+            <element signature="e#1589#1590#0" expanded="true" />
513 531
           </folding>
514 532
         </state>
515 533
       </provider>
516 534
     </entry>
517
-    <entry file="file://$PROJECT_DIR$/src/test/java/MySetTest.java">
535
+    <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
518 536
       <provider selected="true" editor-type-id="text-editor">
519
-        <state relative-caret-position="237">
520
-          <caret line="77" column="26" selection-start-line="77" selection-start-column="26" selection-end-line="77" selection-end-column="26" />
521
-          <folding>
522
-            <element signature="imports" expanded="true" />
523
-          </folding>
537
+        <state relative-caret-position="207">
538
+          <caret line="79" column="23" lean-forward="true" selection-start-line="79" selection-start-column="23" selection-end-line="79" selection-end-column="23" />
524 539
         </state>
525 540
       </provider>
526 541
     </entry>
527
-    <entry file="file://$PROJECT_DIR$/src/test/java/MyMapTest.java">
542
+    <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
528 543
       <provider selected="true" editor-type-id="text-editor">
529
-        <state relative-caret-position="75">
530
-          <caret line="5" column="28" lean-forward="true" selection-start-line="5" selection-start-column="28" selection-end-line="5" selection-end-column="28" />
544
+        <state relative-caret-position="255">
545
+          <caret line="17" column="5" lean-forward="true" selection-start-line="17" selection-start-column="5" selection-end-line="17" selection-end-column="5" />
531 546
           <folding>
532
-            <element signature="imports" expanded="true" />
547
+            <element signature="e#185#186#0" expanded="true" />
548
+            <element signature="e#227#228#0" expanded="true" />
549
+            <element signature="e#263#264#0" expanded="true" />
550
+            <element signature="e#308#309#0" expanded="true" />
551
+            <element signature="e#332#333#0" expanded="true" />
552
+            <element signature="e#367#368#0" expanded="true" />
553
+            <element signature="e#1599#1600#0" expanded="true" />
554
+            <element signature="e#1636#1637#0" expanded="true" />
533 555
           </folding>
534 556
         </state>
535 557
       </provider>
536 558
     </entry>
537 559
   </component>
560
+  <component name="masterDetails">
561
+    <states>
562
+      <state key="ArtifactsStructureConfigurable.UI">
563
+        <settings>
564
+          <artifact-editor />
565
+          <splitter-proportions>
566
+            <option name="proportions">
567
+              <list>
568
+                <option value="0.2" />
569
+              </list>
570
+            </option>
571
+          </splitter-proportions>
572
+        </settings>
573
+      </state>
574
+      <state key="FacetStructureConfigurable.UI">
575
+        <settings>
576
+          <last-edited>No facets are configured</last-edited>
577
+          <splitter-proportions>
578
+            <option name="proportions">
579
+              <list>
580
+                <option value="0.2" />
581
+              </list>
582
+            </option>
583
+          </splitter-proportions>
584
+        </settings>
585
+      </state>
586
+      <state key="GlobalLibrariesConfigurable.UI">
587
+        <settings>
588
+          <splitter-proportions>
589
+            <option name="proportions">
590
+              <list>
591
+                <option value="0.2" />
592
+              </list>
593
+            </option>
594
+          </splitter-proportions>
595
+        </settings>
596
+      </state>
597
+      <state key="JdkListConfigurable.UI">
598
+        <settings>
599
+          <last-edited>1.8</last-edited>
600
+          <splitter-proportions>
601
+            <option name="proportions">
602
+              <list>
603
+                <option value="0.2" />
604
+              </list>
605
+            </option>
606
+          </splitter-proportions>
607
+        </settings>
608
+      </state>
609
+      <state key="ModuleStructureConfigurable.UI">
610
+        <settings>
611
+          <last-edited>generics</last-edited>
612
+          <splitter-proportions>
613
+            <option name="proportions">
614
+              <list>
615
+                <option value="0.2" />
616
+                <option value="0.6" />
617
+              </list>
618
+            </option>
619
+          </splitter-proportions>
620
+        </settings>
621
+      </state>
622
+      <state key="ProjectLibrariesConfigurable.UI">
623
+        <settings>
624
+          <last-edited>Maven: junit:junit:4.12</last-edited>
625
+          <splitter-proportions>
626
+            <option name="proportions">
627
+              <list>
628
+                <option value="0.2" />
629
+              </list>
630
+            </option>
631
+          </splitter-proportions>
632
+        </settings>
633
+      </state>
634
+    </states>
635
+  </component>
538 636
 </project>

+ 0
- 0
src/main/java/.deleteme Zobrazit soubor


+ 1
- 1
src/main/java/MyArrayList.java Zobrazit soubor

@@ -1 +1 @@
1
-import java.util.Arrays;

public class MyArrayList <T> {

    //add, get, remove, set, clear, isEmpty, contains

    private Object[] objects = new Object[10];

    private int size=0;

    public int size(){
        return size;
    }


    public int add(T e){
        if(size<objects.length){
            objects[size]=e;
        } else {

        }
        size++;
        return size;
    }

    public T get(int index) {

        return  (T) objects[index] ;
    }

    public T[] remove(T valueToRemove){
        Object[] array=new Object[size-1];
        int n=0;
        for ( int i = 0; i < size(); i++ ) {
            if (objects[i] != valueToRemove) {
                array[n] = objects[i];
                n++;
            }
        }size--;
            objects = array;

        return (T[]) objects;
    }

    public void clear(){

        objects = new Object[0];
    }

    public void set(int j, T object){
        objects[j] = object;
    }

    public  boolean isEmpty() {
        if (objects.length ==  0) {
            return true;
        } else {
            return false;
        }
    }

    public  boolean contains(Object v) {
            for (Object el : objects)
                if (el == v) {
                    return true;
        } else {

            return false;

        }
        return false;
    }


}
1
+public class MyArrayList <T> {

    //add, get, remove, set, clear, isEmpty, contains

    Object[] array;

    //default constructor
    public MyArrayList() {
        this.array = new Object[0];
    }

    public MyArrayList(int size) {
        this.array = new Object[size];
    }

    public int size(){
        return array.length;
    }

    public void add(Object e){
        Object[] arr = new Object[array.length+1];
        arr[arr.length-1] = e;
        array = arr;
    }

    public void add(int index, Object d) {
        Object[] arr = new Object[array.length+1];
        for (int j = 0; j < array.length; j++) {
            if (j<index) {
                arr[index] = array[index-1];
            } else if (j>index) {
                arr[j] = array[index-1];
            } else {
                array[j]=d;
            }
        }
        array = arr;
    }

    public Object get(int index) {
        int count = 0;
        for (Object el: array) {
            if (count == index)
                return el;
            count++;
        }
        return null ;
    }

    public boolean remove(Object valueToRemove) {
        boolean element = false;
        int count = 0;
        int counter = 0;
        if (this.size() > 0) {
            Object[] arr = new Object[array.length-1];
            for (Object el: array)
            if ((el.equals(valueToRemove)) && count < 1) {
                count = 1;
                element = true;
            } else {
                arr[counter] = arr;
                counter++;
            }
        }
        return element;
    }

    public void clear(){
        array = new Object[0];
    }

    public Object set(int j, T object) {
        for (Object el : array) {
           if (array[j] == object){
               return el;
           }
        }
        return null;
    }

    public  boolean isEmpty() {
        if (array.length ==  0) {
            return true;
        } else {
            return false;
        }
    }

    public  boolean contains(Object v) {
        for (Object el : array)
            if (el == v) {
                return true;
            } else {
                return false;
            }
        return false;
    }

    public int getIndex(Object key) {
        for (int i=0; i<this.size(); i++) {
            if (array[i].equals(key))
                return i;
        }
        return -1;
    }

}

+ 1
- 1
src/main/java/MyMap.java Zobrazit soubor

@@ -1 +1 @@
1
-
public class MyMap <T>{
    //add, get, remove, set, clear, isEmpty, contains

    MyArrayList list = new MyArrayList();

    private Object[] objects = new Object[10];

    private int size=0;

    public int size(){
        return size;
    }


    public int add(T e){
        if(!contains(e)){
            if(size<objects.length){
                objects[size]=  e;
            } else {

            }
            size++;}

        return size;
    }

    public T get(int index) {

        return  (T) objects[index] ;
    }

    public T[] remove(T valueToRemove){
        Object[] array=new Object[size-1];
        int n=0;
        for ( int i = 0; i < size(); i++ ) {
            if (objects[i] != valueToRemove) {
                array[n] = objects[i];
                n++;
            }
        }size--;
        objects = array;

        return (T[]) objects;
    }

    public void clear(){

        objects = new Object[0];
    }

    public void set(int j, T object){
        objects[j] = object;
    }

    public  boolean isEmpty() {
        if (objects.length ==  0) {
            return true;
        } else {
            return false;
        }
    }

    public  boolean contains(Object v) {
        for (Object el : objects)
            if (v.equals(el)) {
                return true;
            } else {

                return false;

            }
        return false;
    }


}
1
+
public class MyMap <K,V> {

    //add, get, remove, set, clear, isEmpty, contains

    MyArrayList<V> values;
    MySet<K> keySet;
    int size;

    public MyMap() {
        this.values = new MyArrayList<>();
        this.keySet = new MySet<>();
        this.size = 0;
    }

    public int getSize(){
        return this.size;
    }

    public void put(Object i, Object x){
        int index = 0;
        if (keySet.contains(i)){
            index = keySet.getIndex(i);
            values.add(index,x);
        } else {
            keySet.add(i);
            values.add(x);
            this.size += 1;
        }
    }

    public boolean containsKey(Object i) {
        return keySet.contains(i);
    }

    public boolean containsValues(Object x) {
        return keySet.contains(x);
    }

    public Object get(Object i){
        int index = keySet.getIndex(i);
        Object value = values.get(index);
        return value;
    }

    public void clear() {
        keySet.clear();
        values.clear();
    }

    public boolean isEmpty() {
        if (keySet.isEmpty() && values.isEmpty()) {
            return true;
        } else {
            return false;
        }
    }

    public Object remove(Object key){
        if (keySet.contains(key)) {
            int index = keySet.getIndex(key);
            keySet.remove(key);
            Object value = values.get(index);
            values.remove(value);
            return value;
        } else {
            return null;
        }
    }

    public MySet<K> keySet(){
        return keySet;
    }

}

+ 1
- 1
src/main/java/MySet.java Zobrazit soubor

@@ -1 +1 @@
1
-

public class MySet <T> {
    //add, get, remove, set, clear, isEmpty, contains

    MyArrayList list = new MyArrayList();

    private Object[] objects = new Object[10];

    private int size=0;

    public int size(){
        return size;
    }


    public int add(T e){
        if(!contains(e)){
        if(size<objects.length){
            objects[size]=  e;
        } else {

        }
        size++;}

        return size;
    }

    public T get(int index) {

        return  (T) objects[index] ;
    }

    public T[] remove(T valueToRemove){
        Object[] array=new Object[size-1];
        int n=0;
        for ( int i = 0; i < size(); i++ ) {
            if (objects[i] != valueToRemove) {
                array[n] = objects[i];
                n++;
            }
        }size--;
        objects = array;

        return (T[]) objects;
    }

    public void clear(){

        objects = new Object[0];
    }

    public void set(int j, T object){
        objects[j] = object;
    }

    public  boolean isEmpty() {
        if (objects.length ==  0) {
            return true;
        } else {
            return false;
        }
    }

    public  boolean contains(Object v) {
        for (Object el : objects)
            if (v.equals(el)) {
                return true;
            } else {

                return false;

            }
        return false;
    }


}
1
+

public class MySet <T> {
    //add, get, remove, set, clear, isEmpty, contains

   Object[] set;

    public MySet() {
        this.set = new Object[0];
    }

    public MySet(int size) {
        this.set = new Object[size];
    }

    public int size(){
        return set.length;
    }


    public void add(Object e) {
        if (!contains(e)) {
            Object[] arr = new Object[set.length + 1];
            arr[arr.length - 1] = e;
            set = arr;
        }
    }

    public void add(int index, Object d) {
        if (!contains(d)) {
            Object[] arr = new Object[set.length + 1];
            for (int j = 0; j < set.length; j++) {
                if (j < index) {
                    arr[index] = set[index - 1];
                } else if (j > index) {
                    arr[j] = set[index - 1];
                } else {
                    set[j] = d;
                }
            }
            set = arr;
        }
    }

    public Object get(int index) {
        int count = 0;
        for (Object el: set) {
            if (count == index)
                return el;
            count++;
        }
        return null ;
    }
    public boolean remove(Object valueToRemove){
        boolean element = false;
        int count = 0;
        int counter = 0;
        if (this.size() > 0) {
            Object[] arr = new Object[set.length-1];
            for (Object el: set)
                if ((el.equals(valueToRemove)) && count < 1) {
                    count = 1;
                    element = true;
                } else {
                    arr[counter] = arr;
                    counter++;
                }
        }
        return element;
    }

    public void clear(){
        set = new Object[0];
    }

    public void set(int j, T object){
        set[j] = object;
    }

    public  boolean isEmpty() {
        if (set.length ==  0) {
            return true;
        } else {
            return false;
        }
    }

    public  boolean contains(Object v) {
        for (Object el : set)
            if (el == v) {
                return true;
            } else {

                return false;

            }
        return false;
    }

    public int getIndex(Object key) {
        for (int i=0; i<this.size(); i++) {
            if (set[i].equals(key))
                return i;
        }
        return -1;
    }
}

+ 0
- 0
src/test/java/.deleteme Zobrazit soubor


+ 1
- 1
src/test/java/MyArrayListTest.java Zobrazit soubor

@@ -1 +1 @@
1
-import org.junit.Assert;
import org.junit.Test;

public class MyArrayListTest <T> {

    MyArrayList list = new MyArrayList();


    @Test
    public void size() {

        int expected = 0;
        int actual = list.size();
        Assert.assertEquals(expected,actual);
    }

    @Test
    public void add2() {

        int expected = 1;
        int actual = (int) list.add(2);
        Assert.assertEquals(expected, actual);
    }

    @Test
    public void get() {

        list.add(2);
        list.add(4);
        int expected = 4;
        int actual = (int) list.get(1);
        Assert.assertEquals(expected, actual);
    }

    @Test
    public void remove() {

        list.add(2);
        list.add(4);
        list.add(5);
        Object[] expected ={2,5};
        Object[] actual = list.remove(4);
        Assert.assertArrayEquals(expected, actual);
    }

    @Test
    public void clear() {

        int expected =0;
        list.clear();
        int actual = list.size();
        Assert.assertEquals(expected, actual);
    }


    @Test
    public void isEmpty() {

        boolean expected = true;
        list.clear();
        boolean actual = list.isEmpty();
        //Assert.assertTrue(actual);
        Assert.assertEquals(expected,actual);
    }

    @Test
    public void contains() {
        Object obj = new Object();
        list.add(obj);

        Assert.assertTrue(list.contains(obj));

    }

    @Test
    public void contains2() {
        Object obj = new Object();
        Object objNotAdded = new Object();
        list.add(obj);

        Assert.assertFalse(list.contains(objNotAdded));

    }
}
1
+import org.junit.Assert;
import org.junit.Test;

public class MyArrayListTest <T> {

    MyArrayList<Object> list = new MyArrayList<>();

    @Test
    public void testSize() {

        int expected = 0;
        int actual = list.size();
        Assert.assertEquals(expected,actual);
    }

    @Test
    public void testAdd() {
        list.clear();
        list.add(24);
        list.add("Chai");

        Assert.assertEquals(2, list.size());
    }

    @Test
    public void testGet() {

      list.add(4);
      Object actual = list.get(0);
        Assert.assertEquals(4, actual);
    }

    @Test
    public void testRemove() {
        Integer actual = 2;
        list.add(actual);
        Assert.assertEquals(true,list.remove(actual));
    }

    @Test
    public void testClear() {

        int expected =0;
        list.clear();
        int actual = list.size();
        Assert.assertEquals(expected, actual);
    }


    @Test
    public void testIsEmpty() {

        boolean expected = true;
        list.clear();
        boolean actual = list.isEmpty();
        //Assert.assertTrue(actual);
        Assert.assertEquals(expected,actual);
    }

    @Test
    public void testContains() {
        Object obj = new Object();
        list.add(obj);

        Assert.assertTrue(list.contains(obj));

    }

    @Test
    public void testContains2() {
        Object obj = new Object();
        Object objNotAdded = new Object();
        list.add(obj);

        Assert.assertFalse(list.contains(objNotAdded));

    }

    @Test
    public void set() {
        Object obj = new Object();
        Integer expected = 2;
        list.add(expected);
        Assert.assertEquals(expected,list.set(0,expected));
    }
}

+ 1
- 1
src/test/java/MyMapTest.java Zobrazit soubor

@@ -1 +1 @@
1
-import org.junit.Assert;
import org.junit.Test;

public class MyMapTest<T> {

    MySet mySet = new MySet();


    @Test
    public void size() {

        int expected = 0;
        int actual = mySet.size();
        Assert.assertEquals(expected,actual);
    }

    @Test
    public void add() {

        int expected = 1;
        int actual = mySet.add(2);
        Assert.assertEquals(expected, actual);
    }

    @Test
    public void get() {

        mySet.add(2);
        mySet.add(4);
        int expected = 4;
        int actual = (int) mySet.get(1);
        Assert.assertEquals(expected, actual);
    }

    @Test
    public void remove() {

        mySet.add(2);
        mySet.add(4);
        mySet.add(5);
        Object[] expected ={2,5};
        Object[] actual = mySet.remove(4);
        Assert.assertArrayEquals(expected, actual);
    }

    @Test
    public void clear() {

        int expected =0;
        mySet.clear();
        int actual = mySet.size();
        Assert.assertEquals(expected, actual);
    }


    @Test
    public void isEmpty() {

        boolean expected = true;
        mySet.clear();
        boolean actual = mySet.isEmpty();
        //Assert.assertTrue(actual);
        Assert.assertEquals(expected,actual);
    }

    @Test
    public void contains() {
        Object obj = new Object();
        mySet.add(obj);

        Assert.assertTrue(mySet.contains(obj));

    }

    @Test
    public void contains2() {
        Object obj = new Object();
        Object objNotAdded = new Object();
        mySet.add(obj);

        Assert.assertFalse(mySet.contains(objNotAdded));

    }
}
1
+import org.junit.Assert;
import org.junit.Test;

public class MyMapTest<K,V> {

    MySet<V> set = new MySet<>();
    MyMap<K,V> map = new MyMap<>();

    @Test
    public void testSize() {
        map.put(1,"Chai");
        int expected = 1;
        int actual = map.getSize();
        Assert.assertEquals(expected,actual);
    }

    @Test
    public void testPut() {
        map.put(2,"Chai");
        int expected = 1;
        int actual = map.getSize();
        Assert.assertEquals(expected,actual);
    }

    @Test
    public void testContainsKey() {
        map.put(2,"Chai");
        boolean expected = true;
        boolean actual = map.containsKey(2);
        Assert.assertEquals(expected,actual);
    }

    @Test
    public void testContainsValues() {
        map.put(2,"Chai");
        boolean expected = false;
        boolean actual = map.containsValues("Chai");
        Assert.assertEquals(expected,actual);
    }

    @Test
    public void testGet() {
        map.put(2,"Chai");
        String expected = "Chai";
        String actual = (String) map.get(2);
        Assert.assertEquals(expected,actual);
    }

    @Test
    public void testClear() {
        map.clear();
        int expected = 0;
        int actual = map.getSize();
        Assert.assertEquals(expected,actual);
    }

    @Test
    public void testIsEmpty() {
        map.clear();
        boolean expected = true;
        boolean actual = map.isEmpty();
        Assert.assertEquals(expected,actual);
    }

    @Test
    public void testRemove() {
        map.put(1,"x");
        String expected = "x";
        String actual = (String) map.remove(1);
        Assert.assertEquals(expected,actual);
    }

}

+ 1
- 1
src/test/java/MySetTest.java Zobrazit soubor

@@ -1 +1 @@
1
-import org.junit.Assert;
import org.junit.Test;

public class MySetTest {

    MySet mySet = new MySet();


    @Test
    public void size() {

        int expected = 0;
        int actual = mySet.size();
        Assert.assertEquals(expected,actual);
    }

    @Test
    public void add() {

        int expected = 1;
        int actual = mySet.add(2);
        Assert.assertEquals(expected, actual);
    }

    @Test
    public void get() {

        mySet.add(2);
        mySet.add(4);
        int expected = 4;
        int actual = (int) mySet.get(1);
        Assert.assertEquals(expected, actual);
    }

    @Test
    public void remove() {

        mySet.add(2);
        mySet.add(4);
        mySet.add(5);
        Object[] expected ={2,5};
        Object[] actual = mySet.remove(4);
        Assert.assertArrayEquals(expected, actual);
    }

    @Test
    public void clear() {

        int expected =0;
        mySet.clear();
        int actual = mySet.size();
        Assert.assertEquals(expected, actual);
    }


    @Test
    public void isEmpty() {

        boolean expected = true;
        mySet.clear();
        boolean actual = mySet.isEmpty();
        //Assert.assertTrue(actual);
        Assert.assertEquals(expected,actual);
    }

    @Test
    public void contains() {
        Object obj = new Object();
        mySet.add(obj);

        Assert.assertTrue(mySet.contains(obj));

    }

    @Test
    public void contains2() {
        Object obj = new Object();
        Object objNotAdded = new Object();
        mySet.add(obj);

        Assert.assertFalse(mySet.contains(objNotAdded));

    }
}
1
+import org.junit.Assert;
import org.junit.Test;

public class MySetTest {

    MySet<Object> mySet = new MySet<>();


    @Test
    public void testSize() {

        int expected = 0;
        int actual = mySet.size();
        Assert.assertEquals(expected,actual);
    }

    @Test
    public void testAdd() {
        mySet.clear();
        mySet.add(24);
        mySet.add("Chai");

        Assert.assertEquals(2, mySet.size());
    }

    @Test
    public void testGet() {

        mySet.add(4);
        Object actual = mySet.get(0);
        Assert.assertEquals(4, actual);
    }

    @Test
    public void testRemove() {
        Integer actual = 2;
        mySet.add(actual);
        Assert.assertEquals(true,mySet.remove(actual));
    }

    @Test
    public void testClear() {

        int expected =0;
        mySet.clear();
        int actual = mySet.size();
        Assert.assertEquals(expected, actual);
    }


    @Test
    public void testIsEmpty() {

        boolean expected = true;
        mySet.clear();
        boolean actual = mySet.isEmpty();
        //Assert.assertTrue(actual);
        Assert.assertEquals(expected,actual);
    }

    @Test
    public void testContains() {
        Object obj = new Object();
        mySet.add(obj);

        Assert.assertTrue(mySet.contains(obj));

    }

    @Test
    public void testContains2() {
        Object obj = new Object();
        Object objNotAdded = new Object();
        mySet.add(obj);

        Assert.assertFalse(mySet.contains(objNotAdded));

    }
}