Class Concat
- All Implemented Interfaces:
LongFunction<String>
- Direct Known Subclasses:
ConcatArray,ConcatChained,ConcatCycle,ConcatFixed,ConcatHashed,ConcatStepped
This is the core implementation of the Concat style of String
binding. It is the newer and recommended version of Template.
Users should use one of these wrappers:
ConcatCycle- all inputs are the cycle valueConcatHashed- all inputs are a hash of (cycle+step)ConcatStepped- all inputs are (cycle+step)ConcatFixed- all inputs are always the same valueConcatChained- all inputs are chained hashes of the previous one
This implementation is available for specialized use when needed, but the above versions are much more self-explanatory and easy to use.
As with previous implementations, the basic input which is fed to the functions is the sum of the input cycle and the step, where the step is simply the index of the insertion point within the template string. These start at 0, so a template string which contains "{}-{}" will have two steps, 0, and 1. For cycle 35, the first function will take input 35, and the second 36. This can create some local neighborhood similarity in test data, so other forms are provided which can hash the values for an added degree of (effective) randomness and one that chains these so that each set of values from a Concat binding are quite distinct from each other.
Binding functions used to populate each step of the template may have their own bounds
of output values like Combinations. These are easy to use internally since they
work well with the hashing. However, some other functions may operate over the whole space
of long values, and come with no built-in cardinality constraints. It is recommended to
use those with built-in constraints when you want to render a discrete population of values.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final LongBinaryOperatorprotected final LongFunction<String>[]protected final String[] -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
cycleStepMapper
-
literals
-
functions
-
-
Constructor Details
-
Concat
-
Concat
-
-
Method Details
-
apply
- Specified by:
applyin interfaceLongFunction<String>
-