Implemented ForEachIndexed into all collections
This commit is contained in:
+67
@@ -23,6 +23,13 @@ import speiger.src.collections.PACKAGE.collections.ITERATOR;
|
||||
import speiger.src.collections.PACKAGE.functions.CONSUMER;
|
||||
import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
|
||||
#endif
|
||||
import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
|
||||
#if !TYPE_OBJECT && !VALUE_OBJECT
|
||||
import speiger.src.collections.ints.functions.consumer.IntObjectConsumer;
|
||||
#endif
|
||||
#if !SAME_TYPE
|
||||
import speiger.src.collections.ints.functions.consumer.VALUE_BI_FROM_INT_CONSUMER;
|
||||
#endif
|
||||
import speiger.src.collections.PACKAGE.functions.consumer.BI_CONSUMER;
|
||||
#if !VALUE_BOOLEAN || !JDK_TYPE
|
||||
import speiger.src.collections.PACKAGE.functions.function.FUNCTION;
|
||||
@@ -673,6 +680,26 @@ public class CONCURRENT_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(IntObjectConsumer<MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||
Objects.requireNonNull(action);
|
||||
int count = 0;
|
||||
for(int i = 0,m=segments.length;i<m;i++) {
|
||||
Segment KEY_VALUE_GENERIC_TYPE seg = segments[i];
|
||||
long stamp = seg.readLock();
|
||||
try {
|
||||
int index = seg.firstIndex;
|
||||
while(index != -1) {
|
||||
action.accept(count++, new BasicEntryKV_BRACES(seg.keys[index], seg.values[index]));
|
||||
index = (int)seg.links[index];
|
||||
}
|
||||
}
|
||||
finally {
|
||||
seg.unlockRead(stamp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, ObjectObjectConsumer<E, MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||
Objects.requireNonNull(action);
|
||||
@@ -982,6 +1009,26 @@ public class CONCURRENT_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(BI_FROM_INT_CONSUMER KEY_GENERIC_TYPE action) {
|
||||
Objects.requireNonNull(action);
|
||||
int count = 0;
|
||||
for(int i = 0,m=segments.length;i<m;i++) {
|
||||
Segment KEY_VALUE_GENERIC_TYPE seg = segments[i];
|
||||
long stamp = seg.readLock();
|
||||
try {
|
||||
int index = seg.firstIndex;
|
||||
while(index != -1){
|
||||
action.accept(count++, seg.keys[index]);
|
||||
index = (int)seg.links[index];
|
||||
}
|
||||
}
|
||||
finally {
|
||||
seg.unlockRead(stamp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, BI_FROM_OBJECT_CONSUMER KSK_GENERIC_TYPE<E> action) {
|
||||
Objects.requireNonNull(action);
|
||||
@@ -1230,6 +1277,26 @@ public class CONCURRENT_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(VALUE_BI_FROM_INT_CONSUMER VALUE_GENERIC_TYPE action) {
|
||||
Objects.requireNonNull(action);
|
||||
int count = 0;
|
||||
for(int i = 0,m=segments.length;i<m;i++) {
|
||||
Segment KEY_VALUE_GENERIC_TYPE seg = segments[i];
|
||||
long stamp = seg.readLock();
|
||||
try {
|
||||
int index = seg.firstIndex;
|
||||
while(index != -1){
|
||||
action.accept(count++, seg.values[index]);
|
||||
index = (int)seg.links[index];
|
||||
}
|
||||
}
|
||||
finally {
|
||||
seg.unlockRead(stamp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, VALUE_BI_FROM_OBJECT_CONSUMER VSV_GENERIC_TYPE<E> action) {
|
||||
Objects.requireNonNull(action);
|
||||
|
||||
+43
@@ -19,6 +19,13 @@ import speiger.src.collections.PACKAGE.collections.BI_ITERATOR;
|
||||
import speiger.src.collections.PACKAGE.functions.CONSUMER;
|
||||
import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
|
||||
#endif
|
||||
import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
|
||||
#if !TYPE_OBJECT && !VALUE_OBJECT
|
||||
import speiger.src.collections.ints.functions.consumer.IntObjectConsumer;
|
||||
#endif
|
||||
#if !SAME_TYPE
|
||||
import speiger.src.collections.ints.functions.consumer.VALUE_BI_FROM_INT_CONSUMER;
|
||||
#endif
|
||||
#if !TYPE_OBJECT && !JDK_TYPE
|
||||
import speiger.src.collections.PACKAGE.functions.function.PREDICATE;
|
||||
#endif
|
||||
@@ -687,6 +694,18 @@ public class LINKED_CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE extends CUSTOM_HASH_M
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(IntObjectConsumer<MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||
Objects.requireNonNull(action);
|
||||
if(size() <= 0) return;
|
||||
int count = 0;
|
||||
int index = firstIndex;
|
||||
while(index != -1) {
|
||||
action.accept(count++, new BasicEntryKV_BRACES(keys[index], values[index]));
|
||||
index = (int)links[index];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, ObjectObjectConsumer<E, MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||
Objects.requireNonNull(action);
|
||||
@@ -948,6 +967,18 @@ public class LINKED_CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE extends CUSTOM_HASH_M
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(BI_FROM_INT_CONSUMER KEY_GENERIC_TYPE action) {
|
||||
Objects.requireNonNull(action);
|
||||
if(size() <= 0) return;
|
||||
int count = 0;
|
||||
int index = firstIndex;
|
||||
while(index != -1){
|
||||
action.accept(count++, keys[index]);
|
||||
index = (int)links[index];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, BI_FROM_OBJECT_CONSUMER KSK_GENERIC_TYPE<E> action) {
|
||||
Objects.requireNonNull(action);
|
||||
@@ -1111,6 +1142,18 @@ public class LINKED_CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE extends CUSTOM_HASH_M
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(VALUE_BI_FROM_INT_CONSUMER VALUE_GENERIC_TYPE action) {
|
||||
Objects.requireNonNull(action);
|
||||
if(size() <= 0) return;
|
||||
int count = 0;
|
||||
int index = firstIndex;
|
||||
while(index != -1){
|
||||
action.accept(count++, values[index]);
|
||||
index = (int)links[index];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, VALUE_BI_FROM_OBJECT_CONSUMER VSV_GENERIC_TYPE<E> action) {
|
||||
Objects.requireNonNull(action);
|
||||
|
||||
+37
@@ -20,6 +20,13 @@ import speiger.src.collections.PACKAGE.collections.ITERATOR;
|
||||
import speiger.src.collections.PACKAGE.functions.CONSUMER;
|
||||
import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
|
||||
#endif
|
||||
import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
|
||||
#if !TYPE_OBJECT && !VALUE_OBJECT
|
||||
import speiger.src.collections.ints.functions.consumer.IntObjectConsumer;
|
||||
#endif
|
||||
#if !SAME_TYPE
|
||||
import speiger.src.collections.ints.functions.consumer.VALUE_BI_FROM_INT_CONSUMER;
|
||||
#endif
|
||||
import speiger.src.collections.PACKAGE.functions.consumer.BI_CONSUMER;
|
||||
#if !VALUE_BOOLEAN || !JDK_TYPE
|
||||
import speiger.src.collections.PACKAGE.functions.function.FUNCTION;
|
||||
@@ -873,6 +880,16 @@ public class CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VAL
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(IntObjectConsumer<MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||
Objects.requireNonNull(action);
|
||||
if(size() <= 0) return;
|
||||
if(containsNull) action.accept(0, new BasicEntryKV_BRACES(keys[nullIndex], values[nullIndex]));
|
||||
for(int i = nullIndex-1, index = containsNull ? 1 : 0;i>=0;i--) {
|
||||
if(!strategy.equals(keys[i], EMPTY_KEY_VALUE)) action.accept(index++, new BasicEntryKV_BRACES(keys[i], values[i]));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, ObjectObjectConsumer<E, MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||
Objects.requireNonNull(action);
|
||||
@@ -1110,6 +1127,16 @@ public class CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VAL
|
||||
if(!strategy.equals(keys[i], EMPTY_KEY_VALUE)) action.accept(keys[i]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(BI_FROM_INT_CONSUMER KEY_GENERIC_TYPE action) {
|
||||
Objects.requireNonNull(action);
|
||||
if(size() <= 0) return;
|
||||
if(containsNull) action.accept(0, keys[nullIndex]);
|
||||
for(int i = nullIndex-1, index = containsNull ? 1 : 0;i>=0;i--) {
|
||||
if(!strategy.equals(keys[i], EMPTY_KEY_VALUE)) action.accept(index++, keys[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, BI_FROM_OBJECT_CONSUMER KSK_GENERIC_TYPE<E> action) {
|
||||
Objects.requireNonNull(action);
|
||||
@@ -1266,6 +1293,16 @@ public class CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VAL
|
||||
if(!strategy.equals(keys[i], EMPTY_KEY_VALUE)) action.accept(values[i]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(VALUE_BI_FROM_INT_CONSUMER VALUE_GENERIC_TYPE action) {
|
||||
Objects.requireNonNull(action);
|
||||
if(size() <= 0) return;
|
||||
if(containsNull) action.accept(0, values[nullIndex]);
|
||||
for(int i = nullIndex-1, index = containsNull ? 1 : 0;i>=0;i--) {
|
||||
if(!strategy.equals(keys[i], EMPTY_KEY_VALUE)) action.accept(index++, values[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, VALUE_BI_FROM_OBJECT_CONSUMER VSV_GENERIC_TYPE<E> action) {
|
||||
Objects.requireNonNull(action);
|
||||
|
||||
+43
@@ -19,6 +19,13 @@ import speiger.src.collections.PACKAGE.collections.BI_ITERATOR;
|
||||
import speiger.src.collections.PACKAGE.functions.CONSUMER;
|
||||
import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
|
||||
#endif
|
||||
import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
|
||||
#if !TYPE_OBJECT && !VALUE_OBJECT
|
||||
import speiger.src.collections.ints.functions.consumer.IntObjectConsumer;
|
||||
#endif
|
||||
#if !SAME_TYPE
|
||||
import speiger.src.collections.ints.functions.consumer.VALUE_BI_FROM_INT_CONSUMER;
|
||||
#endif
|
||||
#if !TYPE_OBJECT && !JDK_TYPE
|
||||
import speiger.src.collections.PACKAGE.functions.function.PREDICATE;
|
||||
#endif
|
||||
@@ -691,6 +698,18 @@ public class LINKED_HASH_MAP KEY_VALUE_GENERIC_TYPE extends HASH_MAP KEY_VALUE_G
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(IntObjectConsumer<MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||
Objects.requireNonNull(action);
|
||||
if(size() <= 0) return;
|
||||
int count = 0;
|
||||
int index = firstIndex;
|
||||
while(index != -1) {
|
||||
action.accept(count++, new BasicEntryKV_BRACES(keys[index], values[index]));
|
||||
index = (int)links[index];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, ObjectObjectConsumer<E, MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||
Objects.requireNonNull(action);
|
||||
@@ -947,6 +966,18 @@ public class LINKED_HASH_MAP KEY_VALUE_GENERIC_TYPE extends HASH_MAP KEY_VALUE_G
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(BI_FROM_INT_CONSUMER KEY_GENERIC_TYPE action) {
|
||||
Objects.requireNonNull(action);
|
||||
if(size() <= 0) return;
|
||||
int count = 0;
|
||||
int index = firstIndex;
|
||||
while(index != -1){
|
||||
action.accept(count++, keys[index]);
|
||||
index = (int)links[index];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, BI_FROM_OBJECT_CONSUMER KSK_GENERIC_TYPE<E> action) {
|
||||
Objects.requireNonNull(action);
|
||||
@@ -1111,6 +1142,18 @@ public class LINKED_HASH_MAP KEY_VALUE_GENERIC_TYPE extends HASH_MAP KEY_VALUE_G
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(VALUE_BI_FROM_INT_CONSUMER VALUE_GENERIC_TYPE action) {
|
||||
Objects.requireNonNull(action);
|
||||
if(size() <= 0) return;
|
||||
int count = 0;
|
||||
int index = firstIndex;
|
||||
while(index != -1){
|
||||
action.accept(count++, values[index]);
|
||||
index = (int)links[index];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, VALUE_BI_FROM_OBJECT_CONSUMER VSV_GENERIC_TYPE<E> action) {
|
||||
Objects.requireNonNull(action);
|
||||
|
||||
+37
@@ -20,6 +20,13 @@ import speiger.src.collections.PACKAGE.collections.ITERATOR;
|
||||
import speiger.src.collections.PACKAGE.functions.CONSUMER;
|
||||
import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
|
||||
#endif
|
||||
import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
|
||||
#if !TYPE_OBJECT && !VALUE_OBJECT
|
||||
import speiger.src.collections.ints.functions.consumer.IntObjectConsumer;
|
||||
#endif
|
||||
#if !SAME_TYPE
|
||||
import speiger.src.collections.ints.functions.consumer.VALUE_BI_FROM_INT_CONSUMER;
|
||||
#endif
|
||||
import speiger.src.collections.PACKAGE.functions.consumer.BI_CONSUMER;
|
||||
#if !VALUE_BOOLEAN || !JDK_TYPE
|
||||
import speiger.src.collections.PACKAGE.functions.function.FUNCTION;
|
||||
@@ -832,6 +839,16 @@ public class HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GENE
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(IntObjectConsumer<MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||
Objects.requireNonNull(action);
|
||||
if(size() <= 0) return;
|
||||
if(containsNull) action.accept(0, new BasicEntryKV_BRACES(keys[nullIndex], values[nullIndex]));
|
||||
for(int i = nullIndex-1, index = containsNull ? 1 : 0;i>=0;i--) {
|
||||
if(KEY_EQUALS_NOT_NULL(keys[i])) action.accept(index++, new BasicEntryKV_BRACES(keys[i], values[i]));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, ObjectObjectConsumer<E, MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||
Objects.requireNonNull(action);
|
||||
@@ -1065,6 +1082,16 @@ public class HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GENE
|
||||
if(KEY_EQUALS_NOT_NULL(keys[i])) action.accept(keys[i]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(BI_FROM_INT_CONSUMER KEY_GENERIC_TYPE action) {
|
||||
Objects.requireNonNull(action);
|
||||
if(size() <= 0) return;
|
||||
if(containsNull) action.accept(0, keys[nullIndex]);
|
||||
for(int i = nullIndex-1, index = containsNull ? 1 : 0;i>=0;i--) {
|
||||
if(KEY_EQUALS_NOT_NULL(keys[i])) action.accept(index++, keys[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, BI_FROM_OBJECT_CONSUMER KSK_GENERIC_TYPE<E> action) {
|
||||
Objects.requireNonNull(action);
|
||||
@@ -1221,6 +1248,16 @@ public class HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GENE
|
||||
if(KEY_EQUALS_NOT_NULL(keys[i])) action.accept(values[i]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(VALUE_BI_FROM_INT_CONSUMER VALUE_GENERIC_TYPE action) {
|
||||
Objects.requireNonNull(action);
|
||||
if(size() <= 0) return;
|
||||
if(containsNull) action.accept(0, values[nullIndex]);
|
||||
for(int i = nullIndex-1, index = containsNull ? 1 : 0;i>=0;i--) {
|
||||
if(KEY_EQUALS_NOT_NULL(keys[i])) action.accept(index++, values[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, VALUE_BI_FROM_OBJECT_CONSUMER VSV_GENERIC_TYPE<E> action) {
|
||||
Objects.requireNonNull(action);
|
||||
|
||||
+43
@@ -19,6 +19,13 @@ import speiger.src.collections.PACKAGE.collections.BI_ITERATOR;
|
||||
import speiger.src.collections.PACKAGE.functions.CONSUMER;
|
||||
import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
|
||||
#endif
|
||||
import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
|
||||
#if !TYPE_OBJECT && !VALUE_OBJECT
|
||||
import speiger.src.collections.ints.functions.consumer.IntObjectConsumer;
|
||||
#endif
|
||||
#if !SAME_TYPE
|
||||
import speiger.src.collections.ints.functions.consumer.VALUE_BI_FROM_INT_CONSUMER;
|
||||
#endif
|
||||
#if !TYPE_OBJECT && !VALUE_BOOLEAN && !JDK_TYPE
|
||||
import speiger.src.collections.PACKAGE.functions.function.PREDICATE;
|
||||
#endif
|
||||
@@ -664,6 +671,18 @@ public class IMMUTABLE_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(IntObjectConsumer<MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||
Objects.requireNonNull(action);
|
||||
if(size() <= 0) return;
|
||||
int count = 0;
|
||||
int index = firstIndex;
|
||||
while(index != -1) {
|
||||
action.accept(count++, new BasicEntryKV_BRACES(keys[index], values[index]));
|
||||
index = (int)links[index];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, ObjectObjectConsumer<E, MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||
Objects.requireNonNull(action);
|
||||
@@ -892,6 +911,18 @@ public class IMMUTABLE_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(BI_FROM_INT_CONSUMER KEY_GENERIC_TYPE action) {
|
||||
Objects.requireNonNull(action);
|
||||
if(size() <= 0) return;
|
||||
int count = 0;
|
||||
int index = firstIndex;
|
||||
while(index != -1){
|
||||
action.accept(count++, keys[index]);
|
||||
index = (int)links[index];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, BI_FROM_OBJECT_CONSUMER KSK_GENERIC_TYPE<E> action) {
|
||||
Objects.requireNonNull(action);
|
||||
@@ -1053,6 +1084,18 @@ public class IMMUTABLE_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(VALUE_BI_FROM_INT_CONSUMER VALUE_GENERIC_TYPE action) {
|
||||
Objects.requireNonNull(action);
|
||||
if(size() <= 0) return;
|
||||
int count = 0;
|
||||
int index = firstIndex;
|
||||
while(index != -1){
|
||||
action.accept(count++, values[index]);
|
||||
index = (int)links[index];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, VALUE_BI_FROM_OBJECT_CONSUMER VSV_GENERIC_TYPE<E> action) {
|
||||
Objects.requireNonNull(action);
|
||||
|
||||
+27
-1
@@ -19,6 +19,13 @@ import speiger.src.collections.PACKAGE.collections.BI_ITERATOR;
|
||||
import speiger.src.collections.PACKAGE.functions.CONSUMER;
|
||||
import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
|
||||
#endif
|
||||
import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
|
||||
#if !TYPE_OBJECT && !VALUE_OBJECT
|
||||
import speiger.src.collections.ints.functions.consumer.IntObjectConsumer;
|
||||
#endif
|
||||
#if !SAME_TYPE
|
||||
import speiger.src.collections.ints.functions.consumer.VALUE_BI_FROM_INT_CONSUMER;
|
||||
#endif
|
||||
#if !TYPE_OBJECT && !VALUE_BOOLEAN && !JDK_TYPE
|
||||
import speiger.src.collections.PACKAGE.functions.function.PREDICATE;
|
||||
#endif
|
||||
@@ -793,6 +800,14 @@ public class ARRAY_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GEN
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(IntObjectConsumer<MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||
Objects.requireNonNull(action);
|
||||
for(int i = 0;i<size;i++) {
|
||||
action.accept(i, new BasicEntryKV_BRACES(keys[i], values[i]));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, ObjectObjectConsumer<E, MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||
Objects.requireNonNull(action);
|
||||
@@ -991,11 +1006,16 @@ public class ARRAY_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GEN
|
||||
for(int i = 0;i<size;action.accept(keys[i++]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(BI_FROM_INT_CONSUMER KEY_GENERIC_TYPE action) {
|
||||
Objects.requireNonNull(action);
|
||||
for(int i = 0;i<size;action.accept(i, keys[i++]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, BI_FROM_OBJECT_CONSUMER KSK_GENERIC_TYPE<E> action) {
|
||||
Objects.requireNonNull(action);
|
||||
for(int i = 0;i<size;action.accept(input, keys[i++]));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1125,6 +1145,12 @@ public class ARRAY_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GEN
|
||||
for(int i = 0;i<size;action.accept(values[i++]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(VALUE_BI_FROM_INT_CONSUMER VALUE_GENERIC_TYPE action) {
|
||||
Objects.requireNonNull(action);
|
||||
for(int i = 0;i<size;action.accept(i, values[i++]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matchesAny(VALUE_PREDICATE VALUE_GENERIC_TYPE filter) {
|
||||
Objects.requireNonNull(filter);
|
||||
|
||||
+47
@@ -24,6 +24,13 @@ import speiger.src.collections.PACKAGE.functions.COMPARATOR;
|
||||
import speiger.src.collections.PACKAGE.functions.CONSUMER;
|
||||
import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
|
||||
#endif
|
||||
import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
|
||||
#if !TYPE_OBJECT && !VALUE_OBJECT
|
||||
import speiger.src.collections.ints.functions.consumer.IntObjectConsumer;
|
||||
#endif
|
||||
#if !SAME_TYPE
|
||||
import speiger.src.collections.ints.functions.consumer.VALUE_BI_FROM_INT_CONSUMER;
|
||||
#endif
|
||||
#if !VALUE_BOOLEAN || !JDK_TYPE
|
||||
import speiger.src.collections.PACKAGE.functions.function.FUNCTION;
|
||||
#endif
|
||||
@@ -1153,6 +1160,14 @@ public class AVL_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_
|
||||
action.accept(entry.key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(BI_FROM_INT_CONSUMER KEY_GENERIC_TYPE action) {
|
||||
Objects.requireNonNull(action);
|
||||
int index = 0;
|
||||
for(Node KEY_VALUE_GENERIC_TYPE entry = start(), end = end();entry != null && (end == null || (end != previous(entry)));entry = next(entry))
|
||||
action.accept(index++, entry.key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, BI_FROM_OBJECT_CONSUMER KSK_GENERIC_TYPE<E> action) {
|
||||
Objects.requireNonNull(action);
|
||||
@@ -1841,6 +1856,14 @@ public class AVL_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_
|
||||
action.accept(new BasicEntryKV_BRACES(entry.key, entry.value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(IntObjectConsumer<MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||
Objects.requireNonNull(action);
|
||||
int index = 0;
|
||||
for(Node KEY_VALUE_GENERIC_TYPE entry = subLowest(), last = subHighest();entry != null && (last == null || last != previous(entry));entry = next(entry))
|
||||
action.accept(index++, new BasicEntryKV_BRACES(entry.key, entry.value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, ObjectObjectConsumer<E, MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||
Objects.requireNonNull(action);
|
||||
@@ -1973,6 +1996,14 @@ public class AVL_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_
|
||||
action.accept(entry.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(VALUE_BI_FROM_INT_CONSUMER VALUE_GENERIC_TYPE action) {
|
||||
Objects.requireNonNull(action);
|
||||
int index = 0;
|
||||
for(Node KEY_VALUE_GENERIC_TYPE entry = subLowest(), last = subHighest();entry != null && (last == null || last != previous(entry));entry = next(entry))
|
||||
action.accept(index++, entry.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, VALUE_BI_FROM_OBJECT_CONSUMER VSV_GENERIC_TYPE<E> action) {
|
||||
Objects.requireNonNull(action);
|
||||
@@ -2321,6 +2352,14 @@ public class AVL_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_
|
||||
action.accept(entry.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(VALUE_BI_FROM_INT_CONSUMER VALUE_GENERIC_TYPE action) {
|
||||
Objects.requireNonNull(action);
|
||||
int index = 0;
|
||||
for(Node KEY_VALUE_GENERIC_TYPE entry = first;entry != null;entry = entry.next())
|
||||
action.accept(index++, entry.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, VALUE_BI_FROM_OBJECT_CONSUMER VSV_GENERIC_TYPE<E> action) {
|
||||
Objects.requireNonNull(action);
|
||||
@@ -2478,6 +2517,14 @@ public class AVL_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_
|
||||
action.accept(new BasicEntryKV_BRACES(entry.key, entry.value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(IntObjectConsumer<MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||
Objects.requireNonNull(action);
|
||||
int index = 0;
|
||||
for(Node KEY_VALUE_GENERIC_TYPE entry = first;entry != null;entry = entry.next())
|
||||
action.accept(index++, new BasicEntryKV_BRACES(entry.key, entry.value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, ObjectObjectConsumer<E, MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||
Objects.requireNonNull(action);
|
||||
|
||||
+47
@@ -23,6 +23,13 @@ import speiger.src.collections.PACKAGE.functions.COMPARATOR;
|
||||
import speiger.src.collections.PACKAGE.functions.CONSUMER;
|
||||
import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
|
||||
#endif
|
||||
import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
|
||||
#if !TYPE_OBJECT && !VALUE_OBJECT
|
||||
import speiger.src.collections.ints.functions.consumer.IntObjectConsumer;
|
||||
#endif
|
||||
#if !SAME_TYPE
|
||||
import speiger.src.collections.ints.functions.consumer.VALUE_BI_FROM_INT_CONSUMER;
|
||||
#endif
|
||||
#if !VALUE_BOOLEAN || !JDK_TYPE
|
||||
import speiger.src.collections.PACKAGE.functions.function.FUNCTION;
|
||||
#endif
|
||||
@@ -1209,6 +1216,14 @@ public class RB_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_G
|
||||
action.accept(entry.key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(BI_FROM_INT_CONSUMER KEY_GENERIC_TYPE action) {
|
||||
Objects.requireNonNull(action);
|
||||
int index = 0;
|
||||
for(Node KEY_VALUE_GENERIC_TYPE entry = start(), end = end();entry != null && (end == null || (end != previous(entry)));entry = next(entry))
|
||||
action.accept(index++, entry.key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, BI_FROM_OBJECT_CONSUMER KSK_GENERIC_TYPE<E> action) {
|
||||
Objects.requireNonNull(action);
|
||||
@@ -1907,6 +1922,14 @@ public class RB_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_G
|
||||
action.accept(new BasicEntryKV_BRACES(entry.key, entry.value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(IntObjectConsumer<MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||
Objects.requireNonNull(action);
|
||||
int index = 0;
|
||||
for(Node KEY_VALUE_GENERIC_TYPE entry = subLowest(), last = subHighest();entry != null && (last == null || last != previous(entry));entry = next(entry))
|
||||
action.accept(index++, new BasicEntryKV_BRACES(entry.key, entry.value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, ObjectObjectConsumer<E, MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||
Objects.requireNonNull(action);
|
||||
@@ -2039,6 +2062,14 @@ public class RB_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_G
|
||||
action.accept(entry.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(VALUE_BI_FROM_INT_CONSUMER VALUE_GENERIC_TYPE action) {
|
||||
Objects.requireNonNull(action);
|
||||
int index = 0;
|
||||
for(Node KEY_VALUE_GENERIC_TYPE entry = subLowest(), last = subHighest();entry != null && (last == null || last != previous(entry));entry = next(entry))
|
||||
action.accept(index++, entry.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, VALUE_BI_FROM_OBJECT_CONSUMER VSV_GENERIC_TYPE<E> action) {
|
||||
Objects.requireNonNull(action);
|
||||
@@ -2387,6 +2418,14 @@ public class RB_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_G
|
||||
action.accept(entry.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(VALUE_BI_FROM_INT_CONSUMER VALUE_GENERIC_TYPE action) {
|
||||
Objects.requireNonNull(action);
|
||||
int index = 0;
|
||||
for(Node KEY_VALUE_GENERIC_TYPE entry = first;entry != null;entry = entry.next())
|
||||
action.accept(index++, entry.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, VALUE_BI_FROM_OBJECT_CONSUMER VSV_GENERIC_TYPE<E> action) {
|
||||
Objects.requireNonNull(action);
|
||||
@@ -2544,6 +2583,14 @@ public class RB_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_G
|
||||
action.accept(new BasicEntryKV_BRACES(entry.key, entry.value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(IntObjectConsumer<MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||
Objects.requireNonNull(action);
|
||||
int index = 0;
|
||||
for(Node KEY_VALUE_GENERIC_TYPE entry = first;entry != null;entry = entry.next())
|
||||
action.accept(index++, new BasicEntryKV_BRACES(entry.key, entry.value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, ObjectObjectConsumer<E, MAP.Entry KEY_VALUE_GENERIC_TYPE> action) {
|
||||
Objects.requireNonNull(action);
|
||||
|
||||
Reference in New Issue
Block a user