public Selector removeAppenders(Selector selector) { selector = replaceLeadingAppendersByEmptiness(selector); if (!selector.containsAppender()) return selector; Selector replacement = replaceMiddleAppendersByEmptiness(selector); return replacement; }
public List<Selector> replaceAppenders(Selector inSelector, List<Selector> replacements) { if (!inSelector.containsAppender()) { return indirectJoinAll(replacements, null, inSelector); } List<Selector> result = Arrays.asList(inSelector); while (result.get(0).containsAppender()) { List<Selector> nextRound = new ArrayList<Selector>(); for (Selector tbch : result) { nextRound.addAll(replaceFirstAppender(tbch, replacements)); } result = nextRound; } return result; }