Skip to content

Commit

Permalink
Map Tests & BugFixes.
Browse files Browse the repository at this point in the history
-Added: Tests for all map implementations.
-Added: Missing Map Constructors.
-Fixed: Bugs with Maps & Sets.
-Fixed: Gradle Java Container.
-Fixed: Some javadoc stuff.
-Note: SubMap/List implementation are not really well tested and most likely buggy
-Changed: set JavaDoc to be quiet for now. Later goal.
  • Loading branch information
Speiger committed Apr 22, 2021
1 parent aaee550 commit 0b11c39
Show file tree
Hide file tree
Showing 43 changed files with 1,202 additions and 145 deletions.
12 changes: 12 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/builder" path="src/builder/java">
<attributes>
<attribute name="gradle_scope" value="builder"/>
<attribute name="gradle_used_by_scope" value="builder"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/builder" path="src/builder/resources">
<attributes>
<attribute name="gradle_scope" value="builder"/>
<attribute name="gradle_used_by_scope" value="builder"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
Expand Down
21 changes: 10 additions & 11 deletions .project
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Primitive-Collections</name>
<comment>Project Primitive-Collections created by Buildship.</comment>
<projects>
</projects>
<comment></comment>
<projects/>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
<arguments/>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
<arguments/>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<linkedResources/>
<filteredResources/>
</projectDescription>
14 changes: 13 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ repositories {

sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'

javadoc {
options.tags = [ "implSpec", "note" ]
}

eclipse {
classpath {
downloadJavadoc = true
Expand All @@ -31,6 +35,12 @@ eclipse {
}
}

compileJava {
options.compilerArgs << '-XDignore.symbol.file'
options.fork = true // may not needed on 1.8
options.forkOptions.executable = 'javac' // may not needed on 1.8
}

sourceSets {
builder
}
Expand Down Expand Up @@ -62,9 +72,11 @@ task srcJar(type: Jar) {
}

javadoc.failOnError = false
//javadoc.options.showAll()
javadoc.options.quiet()

artifacts {
archives javadocJar
// archives javadocJar
archives srcJar
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public abstract class ABSTRACT_COLLECTION KEY_GENERIC_TYPE extends AbstractColle

/**
* A Type-Specific implementation of contains. This implementation iterates over the elements and returns true if the value match.
* @param value that should be searched for.
* @param e the element that should be searched for.
* @return true if the value was found.
*/
@Override
Expand All @@ -66,9 +66,9 @@ public abstract class ABSTRACT_COLLECTION KEY_GENERIC_TYPE extends AbstractColle

/**
* A Type-Specific implementation of containsAll. This implementation iterates over all elements and checks all elements are present in the other collection.
* @param the collection that should be checked if it contains all elements.
* @param c the collection that should be checked if it contains all elements.
* @return true if all elements were found in the collection
* @throws NullPointerException if the collection is null
* @throws java.lang.NullPointerException if the collection is null
*/
@Override
public boolean containsAll(COLLECTION KEY_GENERIC_TYPE c) {
Expand All @@ -84,7 +84,7 @@ public abstract class ABSTRACT_COLLECTION KEY_GENERIC_TYPE extends AbstractColle
* @param c the elements that should be checked for
* @return true if any element is in this collection
* @deprecated if this is a primitive collection
* @throws NullPointerException if the collection is null
* @throws java.lang.NullPointerException if the collection is null
*/
@Override
@Primitive
Expand All @@ -100,7 +100,7 @@ public abstract class ABSTRACT_COLLECTION KEY_GENERIC_TYPE extends AbstractColle
* This implementation iterates over the elements of the collection and checks if they are stored in this collection.
* @param c the elements that should be checked for
* @return true if any element is in this collection
* @throws NullPointerException if the collection is null
* @throws java.lang.NullPointerException if the collection is null
*/
@Override
public boolean containsAny(COLLECTION KEY_GENERIC_TYPE c) {
Expand Down Expand Up @@ -142,7 +142,7 @@ public abstract class ABSTRACT_COLLECTION KEY_GENERIC_TYPE extends AbstractColle
* A Type-Specific implementation of removeAll. This Implementation iterates over all elements and removes them as they were found in the other collection.
* @param c the elements that should be deleted
* @return true if the collection was modified.
* @throws NullPointerException if the collection is null
* @throws java.lang.NullPointerException if the collection is null
*/
@Override
public boolean removeAll(COLLECTION KEY_GENERIC_TYPE c) {
Expand All @@ -161,7 +161,7 @@ public abstract class ABSTRACT_COLLECTION KEY_GENERIC_TYPE extends AbstractColle
* A Type-Specific implementation of retainAll. This Implementation iterates over all elements and removes them as they were not found in the other collection.
* @param c the elements that should be kept
* @return true if the collection was modified.
* @throws NullPointerException if the collection is null
* @throws java.lang.NullPointerException if the collection is null
*/
@Override
public boolean retainAll(COLLECTION KEY_GENERIC_TYPE c) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface BI_ITERATOR KEY_GENERIC_TYPE extends ITERATOR KEY_GENERIC_TYPE
/**
* Returns the Previous element of the iterator.
* @return the Previous element of the iterator.
* @throws NoSuchElementException if the iteration has no more elements
* @throws java.util.NoSuchElementException if the iteration has no more elements
*/
public KEY_TYPE PREVIOUS();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,45 +19,46 @@ public interface COLLECTION KEY_GENERIC_TYPE extends Collection<CLASS_TYPE>, ITE
#if !TYPE_OBJECT
/**
* A Type-Specific add function to reduce (un)boxing
* @see Collection#add(Object)
* @param o the element that should be added
* @return true if the element was added to the collection
*/
public boolean add(KEY_TYPE o);

#endif
/**
* A Type-Specific addAll function to reduce (un)boxing
* @see Collection#addAll(Collection)
* @param c the collection of elements that should be added
* @return true if elements were added into the collection
*/
public boolean addAll(COLLECTION KEY_GENERIC_TYPE c);

#if !TYPE_OBJECT
/**
* A Type-Specific contains function to reduce (un)boxing
* @see Collection#contains(Object)
* @param o the element that is checked for
* @return true if the element is found in the collection
*/
public boolean contains(KEY_TYPE o);

#endif
/**
* A Type-Specific containsAll function to reduce (un)boxing
* @see Collection#containsAll(Object)
* @param c the collection of elements that should be tested for
* @return true if all the element is found in the collection
*/
public boolean containsAll(COLLECTION KEY_GENERIC_TYPE c);

/**
* A Type-Specific containsAny function to reduce (un)boxing
* @see #containsAny(Collection)
* @param c the collection of elements that should be tested for
* @return true if any element was found
*/
public boolean containsAny(COLLECTION KEY_GENERIC_TYPE c);

/**
* Returns true if any element of the Collection is found in the provided collection.
* A Small Optimization function to find out of any element is present when comparing collections and not all of them.
* @param c the collection of elements that should be tested for
* @return true if any element was found.
*/
@Primitive
Expand All @@ -66,6 +67,7 @@ public interface COLLECTION KEY_GENERIC_TYPE extends Collection<CLASS_TYPE>, ITE
#if !TYPE_OBJECT
/**
* A Type-Specific remove function that reduces (un)boxing.
* @param o the element that should be removed
* @return true if the element was removed
* @see Collection#remove(Object)
*/
Expand All @@ -74,13 +76,15 @@ public interface COLLECTION KEY_GENERIC_TYPE extends Collection<CLASS_TYPE>, ITE
#endif
/**
* A Type-Specific removeAll function that reduces (un)boxing.
* @param c the collection of elements that should be removed
* @return true if any element was removed
* @see Collection#removeAll(Collection)
*/
public boolean removeAll(COLLECTION KEY_GENERIC_TYPE c);

/**
* A Type-Specific retainAll function that reduces (un)boxing.
* @param c the collection of elements that should be kept
* @return true if any element was removed
* @see Collection#retainAll(Collection)
*/
Expand Down Expand Up @@ -123,7 +127,8 @@ public interface COLLECTION KEY_GENERIC_TYPE extends Collection<CLASS_TYPE>, ITE
* <p>Removes elements that were selected by the filter
* @see Collection#removeIf(Predicate)
* @param filter Filters the elements that should be removed
* @throws NullPointerException if filter is null
* @return true if the collection was modified
* @throws java.lang.NullPointerException if filter is null
*/
public default boolean remIf(JAVA_PREDICATE filter) {
Objects.requireNonNull(filter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public interface ITERATOR KEY_GENERIC_TYPE extends Iterator<CLASS_TYPE>
* Returns the next element in the iteration.
*
* @return the next element in the iteration
* @throws NoSuchElementException if the iteration has no more elements
* @throws java.util.NoSuchElementException if the iteration has no more elements
* @see Iterator#next()
*/
public KEY_TYPE NEXT();
Expand All @@ -45,7 +45,7 @@ public interface ITERATOR KEY_GENERIC_TYPE extends Iterator<CLASS_TYPE>
* }</pre>
*
* @param action The action to be performed for each element
* @throws NullPointerException if the specified action is null
* @throws java.lang.NullPointerException if the specified action is null
* @see Iterator#forEachRemaining(Consumer)
*/
public default void forEachRemaining(CONSUMER action) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public abstract class ABSTRACT_LIST KEY_GENERIC_TYPE extends ABSTRACT_COLLECTION

/**
* The IndexOf implementation iterates over all elements and compares them to the search value.
* @param e the value that the index is searched for.
* @param o the value that the index is searched for.
* @return index of the value that was searched for. -1 if not found
* @deprecated it is highly suggested not to use this with Primitives because of boxing. But it is still supported because of ObjectComparason that are custom objects and allow to find the contents.
*/
Expand Down Expand Up @@ -89,7 +89,7 @@ public abstract class ABSTRACT_LIST KEY_GENERIC_TYPE extends ABSTRACT_COLLECTION

/**
* The lastIndexOf implementation iterates over all elements and compares them to the search value.
* @param e the value that the index is searched for.
* @param o the value that the index is searched for.
* @return the last index of the value that was searched for. -1 if not found
* @deprecated it is highly suggested not to use this with Primitives because of boxing. But it is still supported because of ObjectComparason that are custom objects and allow to find the contents.
*/
Expand Down
Loading

0 comments on commit 0b11c39

Please sign in to comment.