public boolean build(StringBuilder stringBuilder, Deque<Step> steps) { if (hasCurrentTransition()) { currentChar++; } else if (!moveToNextTransition()) { removeLastChar(stringBuilder); return false; } if (currentChar <= currentTransition.getMax()) { stringBuilder.append(currentChar); if (currentTransition.getDest().isAccept()) { pushForDestinationOfCurrentTransition(steps); if (currentChar >= currentTransition.getMax()) { currentTransition = null; } return true; } pushForDestinationOfCurrentTransition(steps); return false; } steps.push(this); currentTransition = null; return false; }
public boolean build(StringBuilder stringBuilder, Deque<Step> steps) { if (hasCurrentTransition()) { currentChar++; } else if (!moveToNextTransition()) { removeLastChar(stringBuilder); return false; } if (currentChar <= currentTransition.getMax()) { stringBuilder.append(currentChar); if (currentTransition.getDest().isAccept()) { pushForDestinationOfCurrentTransition(steps); if (currentChar >= currentTransition.getMax()) { currentTransition = null; } return true; } pushForDestinationOfCurrentTransition(steps); return false; } steps.push(this); currentTransition = null; return false; }