public void visit(Ticks n) { if (ticks == null) ticks = new ArrayList<TicksAnalyzer.LineEntry>(); int tickCount = n.getTickCount(); switch (tickCount) { case 2: ticks.add(new LineEntry(null, null, 2)); ++numItalics; break; case 3: ticks.add(new LineEntry(previous, null, 3)); ++numBold; break; case 4: ticks.add(new LineEntry(previous, new Text("'"), 3)); ++numBold; break; case 5: ticks.add(new LineEntry(null, null, 5)); ++numBold; ++numItalics; break; default: if (n.getTickCount() <= 5) throw new FmtInternalLogicError(); String excessTicks = StringUtils.strrep('\'', tickCount - 5); ticks.add(new LineEntry(null, new Text(excessTicks), 5)); ++numBold; ++numItalics; break; } }
private void writeNewlines(int num) { finishLine(); sb.append(StringUtils.strrep('\n', num)); needNewlines = 0; needSpace = false; }