/** * Workaround for RFE #4093999 ("Relax constraint on placement of this()/super() * call in constructors") */ private ExpandedTabWriter(final LineAppender formatter) { super(IO.asWriter(formatter)); this.formatter = formatter; formatter.setTabulationExpanded(true); }
/** * Moves to the first column on the next row. * The subsequent writing operations will occur on a new row. */ public void nextLine() { nextLine(SPACE); }
/** * Returns a clone of this format. * * @return a clone of this format. */ @Override public TabularFormat<T> clone() { return (TabularFormat<T>) super.clone(); } }
/** * Invoked when the formatter needs to move to the next column. */ private void nextColumn(final TableAppender table) { table.append(beforeFill); table.nextColumn(fillCharacter); }
/** * Moves one column to the right. * The subsequent writing operations will occur in a new cell on the same row. */ public void nextColumn() { nextColumn(SPACE); }
/** * Returns a clone of this format. * * @return a clone of this format. */ @Override public TreeTableFormat clone() { final TreeTableFormat c = (TreeTableFormat) super.clone(); c.recursivityGuard = null; return c; } }
/** * Tests a few {@link java.io.Writer#write(String)} calls, * with Unix line terminators in the sequences. * * @throws IOException should never happen since the tests will write in a buffer. */ public void testSequencesToWriter() throws IOException { appender = IO.asWriter(appender); run("\n"); } }
/** * If {@link #out} implements {@link java.io.Flushable}, or is a {@link Appender} wrapper * around a flushable object, delegates to that object. Otherwise do nothing. */ @Override @SuppressWarnings("SynchronizeOnNonFinalField") public void flush() throws IOException { synchronized (lock) { IO.flush(out); } }
/** * Resolves to the singleton instance on deserialization. */ private Object readResolve() throws ObjectStreamException { final Format format = getInstance(type); return (format != null) ? format : this; } }
/** * Creates a new filtered formatter which will send its output to the given stream or buffer. * * @param out the underlying character output stream or buffer. */ AppendableWriter(final Appendable out) { super(getLock(out)); this.out = out; }
/** * If {@link #out} implements {@link java.io.Closeable}, or is a {@link Appender} wrapper * around a closeable object, delegates to that object. Otherwise just flush (if possible). */ @Override @SuppressWarnings("SynchronizeOnNonFinalField") public void close() throws IOException { synchronized (lock) { IO.close(out); } }
/** * Uses a appender which will redirect every {@link Appendable#append(CharSequence)} * calls to a sequence of {@link Appendable#append(char)} calls. */ private void useSingleChars() { appender = new SingleCharAppendable(appender); }
/** * Moves to the next column. */ private void nextColumn(final TableAppender table) { table.append(beforeFill).nextColumn(fillCharacter); }
/** * Moves one column to the right. * The subsequent writing operations will occur in a new cell on the same row. */ public void nextColumn() { nextColumn(SPACE); }
/** * Returns a clone of this format. * * @return a clone of this format. */ @Override public FeatureFormat clone() { return (FeatureFormat) super.clone(); } }
/** * Returns a clone of this format. * * @return a clone of this format. */ @Override public TabularFormat<T> clone() { return (TabularFormat<T>) super.clone(); } }
/** * Resolves to the singleton instance on deserialization. */ private Object readResolve() throws ObjectStreamException { final Format format = getInstance(type); return (format != null) ? format : this; } }
/** * Invoked when the formatter needs to move to the next column. */ private void nextColumn(final TableAppender table) { table.append(beforeFill); table.nextColumn(fillCharacter); }
/** * Returns a clone of this format. * * @return a clone of this format. */ @Override public StatisticsFormat clone() { return (StatisticsFormat) super.clone(); } }
/** * Returns a clone of this format. * * @return a clone of this format. */ @Override public LocationFormat clone() { return (LocationFormat) super.clone(); } }