diff --git a/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/from_long/to_collection/ListHashed.java b/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/from_long/to_collection/ListHashed.java index 606e18462..38a392fe7 100644 --- a/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/from_long/to_collection/ListHashed.java +++ b/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/from_long/to_collection/ListHashed.java @@ -30,15 +30,13 @@ public class ListHashed implements LongFunction> { private final List> valueFuncs; private final int size; - private final LongToIntFunction sizeFunc; private final Hash hasher = new Hash(); @Example({ "ListFunctions(NumberNameToString(),NumberNameToString())", "Create a list of ['one','one']" }) - public ListHashed(LongToIntFunction sizeFunc, LongFunction... funcs) { - this.sizeFunc = sizeFunc; + public ListHashed(LongFunction... funcs) { this.valueFuncs = Arrays.asList(funcs); this.size = valueFuncs.size(); } @@ -47,12 +45,11 @@ public class ListHashed implements LongFunction> { "ListFunctions(NumberNameToString(),NumberNameToString())", "Create a list of ['one','one']" }) - public ListHashed(LongToIntFunction sizeFunc, LongUnaryOperator... funcs) { + public ListHashed(LongUnaryOperator... funcs) { List> building = new ArrayList<>(funcs.length); for (LongUnaryOperator func : funcs) { building.add(func::applyAsLong); } - this.sizeFunc = sizeFunc; this.valueFuncs = building; this.size = building.size(); } @@ -61,12 +58,11 @@ public class ListHashed implements LongFunction> { "ListFunctions(NumberNameToString(),NumberNameToString())", "Create a list of ['one','one']" }) - public ListHashed(LongToIntFunction sizeFunc, Function... funcs) { + public ListHashed(Function... funcs) { List> building = new ArrayList<>(funcs.length); for (Function func : funcs) { building.add(func::apply); } - this.sizeFunc = sizeFunc; this.valueFuncs = building; this.size = building.size(); } @@ -74,7 +70,6 @@ public class ListHashed implements LongFunction> { @Override public List apply(long value) { long hash = value; - int size = sizeFunc.applyAsInt(value); List list = new ArrayList<>(size); for (int i = 0; i < size; i++) { int selector = Math.min(i, valueFuncs.size() - 1); diff --git a/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/from_long/to_collection/ListSized.java b/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/from_long/to_collection/ListSized.java index 7320e2f2b..82c486333 100644 --- a/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/from_long/to_collection/ListSized.java +++ b/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/from_long/to_collection/ListSized.java @@ -28,7 +28,6 @@ import java.util.function.LongUnaryOperator; public class ListSized implements LongFunction> { private final List> valueFuncs; - private final int size; private final LongToIntFunction sizeFunc; @Example({ @@ -38,7 +37,6 @@ public class ListSized implements LongFunction> { public ListSized(LongToIntFunction sizeFunc, LongFunction... funcs) { this.sizeFunc = sizeFunc; this.valueFuncs = Arrays.asList(funcs); - this.size = valueFuncs.size(); } @Example({ @@ -52,7 +50,6 @@ public class ListSized implements LongFunction> { } this.sizeFunc = sizeFunc; this.valueFuncs = building; - this.size = building.size(); } @Example({ @@ -66,7 +63,6 @@ public class ListSized implements LongFunction> { } this.sizeFunc = sizeFunc; this.valueFuncs = building; - this.size = building.size(); } @Override diff --git a/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/from_long/to_collection/ListSizedHashed.java b/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/from_long/to_collection/ListSizedHashed.java index 5236c578e..af1ca441c 100644 --- a/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/from_long/to_collection/ListSizedHashed.java +++ b/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/from_long/to_collection/ListSizedHashed.java @@ -29,7 +29,6 @@ import java.util.function.LongUnaryOperator; public class ListSizedHashed implements LongFunction> { private final List> valueFuncs; - private final int size; private final Hash hasher = new Hash(); private final LongToIntFunction sizeFunc; @@ -40,7 +39,6 @@ public class ListSizedHashed implements LongFunction> { public ListSizedHashed(LongToIntFunction sizeFunc, LongFunction... funcs) { this.sizeFunc = sizeFunc; this.valueFuncs = Arrays.asList(funcs); - this.size = valueFuncs.size(); } @Example({ @@ -54,7 +52,6 @@ public class ListSizedHashed implements LongFunction> { } this.sizeFunc = sizeFunc; this.valueFuncs = building; - this.size = building.size(); } @Example({ @@ -68,7 +65,6 @@ public class ListSizedHashed implements LongFunction> { } this.sizeFunc = sizeFunc; this.valueFuncs = building; - this.size = building.size(); } @Override diff --git a/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/from_long/to_collection/ListSizedStepped.java b/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/from_long/to_collection/ListSizedStepped.java index 6c150f273..696f1ebf9 100644 --- a/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/from_long/to_collection/ListSizedStepped.java +++ b/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/from_long/to_collection/ListSizedStepped.java @@ -29,7 +29,6 @@ import java.util.function.LongUnaryOperator; public class ListSizedStepped implements LongFunction> { private final List> valueFuncs; - private final int size; private final LongToIntFunction sizeFunc; @Example({ @@ -39,7 +38,6 @@ public class ListSizedStepped implements LongFunction> { public ListSizedStepped(LongToIntFunction sizeFunc, LongFunction... funcs) { this.sizeFunc = sizeFunc; this.valueFuncs = Arrays.asList(funcs); - this.size = valueFuncs.size(); } @Example({ @@ -53,7 +51,6 @@ public class ListSizedStepped implements LongFunction> { } this.sizeFunc = sizeFunc; this.valueFuncs = building; - this.size = building.size(); } @Example({ @@ -67,7 +64,6 @@ public class ListSizedStepped implements LongFunction> { } this.sizeFunc = sizeFunc; this.valueFuncs = building; - this.size = building.size(); } @Override diff --git a/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/from_long/to_collection/ListStepped.java b/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/from_long/to_collection/ListStepped.java index 5ac4f222f..a4058273f 100644 --- a/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/from_long/to_collection/ListStepped.java +++ b/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/from_long/to_collection/ListStepped.java @@ -29,14 +29,12 @@ public class ListStepped implements LongFunction> { private final List> valueFuncs; private final int size; - private final LongToIntFunction sizeFunc; @Example({ "ListFunctions(NumberNameToString(),NumberNameToString())", "Create a list of ['one','one']" }) - public ListStepped(LongToIntFunction sizeFunc, LongFunction... funcs) { - this.sizeFunc = sizeFunc; + public ListStepped(LongFunction... funcs) { this.valueFuncs = Arrays.asList(funcs); this.size = valueFuncs.size(); } @@ -45,12 +43,11 @@ public class ListStepped implements LongFunction> { "ListFunctions(NumberNameToString(),NumberNameToString())", "Create a list of ['one','one']" }) - public ListStepped(LongToIntFunction sizeFunc, LongUnaryOperator... funcs) { + public ListStepped(LongUnaryOperator... funcs) { List> building = new ArrayList<>(funcs.length); for (LongUnaryOperator func : funcs) { building.add(func::applyAsLong); } - this.sizeFunc = sizeFunc; this.valueFuncs = building; this.size = building.size(); } @@ -59,19 +56,17 @@ public class ListStepped implements LongFunction> { "ListFunctions(NumberNameToString(),NumberNameToString())", "Create a list of ['one','one']" }) - public ListStepped(LongToIntFunction sizeFunc, Function... funcs) { + public ListStepped(Function... funcs) { List> building = new ArrayList<>(funcs.length); for (Function func : funcs) { building.add(func::apply); } - this.sizeFunc = sizeFunc; this.valueFuncs = building; this.size = building.size(); } @Override public List apply(long value) { - int size = sizeFunc.applyAsInt(value); List list = new ArrayList<>(size); for (int i = 0; i < size; i++) { int selector = Math.min(i, valueFuncs.size() - 1);