Skip to content

Commit bf5f7f9

Browse files
committed
Initial Commit
0 parents  commit bf5f7f9

File tree

17 files changed

+543
-0
lines changed

17 files changed

+543
-0
lines changed

.gitignore

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### JetBrains template
3+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
4+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
5+
6+
# User-specific stuff:
7+
.idea/workspace.xml
8+
.idea/tasks.xml
9+
.idea/dictionaries
10+
.idea/vcs.xml
11+
.idea/jsLibraryMappings.xml
12+
13+
# Sensitive or high-churn files:
14+
.idea/dataSources.ids
15+
.idea/dataSources.xml
16+
.idea/dataSources.local.xml
17+
.idea/sqlDataSources.xml
18+
.idea/dynamic.xml
19+
.idea/uiDesigner.xml
20+
21+
# Gradle:
22+
.idea/gradle.xml
23+
.idea/libraries
24+
25+
# Mongo Explorer plugin:
26+
.idea/mongoSettings.xml
27+
28+
## File-based project format:
29+
*.iws
30+
31+
## Plugin-specific files:
32+
33+
# IntelliJ
34+
/out/
35+
36+
# mpeltonen/sbt-idea plugin
37+
.idea_modules/
38+
39+
# JIRA plugin
40+
atlassian-ide-plugin.xml
41+
42+
# Crashlytics plugin (for Android Studio and IntelliJ)
43+
com_crashlytics_export_strings.xml
44+
crashlytics.properties
45+
crashlytics-build.properties
46+
fabric.properties
47+

.idea/compiler.xml

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copyright/profiles_settings.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/description.html

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/project-template.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Support.iml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<content url="file://$MODULE_DIR$">
6+
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
7+
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
8+
</content>
9+
<orderEntry type="inheritedJdk" />
10+
<orderEntry type="sourceFolder" forTests="false" />
11+
<orderEntry type="module-library" scope="TEST">
12+
<library name="JUnit4">
13+
<CLASSES>
14+
<root url="jar://$APPLICATION_HOME_DIR$/lib/junit-4.12.jar!/" />
15+
<root url="jar://$APPLICATION_HOME_DIR$/lib/hamcrest-core-1.3.jar!/" />
16+
</CLASSES>
17+
<JAVADOC />
18+
<SOURCES />
19+
</library>
20+
</orderEntry>
21+
</component>
22+
</module>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.jimmyhowe.support;
2+
3+
public class Main {
4+
5+
public static void main(String[] args) {
6+
// write your code here
7+
}
8+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
package com.jimmyhowe.support.collections;
2+
3+
import com.jimmyhowe.support.contracts.Collection;
4+
5+
import java.util.ArrayList;
6+
import java.util.List;
7+
8+
/**
9+
* Generalized Collection
10+
*
11+
* @param <T>
12+
*/
13+
public abstract class GeneralisedCollection<T> implements Collection<T>
14+
{
15+
/**
16+
* Data in ArrayList
17+
*/
18+
protected List<T> data = new ArrayList<>();
19+
20+
/**
21+
* Adds an item to the collection
22+
*
23+
* @param item
24+
*/
25+
@Override
26+
public void add(T item)
27+
{
28+
this.data.add(item);
29+
}
30+
31+
/**
32+
* Returns the Data Object
33+
*/
34+
@Override
35+
public List<T> data()
36+
{
37+
return data;
38+
}
39+
40+
/**
41+
* Helper to get data at index
42+
*
43+
* @param i
44+
*/
45+
@Override
46+
public T data(int i)
47+
{
48+
return this.data.get(i);
49+
}
50+
51+
/**
52+
* Returns the first object
53+
*
54+
* @return
55+
*/
56+
public T first()
57+
{
58+
return this.data(0);
59+
}
60+
61+
/**
62+
* Returns the last object
63+
*
64+
* @return
65+
*/
66+
public T last()
67+
{
68+
return this.data(this.count() - 1);
69+
}
70+
71+
/**
72+
* {@inheritDoc}
73+
*/
74+
@Override
75+
public int count()
76+
{
77+
return this.data.size();
78+
}
79+
80+
@Override
81+
public String toString()
82+
{
83+
return "GeneralisedCollection{" +
84+
"data=" + data +
85+
'}';
86+
}
87+
}

0 commit comments

Comments
 (0)