Added Primitive Stream & Splititerator support

This commit is contained in:
2021-04-27 17:02:57 +02:00
parent 413a294915
commit 17d8f6e055
12 changed files with 591 additions and 301 deletions
@@ -3,6 +3,8 @@ package speiger.src.collections.PACKAGE.sets;
import java.util.NavigableSet;
import speiger.src.collections.PACKAGE.collections.BI_ITERATOR;
import speiger.src.collections.PACKAGE.collections.SPLIT_ITERATOR;
import speiger.src.collections.PACKAGE.utils.SPLIT_ITERATORS;
/**
* A Type Specific Navigable Set interface with a couple helper methods
@@ -114,6 +116,13 @@ public interface NAVIGABLE_SET KEY_GENERIC_TYPE extends NavigableSet<CLASS_TYPE>
@Override
public NAVIGABLE_SET KEY_GENERIC_TYPE descendingSet();
/**
* A Type Specific Type Splititerator to reduce boxing/unboxing
* @return type specific splititerator
*/
@Override
default SPLIT_ITERATOR KEY_GENERIC_TYPE spliterator() { return SPLIT_ITERATORS.createSplititerator(this, 0); }
#if !TYPE_OBJECT
@Override
@Deprecated
@@ -158,5 +167,6 @@ public interface NAVIGABLE_SET KEY_GENERIC_TYPE extends NavigableSet<CLASS_TYPE>
@Override
@Deprecated
public default SORTED_SET KEY_GENERIC_TYPE tailSet(CLASS_TYPE fromElement) { return SORTED_SET.super.tailSet(fromElement); }
#endif
}
@@ -4,6 +4,8 @@ import java.util.Set;
import speiger.src.collections.PACKAGE.collections.COLLECTION;
import speiger.src.collections.PACKAGE.collections.ITERATOR;
import speiger.src.collections.PACKAGE.collections.SPLIT_ITERATOR;
import speiger.src.collections.PACKAGE.utils.SPLIT_ITERATORS;
/**
* A Type Specific Set class to reduce boxing/unboxing
@@ -45,4 +47,10 @@ public interface SET KEY_GENERIC_TYPE extends Set<CLASS_TYPE>, COLLECTION KEY_GE
return COLLECTION.super.remove(o);
}
#endif
/**
* A Type Specific Type Splititerator to reduce boxing/unboxing
* @return type specific splititerator
*/
@Override
default SPLIT_ITERATOR KEY_GENERIC_TYPE spliterator() { return SPLIT_ITERATORS.createSplititerator(this, 0); }
}
@@ -3,11 +3,13 @@ package speiger.src.collections.PACKAGE.sets;
import java.util.SortedSet;
import speiger.src.collections.PACKAGE.collections.BI_ITERATOR;
import speiger.src.collections.PACKAGE.collections.SPLIT_ITERATOR;
#if TYPE_OBJECT
import java.util.Comparator;
#else
import speiger.src.collections.PACKAGE.functions.COMPARATOR;
#endif
import speiger.src.collections.PACKAGE.utils.SPLIT_ITERATORS;
/**
* A Type Specific SortedSet implementation to reduce boxing/unboxing
@@ -68,6 +70,13 @@ public interface SORTED_SET KEY_GENERIC_TYPE extends SET KEY_GENERIC_TYPE, Sorte
*/
public BI_ITERATOR KEY_GENERIC_TYPE iterator(KEY_TYPE fromElement);
/**
* A Type Specific Type Splititerator to reduce boxing/unboxing
* @return type specific splititerator
*/
@Override
default SPLIT_ITERATOR KEY_GENERIC_TYPE spliterator() { return SPLIT_ITERATORS.createSplititerator(this, 0); }
#if !TYPE_OBJECT
/**
* A Type Specific SubSet method to reduce boxing/unboxing