/** * writeln purpose. * * <p>Writes the String specified to the stored output writer. * * @param s The String to write. * @throws ConfigurationException When an IO exception occurs. */ public void writeln(String s) throws ConfigurationException { try { writer.write(indentBuffer.subSequence(0, indent) + s + "\n"); writer.flush(); } catch (IOException e) { throw new ConfigurationException("Writeln" + writer, e); } }
public TextGrid getSubGrid(int x, int y, int width, int height){ TextGrid grid = new TextGrid(width, height); for(int i = 0; i < height; i++){ grid.setRow(i, new StringBuffer(getRow(y + i).subSequence(x, x + width))); } return grid; }
/** * Constructs a new NGramEntry * * @param seq is the sequence of characters of the ngram * @param count is the number of occurrences of this ngram */ public NGramEntry(String seq, int count) { this.seq = new StringBuffer(seq).subSequence(0, seq.length()); this.count = count; }
/** * @param word * @param n sequence length */ private void add(StringBuffer word, int n) { for (int i = 0; i <= word.length() - n; i++) { add(word.subSequence(i, i + n)); } }
if (orderByIndex > 0 && orderByIndex > lastClosed) { orderBy = sql.subSequence(orderByIndex, sql.length()); sql.delete(orderByIndex, orderByIndex + orderBy.length()); } else {
@Override public CharSequence subSequence(int start, int end) { return sb.subSequence(start, end); } }
@Override public CharSequence subSequence(int start, int end) { return sb.subSequence(start, end); } }
@Override public CharSequence subSequence( int start, int end ) { return output.subSequence( start, end ); }
/** * @since 3.12 */ @Override public CharSequence subSequence(int start, int end) { return fBuffer.subSequence(start, end); }
/** * Constructs a new NGramEntry * * @param seq is the sequence of characters of the ngram * @param count is the number of occurrences of this ngram */ public NGramEntry(String seq, int count) { this.seq = new StringBuffer(seq).subSequence(0, seq.length()); this.count = count; }
/** * Constructs a new NGramEntry * * @param seq is the sequence of characters of the ngram * @param count is the number of occurrences of this ngram */ public NGramEntry(String seq, int count) { this.seq = new StringBuffer(seq).subSequence(0, seq.length()); this.count = count; }
private CharSequence getColumnsString(List<String> columns) { StringBuffer stb = new StringBuffer(); for (String s : columns) { stb.append("\""); stb.append(s); stb.append("\","); } return stb.subSequence(0, stb.length() - 1); }
/** * @param word * @param n sequence length */ private void add(StringBuffer word, int n) { for (int i = 0; i <= word.length() - n; i++) { add(word.subSequence(i, i + n)); } }
/** * @param word * @param n sequence length */ private void add(StringBuffer word, int n) { for (int i = 0; i <= word.length() - n; i++) { add(word.subSequence(i, i + n)); } }
@Override public CharSequence subSequence(int start, int end) { return buffer().subSequence(start, end); }
@Override public CharSequence subSequence(int start, int end) { return buffer().subSequence(start, end); }
private void writePayload(StringBuilder builder, StringWriter stringWriter, LogEvent event) { StringBuffer buffer = stringWriter.getBuffer(); if (buffer.length() > lim) { builder.append(buffer.subSequence(0, lim)); event.setTruncated(true); } else { builder.append(buffer); event.setTruncated(false); } } }
private void writePayload(StringBuilder builder, StringWriter stringWriter, LogEvent event) { StringBuffer buffer = stringWriter.getBuffer(); if (buffer.length() > lim) { builder.append(buffer.subSequence(0, lim)); event.setTruncated(true); } else { builder.append(buffer); event.setTruncated(false); } } }
public TextGrid getSubGrid(int x, int y, int width, int height){ TextGrid grid = new TextGrid(width, height); for(int i = 0; i < height; i++){ grid.setRow(i, new StringBuffer(getRow(y + i).subSequence(x, x + width))); } return grid; }
@Test public void subSequenceTest() { sb.append("0123456789"); for (int i = 2; i < sb.length(); i++) { assertEquals(sb.subSequence(1, i), sbw.subSequence(1, i)); } } }