Rachelle 6 vuotta sitten
vanhempi
commit
39a6fc8a24

+ 1
- 0
.idea/.name Näytä tiedosto

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

+ 16
- 0
.idea/compiler.xml Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
11
+    <output url="file://$PROJECT_DIR$/classes" />
12
+  </component>
13
+</project>

+ 8
- 0
.idea/modules.xml Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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>

+ 306
- 0
.idea/workspace.xml Näytä tiedosto

@@ -0,0 +1,306 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ChangeListManager">
4
+    <list default="true" id="ec541dad-c25d-45fa-be45-a22a95b616b5" name="Default" comment="">
5
+      <change afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
6
+      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__junit_junit_4_12.xml" afterDir="false" />
7
+      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml" afterDir="false" />
8
+      <change afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
9
+      <change afterPath="$PROJECT_DIR$/generics.iml" afterDir="false" />
10
+      <change afterPath="$PROJECT_DIR$/src/main/java/MyArrayList.java" afterDir="false" />
11
+      <change afterPath="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" afterDir="false" />
12
+      <change beforePath="$PROJECT_DIR$/src/main/java/.deleteme" beforeDir="false" />
13
+      <change beforePath="$PROJECT_DIR$/src/test/java/.deleteme" beforeDir="false" />
14
+    </list>
15
+    <ignored path="$PROJECT_DIR$/target/" />
16
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
17
+    <option name="TRACKING_ENABLED" value="true" />
18
+    <option name="SHOW_DIALOG" value="false" />
19
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
20
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
21
+    <option name="LAST_RESOLUTION" value="IGNORE" />
22
+  </component>
23
+  <component name="FileEditorManager">
24
+    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
25
+      <file leaf-file-name="MyArrayList.java" pinned="false" current-in-tab="true">
26
+        <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
27
+          <provider selected="true" editor-type-id="text-editor">
28
+            <state relative-caret-position="225">
29
+              <caret line="17" column="36" selection-start-line="17" selection-start-column="36" selection-end-line="17" selection-end-column="36" />
30
+            </state>
31
+          </provider>
32
+        </entry>
33
+      </file>
34
+      <file leaf-file-name="MyArrayListTest.java" pinned="false" current-in-tab="false">
35
+        <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
36
+          <provider selected="true" editor-type-id="text-editor">
37
+            <state relative-caret-position="135">
38
+              <caret line="9" column="22" selection-start-line="9" selection-start-column="22" selection-end-line="9" selection-end-column="22" />
39
+              <folding>
40
+                <element signature="imports" expanded="true" />
41
+              </folding>
42
+            </state>
43
+          </provider>
44
+        </entry>
45
+      </file>
46
+    </leaf>
47
+  </component>
48
+  <component name="FileTemplateManagerImpl">
49
+    <option name="RECENT_TEMPLATES">
50
+      <list>
51
+        <option value="Class" />
52
+      </list>
53
+    </option>
54
+  </component>
55
+  <component name="Git.Settings">
56
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
57
+  </component>
58
+  <component name="IdeDocumentHistory">
59
+    <option name="CHANGED_PATHS">
60
+      <list>
61
+        <option value="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" />
62
+        <option value="$PROJECT_DIR$/src/main/java/MyArrayList.java" />
63
+      </list>
64
+    </option>
65
+  </component>
66
+  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
67
+  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
68
+  <component name="JsGulpfileManager">
69
+    <detection-done>true</detection-done>
70
+    <sorting>DEFINITION_ORDER</sorting>
71
+  </component>
72
+  <component name="NodePackageJsonFileManager">
73
+    <packageJsonPaths />
74
+  </component>
75
+  <component name="ProjectFrameBounds">
76
+    <option name="x" value="-90" />
77
+    <option name="y" value="-1002" />
78
+    <option name="width" value="1277" />
79
+    <option name="height" value="709" />
80
+  </component>
81
+  <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
82
+  <component name="ProjectView">
83
+    <navigator proportions="" version="1">
84
+      <foldersAlwaysOnTop value="true" />
85
+    </navigator>
86
+    <panes>
87
+      <pane id="ProjectPane">
88
+        <subPane>
89
+          <expand>
90
+            <path>
91
+              <item name="generics" type="b2602c69:ProjectViewProjectNode" />
92
+              <item name="CR-MicroLabs-Generics-MyArrayList" type="462c0819:PsiDirectoryNode" />
93
+            </path>
94
+            <path>
95
+              <item name="generics" type="b2602c69:ProjectViewProjectNode" />
96
+              <item name="CR-MicroLabs-Generics-MyArrayList" type="462c0819:PsiDirectoryNode" />
97
+              <item name="src" type="462c0819:PsiDirectoryNode" />
98
+            </path>
99
+            <path>
100
+              <item name="generics" type="b2602c69:ProjectViewProjectNode" />
101
+              <item name="CR-MicroLabs-Generics-MyArrayList" type="462c0819:PsiDirectoryNode" />
102
+              <item name="src" type="462c0819:PsiDirectoryNode" />
103
+              <item name="main" type="462c0819:PsiDirectoryNode" />
104
+            </path>
105
+            <path>
106
+              <item name="generics" type="b2602c69:ProjectViewProjectNode" />
107
+              <item name="CR-MicroLabs-Generics-MyArrayList" type="462c0819:PsiDirectoryNode" />
108
+              <item name="src" type="462c0819:PsiDirectoryNode" />
109
+              <item name="main" type="462c0819:PsiDirectoryNode" />
110
+              <item name="java" type="462c0819:PsiDirectoryNode" />
111
+            </path>
112
+            <path>
113
+              <item name="generics" type="b2602c69:ProjectViewProjectNode" />
114
+              <item name="CR-MicroLabs-Generics-MyArrayList" type="462c0819:PsiDirectoryNode" />
115
+              <item name="src" type="462c0819:PsiDirectoryNode" />
116
+              <item name="test" type="462c0819:PsiDirectoryNode" />
117
+            </path>
118
+            <path>
119
+              <item name="generics" type="b2602c69:ProjectViewProjectNode" />
120
+              <item name="CR-MicroLabs-Generics-MyArrayList" type="462c0819:PsiDirectoryNode" />
121
+              <item name="src" type="462c0819:PsiDirectoryNode" />
122
+              <item name="test" type="462c0819:PsiDirectoryNode" />
123
+              <item name="java" type="462c0819:PsiDirectoryNode" />
124
+            </path>
125
+          </expand>
126
+          <select />
127
+        </subPane>
128
+      </pane>
129
+      <pane id="Scope" />
130
+      <pane id="PackagesPane" />
131
+      <pane id="AndroidView" />
132
+    </panes>
133
+  </component>
134
+  <component name="PropertiesComponent">
135
+    <property name="WebServerToolWindowFactoryState" value="false" />
136
+    <property name="aspect.path.notification.shown" value="true" />
137
+    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
138
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
139
+    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
140
+    <property name="settings.editor.selected.configurable" value="configurable.group.appearance" />
141
+  </component>
142
+  <component name="RunDashboard">
143
+    <option name="ruleStates">
144
+      <list>
145
+        <RuleState>
146
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
147
+        </RuleState>
148
+        <RuleState>
149
+          <option name="name" value="StatusDashboardGroupingRule" />
150
+        </RuleState>
151
+      </list>
152
+    </option>
153
+  </component>
154
+  <component name="RunManager">
155
+    <configuration default="true" type="Application" factoryName="Application">
156
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
157
+    </configuration>
158
+    <configuration default="true" type="JUnit" factoryName="JUnit">
159
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
160
+      <option name="ALTERNATIVE_JRE_PATH" />
161
+      <option name="PACKAGE_NAME" />
162
+      <option name="MAIN_CLASS_NAME" />
163
+      <option name="METHOD_NAME" />
164
+      <option name="TEST_OBJECT" value="class" />
165
+      <option name="VM_PARAMETERS" value="-ea" />
166
+      <option name="PARAMETERS" />
167
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
168
+      <option name="PASS_PARENT_ENVS" value="true" />
169
+      <option name="TEST_SEARCH_SCOPE">
170
+        <value defaultName="singleModule" />
171
+      </option>
172
+      <patterns />
173
+    </configuration>
174
+    <configuration default="true" type="TestNG" factoryName="TestNG">
175
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
176
+      <option name="ALTERNATIVE_JRE_PATH" />
177
+      <option name="SUITE_NAME" />
178
+      <option name="PACKAGE_NAME" />
179
+      <option name="MAIN_CLASS_NAME" />
180
+      <option name="METHOD_NAME" />
181
+      <option name="GROUP_NAME" />
182
+      <option name="TEST_OBJECT" value="CLASS" />
183
+      <option name="VM_PARAMETERS" value="-ea" />
184
+      <option name="PARAMETERS" />
185
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
186
+      <option name="OUTPUT_DIRECTORY" />
187
+      <option name="PASS_PARENT_ENVS" value="true" />
188
+      <option name="TEST_SEARCH_SCOPE">
189
+        <value defaultName="singleModule" />
190
+      </option>
191
+      <option name="USE_DEFAULT_REPORTERS" value="false" />
192
+      <option name="PROPERTIES_FILE" />
193
+      <properties />
194
+      <listeners />
195
+    </configuration>
196
+  </component>
197
+  <component name="SvnConfiguration">
198
+    <configuration />
199
+  </component>
200
+  <component name="TaskManager">
201
+    <task active="true" id="Default" summary="Default task">
202
+      <changelist id="ec541dad-c25d-45fa-be45-a22a95b616b5" name="Default" comment="" />
203
+      <created>1530135343605</created>
204
+      <option name="number" value="Default" />
205
+      <option name="presentableId" value="Default" />
206
+      <updated>1530135343605</updated>
207
+      <workItem from="1530135347373" duration="292000" />
208
+      <workItem from="1530562276619" duration="2376000" />
209
+      <workItem from="1530566904324" duration="286000" />
210
+    </task>
211
+    <servers />
212
+  </component>
213
+  <component name="TimeTrackingManager">
214
+    <option name="totallyTimeSpent" value="2954000" />
215
+  </component>
216
+  <component name="ToolWindowManager">
217
+    <frame x="-90" y="-1002" width="1277" height="709" extended-state="0" />
218
+    <layout>
219
+      <window_info anchor="right" id="Palette" order="3" />
220
+      <window_info anchor="bottom" id="TODO" order="6" />
221
+      <window_info anchor="right" id="Palette&#9;" order="3" />
222
+      <window_info id="Image Layers" order="2" />
223
+      <window_info anchor="right" id="Capture Analysis" order="3" />
224
+      <window_info anchor="bottom" id="Event Log" order="7" side_tool="true" />
225
+      <window_info anchor="right" id="Maven Projects" order="3" />
226
+      <window_info anchor="bottom" id="Database Changes" order="7" show_stripe_button="false" />
227
+      <window_info anchor="bottom" id="Run" order="2" />
228
+      <window_info anchor="bottom" id="Version Control" order="7" />
229
+      <window_info anchor="bottom" id="Terminal" order="7" />
230
+      <window_info id="Capture Tool" order="2" />
231
+      <window_info id="Designer" order="2" />
232
+      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.24980423" />
233
+      <window_info anchor="right" id="Database" order="3" />
234
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
235
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
236
+      <window_info id="UI Designer" order="2" />
237
+      <window_info anchor="right" id="Theme Preview" order="3" />
238
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
239
+      <window_info id="Favorites" order="2" side_tool="true" />
240
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
241
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
242
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
243
+      <window_info anchor="bottom" id="Message" order="0" />
244
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
245
+      <window_info anchor="bottom" id="Find" order="1" />
246
+    </layout>
247
+  </component>
248
+  <component name="TypeScriptGeneratedFilesManager">
249
+    <option name="version" value="1" />
250
+  </component>
251
+  <component name="VcsContentAnnotationSettings">
252
+    <option name="myLimit" value="2678400000" />
253
+  </component>
254
+  <component name="editorHistoryManager">
255
+    <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
256
+      <provider selected="true" editor-type-id="text-editor">
257
+        <state relative-caret-position="225">
258
+          <caret line="17" column="36" selection-start-line="17" selection-start-column="36" selection-end-line="17" selection-end-column="36" />
259
+        </state>
260
+      </provider>
261
+    </entry>
262
+    <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
263
+      <provider selected="true" editor-type-id="text-editor">
264
+        <state relative-caret-position="135">
265
+          <caret line="9" column="22" selection-start-line="9" selection-start-column="22" selection-end-line="9" selection-end-column="22" />
266
+          <folding>
267
+            <element signature="imports" expanded="true" />
268
+          </folding>
269
+        </state>
270
+      </provider>
271
+    </entry>
272
+    <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
273
+      <provider selected="true" editor-type-id="text-editor">
274
+        <state relative-caret-position="135">
275
+          <caret line="9" column="22" selection-start-line="9" selection-start-column="22" selection-end-line="9" selection-end-column="22" />
276
+          <folding>
277
+            <element signature="imports" expanded="true" />
278
+          </folding>
279
+        </state>
280
+      </provider>
281
+    </entry>
282
+    <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
283
+      <provider selected="true" editor-type-id="text-editor">
284
+        <state relative-caret-position="225">
285
+          <caret line="17" column="36" selection-start-line="17" selection-start-column="36" selection-end-line="17" selection-end-column="36" />
286
+        </state>
287
+      </provider>
288
+    </entry>
289
+  </component>
290
+  <component name="masterDetails">
291
+    <states>
292
+      <state key="ProjectJDKs.UI">
293
+        <settings>
294
+          <last-edited>1.8</last-edited>
295
+          <splitter-proportions>
296
+            <option name="proportions">
297
+              <list>
298
+                <option value="0.2" />
299
+              </list>
300
+            </option>
301
+          </splitter-proportions>
302
+        </settings>
303
+      </state>
304
+    </states>
305
+  </component>
306
+</project>

+ 16
- 0
generics.iml Näytä tiedosto

@@ -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>

+ 0
- 0
src/main/java/.deleteme Näytä tiedosto


+ 21
- 0
src/main/java/MyArrayList.java Näytä tiedosto

@@ -0,0 +1,21 @@
1
+import java.util.Arrays;
2
+
3
+public class MyArrayList<T> {
4
+
5
+    private T[] array;
6
+
7
+    public T[] get(){
8
+        return array;
9
+    }
10
+
11
+    public void add(T elementToAdd){
12
+        try {
13
+            T[] newArray = Arrays.copyOf(array, array.length + 1);
14
+            newArray[array.length-1] = elementToAdd;
15
+            array = newArray;
16
+        }catch (NullPointerException n){
17
+            array = (T[]) new Object[1];
18
+            array[0] = elementToAdd;
19
+        }
20
+    }
21
+}

+ 0
- 0
src/test/java/.deleteme Näytä tiedosto


+ 44
- 0
src/test/java/MyArrayListTest.java Näytä tiedosto

@@ -0,0 +1,44 @@
1
+import org.junit.Test;
2
+
3
+import static org.junit.Assert.assertEquals;
4
+
5
+public class MyArrayListTest {
6
+    MyArrayList myArrayList = new MyArrayList<>();
7
+
8
+    @Test
9
+    public void getAddTest() {
10
+        myArrayList.add(1);
11
+
12
+        Object[] array = myArrayList.get();
13
+        Integer expected = 1;
14
+
15
+        Object actual = array[0];
16
+
17
+        assertEquals(expected, actual);
18
+    }
19
+
20
+    @Test
21
+    public void removeTest(){
22
+
23
+    }
24
+
25
+    @Test
26
+    public void setTest(){
27
+
28
+    }
29
+
30
+    @Test
31
+    public void clearTest(){
32
+
33
+    }
34
+
35
+    @Test
36
+    public void isEmptyTest(){
37
+
38
+    }
39
+
40
+    @Test
41
+    public void contains(){
42
+
43
+    }
44
+}