New Features

-Added: Count method for Iterable
-Fixed: A couple of bugs with the new stream removers not working well in LinkedCollections
This commit is contained in:
2021-09-28 13:20:05 +02:00
parent 3f872463b6
commit 07abba6312
25 changed files with 572 additions and 1 deletions
@@ -284,6 +284,16 @@ public class ARRAY_FIFO_QUEUE KEY_GENERIC_TYPE implements PRIORITY_DEQUEUE KEY_G
return EMPTY_VALUE;
}
@Override
public int count(PREDICATE KEY_GENERIC_TYPE filter) {
Objects.requireNonNull(filter);
int result = 0;
for(int i = 0,m=size();i<m;i++) {
if(filter.TEST_VALUE(array[(first + i) % array.length])) result++;
}
return result;
}
@Override
public boolean trim(int size) {
int newSize = Math.max(size, size());