Przeglądaj źródła

completed arraylist

Yesoda Sanka 6 lat temu
rodzic
commit
a45833cb84

+ 1
- 0
.idea/.name Wyświetl plik

@@ -0,0 +1 @@
1
+generics

+ 16
- 0
.idea/compiler.xml Wyświetl plik

@@ -0,0 +1,16 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="CompilerConfiguration">
4
+    <annotationProcessing>
5
+      <profile name="Maven default annotation processors profile" enabled="true">
6
+        <sourceOutputDir name="target/generated-sources/annotations" />
7
+        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
8
+        <outputRelativeToContentRoot value="true" />
9
+        <module name="generics" />
10
+      </profile>
11
+    </annotationProcessing>
12
+    <bytecodeTargetLevel>
13
+      <module name="generics" target="1.7" />
14
+    </bytecodeTargetLevel>
15
+  </component>
16
+</project>

+ 13
- 0
.idea/libraries/Maven__junit_junit_4_12.xml Wyświetl plik

@@ -0,0 +1,13 @@
1
+<component name="libraryTable">
2
+  <library name="Maven: junit:junit:4.12">
3
+    <CLASSES>
4
+      <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/" />
5
+    </CLASSES>
6
+    <JAVADOC>
7
+      <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12-javadoc.jar!/" />
8
+    </JAVADOC>
9
+    <SOURCES>
10
+      <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12-sources.jar!/" />
11
+    </SOURCES>
12
+  </library>
13
+</component>

+ 13
- 0
.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml Wyświetl plik

@@ -0,0 +1,13 @@
1
+<component name="libraryTable">
2
+  <library name="Maven: org.hamcrest:hamcrest-core:1.3">
3
+    <CLASSES>
4
+      <root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
5
+    </CLASSES>
6
+    <JAVADOC>
7
+      <root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc.jar!/" />
8
+    </JAVADOC>
9
+    <SOURCES>
10
+      <root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar!/" />
11
+    </SOURCES>
12
+  </library>
13
+</component>

+ 13
- 0
.idea/misc.xml Wyświetl plik

@@ -0,0 +1,13 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="MavenProjectsManager">
4
+    <option name="originalFiles">
5
+      <list>
6
+        <option value="$PROJECT_DIR$/pom.xml" />
7
+      </list>
8
+    </option>
9
+  </component>
10
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="11" project-jdk-type="JavaSDK">
11
+    <output url="file://$PROJECT_DIR$/classes" />
12
+  </component>
13
+</project>

+ 8
- 0
.idea/modules.xml Wyświetl plik

@@ -0,0 +1,8 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ProjectModuleManager">
4
+    <modules>
5
+      <module fileurl="file://$PROJECT_DIR$/generics.iml" filepath="$PROJECT_DIR$/generics.iml" />
6
+    </modules>
7
+  </component>
8
+</project>

+ 6
- 0
.idea/vcs.xml Wyświetl plik

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="VcsDirectoryMappings">
4
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+  </component>
6
+</project>

+ 417
- 0
.idea/workspace.xml Wyświetl plik

@@ -0,0 +1,417 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ChangeListManager">
4
+    <list default="true" id="1efee8f6-8bdd-497f-989e-874538b2cdbb" 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/MyArrayListTest.java" afterDir="false" />
10
+    </list>
11
+    <ignored path="$PROJECT_DIR$/target/" />
12
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
13
+    <option name="SHOW_DIALOG" value="false" />
14
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
15
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
16
+    <option name="LAST_RESOLUTION" value="IGNORE" />
17
+  </component>
18
+  <component name="FUSProjectUsageTrigger">
19
+    <session id="-767434416">
20
+      <usages-collector id="statistics.lifecycle.project">
21
+        <counts>
22
+          <entry key="project.closed" value="2" />
23
+          <entry key="project.open.time.0" value="1" />
24
+          <entry key="project.open.time.1" value="1" />
25
+          <entry key="project.open.time.29" value="1" />
26
+          <entry key="project.open.time.9" value="1" />
27
+          <entry key="project.opened" value="4" />
28
+        </counts>
29
+      </usages-collector>
30
+      <usages-collector id="statistics.file.extensions.open">
31
+        <counts>
32
+          <entry key="iml" value="2" />
33
+          <entry key="java" value="3" />
34
+          <entry key="md" value="1" />
35
+        </counts>
36
+      </usages-collector>
37
+      <usages-collector id="statistics.file.types.open">
38
+        <counts>
39
+          <entry key="IDEA_MODULE" value="2" />
40
+          <entry key="JAVA" value="3" />
41
+          <entry key="Markdown" value="1" />
42
+        </counts>
43
+      </usages-collector>
44
+      <usages-collector id="statistics.file.extensions.edit">
45
+        <counts>
46
+          <entry key="java" value="3134" />
47
+        </counts>
48
+      </usages-collector>
49
+      <usages-collector id="statistics.file.types.edit">
50
+        <counts>
51
+          <entry key="JAVA" value="3134" />
52
+        </counts>
53
+      </usages-collector>
54
+    </session>
55
+  </component>
56
+  <component name="FileEditorManager">
57
+    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
58
+      <file pinned="false" current-in-tab="false">
59
+        <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
60
+          <provider selected="true" editor-type-id="text-editor">
61
+            <state relative-caret-position="105">
62
+              <caret line="7" column="86" selection-start-line="7" selection-start-column="33" selection-end-line="7" selection-end-column="86" />
63
+              <folding>
64
+                <element signature="imports" expanded="true" />
65
+                <element signature="e#3040#3041#0" expanded="true" />
66
+                <element signature="e#3067#3068#0" expanded="true" />
67
+              </folding>
68
+            </state>
69
+          </provider>
70
+        </entry>
71
+      </file>
72
+      <file pinned="false" current-in-tab="false">
73
+        <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
74
+          <provider selected="true" editor-type-id="text-editor">
75
+            <state relative-caret-position="1245">
76
+              <caret line="83" lean-forward="true" selection-start-line="83" selection-end-line="83" />
77
+              <folding>
78
+                <element signature="imports" expanded="true" />
79
+              </folding>
80
+            </state>
81
+          </provider>
82
+        </entry>
83
+      </file>
84
+      <file pinned="false" current-in-tab="true">
85
+        <entry file="file://$PROJECT_DIR$/README.md">
86
+          <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
87
+            <state split_layout="FIRST">
88
+              <first_editor relative-caret-position="161">
89
+                <caret line="32" column="137" lean-forward="true" selection-start-line="32" selection-start-column="76" selection-end-line="32" selection-end-column="137" />
90
+              </first_editor>
91
+              <second_editor />
92
+            </state>
93
+          </provider>
94
+        </entry>
95
+      </file>
96
+      <file pinned="false" current-in-tab="false">
97
+        <entry file="file://$PROJECT_DIR$/src/main/java/MySet.java">
98
+          <provider selected="true" editor-type-id="text-editor">
99
+            <state relative-caret-position="105">
100
+              <caret line="7" selection-start-line="6" selection-start-column="52" selection-end-line="7" />
101
+            </state>
102
+          </provider>
103
+        </entry>
104
+      </file>
105
+    </leaf>
106
+  </component>
107
+  <component name="FileTemplateManagerImpl">
108
+    <option name="RECENT_TEMPLATES">
109
+      <list>
110
+        <option value="Class" />
111
+      </list>
112
+    </option>
113
+  </component>
114
+  <component name="Git.Settings">
115
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
116
+  </component>
117
+  <component name="IdeDocumentHistory">
118
+    <option name="CHANGED_PATHS">
119
+      <list>
120
+        <option value="$PROJECT_DIR$/src/main/java/MySet.java" />
121
+        <option value="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" />
122
+        <option value="$PROJECT_DIR$/src/main/java/MyArrayList.java" />
123
+      </list>
124
+    </option>
125
+  </component>
126
+  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
127
+  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
128
+  <component name="JsGulpfileManager">
129
+    <detection-done>true</detection-done>
130
+    <sorting>DEFINITION_ORDER</sorting>
131
+  </component>
132
+  <component name="ProjectFrameBounds">
133
+    <option name="y" value="23" />
134
+    <option name="width" value="1280" />
135
+    <option name="height" value="709" />
136
+  </component>
137
+  <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
138
+  <component name="ProjectView">
139
+    <navigator proportions="" version="1">
140
+      <foldersAlwaysOnTop value="true" />
141
+    </navigator>
142
+    <panes>
143
+      <pane id="Scope" />
144
+      <pane id="ProjectPane">
145
+        <subPane>
146
+          <expand>
147
+            <path>
148
+              <item name="generics" type="b2602c69:ProjectViewProjectNode" />
149
+              <item name="CR-MicroLabs-Generics-MyArrayList" type="462c0819:PsiDirectoryNode" />
150
+            </path>
151
+            <path>
152
+              <item name="generics" type="b2602c69:ProjectViewProjectNode" />
153
+              <item name="CR-MicroLabs-Generics-MyArrayList" type="462c0819:PsiDirectoryNode" />
154
+              <item name="src" type="462c0819:PsiDirectoryNode" />
155
+            </path>
156
+            <path>
157
+              <item name="generics" type="b2602c69:ProjectViewProjectNode" />
158
+              <item name="CR-MicroLabs-Generics-MyArrayList" type="462c0819:PsiDirectoryNode" />
159
+              <item name="src" type="462c0819:PsiDirectoryNode" />
160
+              <item name="main" type="462c0819:PsiDirectoryNode" />
161
+            </path>
162
+            <path>
163
+              <item name="generics" type="b2602c69:ProjectViewProjectNode" />
164
+              <item name="CR-MicroLabs-Generics-MyArrayList" type="462c0819:PsiDirectoryNode" />
165
+              <item name="src" type="462c0819:PsiDirectoryNode" />
166
+              <item name="main" type="462c0819:PsiDirectoryNode" />
167
+              <item name="java" type="462c0819:PsiDirectoryNode" />
168
+            </path>
169
+            <path>
170
+              <item name="generics" type="b2602c69:ProjectViewProjectNode" />
171
+              <item name="CR-MicroLabs-Generics-MyArrayList" type="462c0819:PsiDirectoryNode" />
172
+              <item name="target" type="462c0819:PsiDirectoryNode" />
173
+            </path>
174
+          </expand>
175
+          <select />
176
+        </subPane>
177
+      </pane>
178
+      <pane id="PackagesPane" />
179
+    </panes>
180
+  </component>
181
+  <component name="PropertiesComponent">
182
+    <property name="WebServerToolWindowFactoryState" value="false" />
183
+    <property name="aspect.path.notification.shown" value="true" />
184
+    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
185
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
186
+    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
187
+    <property name="settings.editor.selected.configurable" value="vcs.Git" />
188
+  </component>
189
+  <component name="RunDashboard">
190
+    <option name="ruleStates">
191
+      <list>
192
+        <RuleState>
193
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
194
+        </RuleState>
195
+        <RuleState>
196
+          <option name="name" value="StatusDashboardGroupingRule" />
197
+        </RuleState>
198
+      </list>
199
+    </option>
200
+  </component>
201
+  <component name="RunManager" selected="JUnit.MyArrayListTest.testset">
202
+    <configuration name="MyArrayListTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
203
+      <module name="generics" />
204
+      <option name="PACKAGE_NAME" value="" />
205
+      <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
206
+      <method v="2">
207
+        <option name="Make" enabled="true" />
208
+      </method>
209
+    </configuration>
210
+    <configuration name="MyArrayListTest.testclear" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
211
+      <module name="generics" />
212
+      <option name="PACKAGE_NAME" value="" />
213
+      <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
214
+      <option name="METHOD_NAME" value="testclear" />
215
+      <option name="TEST_OBJECT" value="method" />
216
+      <method v="2">
217
+        <option name="Make" enabled="true" />
218
+      </method>
219
+    </configuration>
220
+    <configuration name="MyArrayListTest.testcontains" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
221
+      <module name="generics" />
222
+      <option name="PACKAGE_NAME" value="" />
223
+      <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
224
+      <option name="METHOD_NAME" value="testcontains" />
225
+      <option name="TEST_OBJECT" value="method" />
226
+      <method v="2">
227
+        <option name="Make" enabled="true" />
228
+      </method>
229
+    </configuration>
230
+    <configuration name="MyArrayListTest.testremove" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
231
+      <module name="generics" />
232
+      <option name="PACKAGE_NAME" value="" />
233
+      <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
234
+      <option name="METHOD_NAME" value="testremove" />
235
+      <option name="TEST_OBJECT" value="method" />
236
+      <method v="2">
237
+        <option name="Make" enabled="true" />
238
+      </method>
239
+    </configuration>
240
+    <configuration name="MyArrayListTest.testset" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
241
+      <module name="generics" />
242
+      <option name="PACKAGE_NAME" value="" />
243
+      <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
244
+      <option name="METHOD_NAME" value="testset" />
245
+      <option name="TEST_OBJECT" value="method" />
246
+      <method v="2">
247
+        <option name="Make" enabled="true" />
248
+      </method>
249
+    </configuration>
250
+    <list>
251
+      <item itemvalue="JUnit.MyArrayListTest" />
252
+      <item itemvalue="JUnit.MyArrayListTest.testcontains" />
253
+      <item itemvalue="JUnit.MyArrayListTest.testremove" />
254
+      <item itemvalue="JUnit.MyArrayListTest.testclear" />
255
+      <item itemvalue="JUnit.MyArrayListTest.testset" />
256
+    </list>
257
+    <recent_temporary>
258
+      <list>
259
+        <item itemvalue="JUnit.MyArrayListTest.testset" />
260
+        <item itemvalue="JUnit.MyArrayListTest.testclear" />
261
+        <item itemvalue="JUnit.MyArrayListTest.testremove" />
262
+        <item itemvalue="JUnit.MyArrayListTest.testcontains" />
263
+        <item itemvalue="JUnit.MyArrayListTest" />
264
+      </list>
265
+    </recent_temporary>
266
+  </component>
267
+  <component name="SvnConfiguration">
268
+    <configuration />
269
+  </component>
270
+  <component name="TaskManager">
271
+    <task active="true" id="Default" summary="Default task">
272
+      <changelist id="1efee8f6-8bdd-497f-989e-874538b2cdbb" name="Default Changelist" comment="" />
273
+      <created>1542133582792</created>
274
+      <option name="number" value="Default" />
275
+      <option name="presentableId" value="Default" />
276
+      <updated>1542133582792</updated>
277
+      <workItem from="1542133584190" duration="6147000" />
278
+      <workItem from="1542164994943" duration="658000" />
279
+      <workItem from="1542203456725" duration="13394000" />
280
+      <workItem from="1542249080146" duration="3437000" />
281
+    </task>
282
+    <servers />
283
+  </component>
284
+  <component name="TestHistory">
285
+    <history-entry file="MyArrayListTest_testremove - 2018.11.14 at 16h 33m 14s.xml">
286
+      <configuration name="MyArrayListTest.testremove" configurationId="JUnit" />
287
+    </history-entry>
288
+    <history-entry file="MyArrayListTest_testremove - 2018.11.14 at 16h 41m 18s.xml">
289
+      <configuration name="MyArrayListTest.testremove" configurationId="JUnit" />
290
+    </history-entry>
291
+    <history-entry file="MyArrayListTest_testremove - 2018.11.14 at 21h 53m 32s.xml">
292
+      <configuration name="MyArrayListTest.testremove" configurationId="JUnit" />
293
+    </history-entry>
294
+    <history-entry file="MyArrayListTest_testremove - 2018.11.14 at 22h 03m 25s.xml">
295
+      <configuration name="MyArrayListTest.testremove" configurationId="JUnit" />
296
+    </history-entry>
297
+    <history-entry file="MyArrayListTest_testremove - 2018.11.14 at 22h 03m 58s.xml">
298
+      <configuration name="MyArrayListTest.testremove" configurationId="JUnit" />
299
+    </history-entry>
300
+    <history-entry file="MyArrayListTest_testremove - 2018.11.14 at 22h 12m 07s.xml">
301
+      <configuration name="MyArrayListTest.testremove" configurationId="JUnit" />
302
+    </history-entry>
303
+    <history-entry file="MyArrayListTest_testclear - 2018.11.14 at 22h 19m 38s.xml">
304
+      <configuration name="MyArrayListTest.testclear" configurationId="JUnit" />
305
+    </history-entry>
306
+    <history-entry file="MyArrayListTest_testclear - 2018.11.14 at 22h 20m 08s.xml">
307
+      <configuration name="MyArrayListTest.testclear" configurationId="JUnit" />
308
+    </history-entry>
309
+    <history-entry file="MyArrayListTest_testset - 2018.11.14 at 22h 26m 05s.xml">
310
+      <configuration name="MyArrayListTest.testset" configurationId="JUnit" />
311
+    </history-entry>
312
+    <history-entry file="MyArrayListTest_testset - 2018.11.14 at 22h 27m 45s.xml">
313
+      <configuration name="MyArrayListTest.testset" configurationId="JUnit" />
314
+    </history-entry>
315
+  </component>
316
+  <component name="TimeTrackingManager">
317
+    <option name="totallyTimeSpent" value="23636000" />
318
+  </component>
319
+  <component name="ToolWindowManager">
320
+    <frame x="0" y="23" width="1280" height="709" extended-state="0" />
321
+    <editor active="true" />
322
+    <layout>
323
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.1825525" />
324
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
325
+      <window_info id="Designer" order="2" />
326
+      <window_info id="Learn" order="3" />
327
+      <window_info id="UI Designer" order="4" />
328
+      <window_info id="Favorites" order="5" side_tool="true" />
329
+      <window_info anchor="bottom" id="Message" order="0" />
330
+      <window_info anchor="bottom" id="Find" order="1" />
331
+      <window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.32996634" />
332
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
333
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
334
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
335
+      <window_info anchor="bottom" id="TODO" order="6" />
336
+      <window_info anchor="bottom" id="Version Control" order="7" show_stripe_button="false" />
337
+      <window_info anchor="bottom" id="Terminal" order="8" />
338
+      <window_info anchor="bottom" id="Event Log" order="9" side_tool="true" />
339
+      <window_info anchor="bottom" id="Messages" order="10" weight="0.32996634" />
340
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
341
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
342
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
343
+      <window_info anchor="right" id="Palette" order="3" />
344
+      <window_info anchor="right" id="Palette&#9;" order="4" />
345
+      <window_info anchor="right" id="Maven Projects" order="5" />
346
+    </layout>
347
+  </component>
348
+  <component name="TypeScriptGeneratedFilesManager">
349
+    <option name="version" value="1" />
350
+  </component>
351
+  <component name="VcsContentAnnotationSettings">
352
+    <option name="myLimit" value="2678400000" />
353
+  </component>
354
+  <component name="editorHistoryManager">
355
+    <entry file="file://$PROJECT_DIR$/generics.iml">
356
+      <provider selected="true" editor-type-id="text-editor" />
357
+    </entry>
358
+    <entry file="file://$PROJECT_DIR$/../JavaAssessment2Final/java-assessment-2.iml">
359
+      <provider selected="true" editor-type-id="text-editor" />
360
+    </entry>
361
+    <entry file="file://$PROJECT_DIR$/src/main/java/MySet.java">
362
+      <provider selected="true" editor-type-id="text-editor">
363
+        <state relative-caret-position="105">
364
+          <caret line="7" selection-start-line="6" selection-start-column="52" selection-end-line="7" />
365
+        </state>
366
+      </provider>
367
+    </entry>
368
+    <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
369
+      <provider selected="true" editor-type-id="text-editor">
370
+        <state relative-caret-position="105">
371
+          <caret line="7" column="86" selection-start-line="7" selection-start-column="33" selection-end-line="7" selection-end-column="86" />
372
+          <folding>
373
+            <element signature="imports" expanded="true" />
374
+            <element signature="e#3040#3041#0" expanded="true" />
375
+            <element signature="e#3067#3068#0" expanded="true" />
376
+          </folding>
377
+        </state>
378
+      </provider>
379
+    </entry>
380
+    <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
381
+      <provider selected="true" editor-type-id="text-editor">
382
+        <state relative-caret-position="1245">
383
+          <caret line="83" lean-forward="true" selection-start-line="83" selection-end-line="83" />
384
+          <folding>
385
+            <element signature="imports" expanded="true" />
386
+          </folding>
387
+        </state>
388
+      </provider>
389
+    </entry>
390
+    <entry file="file://$PROJECT_DIR$/README.md">
391
+      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
392
+        <state split_layout="FIRST">
393
+          <first_editor relative-caret-position="161">
394
+            <caret line="32" column="137" lean-forward="true" selection-start-line="32" selection-start-column="76" selection-end-line="32" selection-end-column="137" />
395
+          </first_editor>
396
+          <second_editor />
397
+        </state>
398
+      </provider>
399
+    </entry>
400
+  </component>
401
+  <component name="masterDetails">
402
+    <states>
403
+      <state key="ProjectJDKs.UI">
404
+        <settings>
405
+          <last-edited>1.8</last-edited>
406
+          <splitter-proportions>
407
+            <option name="proportions">
408
+              <list>
409
+                <option value="0.2" />
410
+              </list>
411
+            </option>
412
+          </splitter-proportions>
413
+        </settings>
414
+      </state>
415
+    </states>
416
+  </component>
417
+</project>

+ 16
- 0
generics.iml Wyświetl plik

@@ -0,0 +1,16 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
4
+    <output url="file://$MODULE_DIR$/target/classes" />
5
+    <output-test url="file://$MODULE_DIR$/target/test-classes" />
6
+    <content url="file://$MODULE_DIR$">
7
+      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8
+      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
9
+      <excludeFolder url="file://$MODULE_DIR$/target" />
10
+    </content>
11
+    <orderEntry type="inheritedJdk" />
12
+    <orderEntry type="sourceFolder" forTests="false" />
13
+    <orderEntry type="library" name="Maven: junit:junit:4.12" level="project" />
14
+    <orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
15
+  </component>
16
+</module>

+ 107
- 0
src/main/java/MyArrayList.java Wyświetl plik

@@ -0,0 +1,107 @@
1
+/*
2
+ MyArrayList must be a generic type, which can store any other type of object
3
+- MyArrayList must not use List, ArrayList or any other collection type in its implementation,
4
+ only Arrays (The purpose of this is to practice designing your own generic class from the ground up,
5
+  so that you can appreciate their complexities and usefulness)
6
+- MyArrayList must have `add()`, `get()`, `remove()`, `set()`, `clear()`, `isEmpty()`, `contains()`
7
+ and other methods to provide the same basic functionality described
8
+ in the [ArrayList documentation](https://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html)
9
+- `add()` should be overridden to add an element to the end of the Array,
10
+or to add the element to a specified index in the array.
11
+- MyArrayList must have a no-argument constructor (`MyArrayList()`)
12
+ to initialize a new instance, it should also have a one-argument constructor (`MyArrayList(int)`)
13
+ that takes an int and starts the list off at the specified size.
14
+- MyArrayList should automatically resize and maintain its order.
15
+
16
+ */
17
+
18
+
19
+import java.lang.reflect.Array;
20
+import java.util.ArrayList;
21
+import java.util.Arrays;
22
+
23
+public class MyArrayList <E>{
24
+
25
+
26
+      private int size;
27
+      private Object[] elements;
28
+
29
+
30
+
31
+    public MyArrayList( ) {         // constructor
32
+         elements =new Object[10];  // allocate initial capacity of 10
33
+          size = 0;
34
+      }
35
+
36
+      public void add(Object  o) {
37
+          if (size < elements.length) {
38
+              elements[size] = o;
39
+          } else {
40
+              // allocate a larger array and add the element, omitted
41
+          }
42
+          ++size;
43
+
44
+      }
45
+
46
+     //getting the size of an array
47
+     public int size() {
48
+        return size;
49
+    }
50
+    //getting data from specifid index
51
+    public E get(int index) {
52
+        //if (index >= size)
53
+          //  throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + size);
54
+        return (E)elements[index];
55
+    }
56
+    public boolean isEmpty()
57
+    {   boolean flag=false;
58
+        if(elements  ==null){
59
+            return true;
60
+        }
61
+        else
62
+            return false;
63
+    }
64
+
65
+    public Boolean  contains(Object  o) {
66
+         boolean flag=false;
67
+        for (Object e : elements) {
68
+            if (e.equals(o) )
69
+                return true;
70
+            else
71
+                flag=false;
72
+        }
73
+        return flag;
74
+    }
75
+    public E[] remove(E  objectToRemove) {
76
+        Integer n = 0;
77
+        boolean flag = false;
78
+        Object[] newArray = new Object[size - 1];
79
+        for (int i = 0; i < size(); i++) {
80
+            if (elements[i] != objectToRemove) {
81
+                newArray[n] = elements[i];
82
+                n++;
83
+
84
+            }
85
+
86
+        } size--;
87
+
88
+            elements = newArray;
89
+            return (E[]) elements;
90
+        }
91
+
92
+    public void clear(){
93
+      elements =new Object[10] ;
94
+     Arrays.fill(elements,null ) ;
95
+     size=0;
96
+   }
97
+
98
+    public void set(int i, E object){
99
+       elements [i] = object;
100
+
101
+    }
102
+
103
+}
104
+
105
+
106
+
107
+

+ 12
- 0
src/main/java/MySet.java Wyświetl plik

@@ -0,0 +1,12 @@
1
+/*
2
+MySet must be a generic type, which can store any other type of object
3
+- An instance of MySet must contain no duplicates
4
+- MySet must not use List, ArrayList, or any other built-in collection types
5
+ in its implementation. You may use Arrays, and you may use your implementation
6
+ of MyArrayList (if it helps -- you don't have to use it)
7
+- MySet must have all of the methods listed on the [Java Set documentation](https://docs.oracle.com/javase/7/docs/api/java/util/Set.html)
8
+
9
+ */
10
+
11
+public class MySet {
12
+}

+ 83
- 0
src/test/java/MyArrayListTest.java Wyświetl plik

@@ -0,0 +1,83 @@
1
+import org.junit.Assert;
2
+import org.junit.Test;
3
+
4
+import java.lang.annotation.Target;
5
+import java.util.ArrayList;
6
+import java.util.List;
7
+
8
+public class MyArrayListTest<E> {
9
+    @Test
10
+
11
+    public void testadd()
12
+    {
13
+        MyArrayList mylist=new MyArrayList( );
14
+        mylist.add("abs");
15
+        int expected = 1;
16
+        int  actual=mylist.size();
17
+       Assert.assertEquals(expected ,actual) ;
18
+
19
+    }
20
+    @Test
21
+    public void testget(){
22
+
23
+        MyArrayList mylist=new MyArrayList( );
24
+        mylist.add("abs");
25
+        mylist.add(1) ;
26
+        int expected=1;
27
+        Assert.assertEquals(expected,mylist.get(1) ) ;
28
+
29
+
30
+    }
31
+    @Test
32
+    public void testempty()
33
+    {
34
+        MyArrayList mylist=new MyArrayList( );
35
+        mylist.add("abs");
36
+        mylist.add(1) ;
37
+        boolean expected=false;
38
+        Assert.assertEquals(expected,mylist.isEmpty()) ;
39
+
40
+    }
41
+    @Test
42
+    public void testcontains(){
43
+        MyArrayList mylist=new MyArrayList( );
44
+        mylist.add("abs");
45
+        mylist.add(1) ;
46
+        boolean expected=true;
47
+        Assert.assertEquals(expected,mylist.contains(1) ) ;
48
+    }
49
+    @Test
50
+    public void testremove(){
51
+        MyArrayList mylist=new MyArrayList( );
52
+        mylist.add(0);
53
+        mylist.add(1) ;
54
+        mylist.add(2);
55
+        mylist.add(3) ;
56
+        Object [] expected={0,2,3};
57
+
58
+       // Assert.assertEquals(expected,mylist.remove(1) ) ;
59
+        Assert.assertArrayEquals(expected, mylist.remove(1) );
60
+    }
61
+    @Test
62
+    public void testclear(){
63
+        MyArrayList mylist=new MyArrayList( );
64
+        mylist.add(1);
65
+        mylist.add(2);
66
+        mylist.add(3);
67
+        int expected=0;
68
+        mylist.clear();
69
+        Assert.assertEquals(expected,mylist.size()   ) ;
70
+    }
71
+    @Test
72
+    public void testset()
73
+    {
74
+        MyArrayList mylist=new MyArrayList( );
75
+        mylist.add(2) ;
76
+        mylist.add(3);
77
+        mylist.set(2,4) ;
78
+        Object  expected=4;
79
+
80
+        Assert.assertEquals(expected,mylist.get(2)  ) ;
81
+
82
+    }
83
+}