@Override
RandomizerOperationComponent generate(DocOpAutomaton a, boolean valid, Stage stage) {
if (stage != Stage.S1_UNRESTRICTED) {
return null;
}
ValidationResult v = a.checkCharacters("a", null);
if (v.isIllFormed()) {
return null;
}
int count;
if (valid) {
if (!v.isValid()) {
return null;
}
// TODO: implement this once we have size limits.
int max = p.getMaxInsertLength();
if (max == 0) {
return null;
}
count = randomIntFromRange(r, 1, max + 1);
} else {
if (v.isValid()) {
// Exceed length of document (if p.maxInsertLength allows it).
int max = p.getMaxInsertLength();
// TODO: implement this once we have size limits.
//count = randomIntFromRange(r, min, max + 1);
return null;