@Test public void testCharWidth() { AttributedStringBuilder sb = new AttributedStringBuilder(); sb.append("\u2329\u2329\u2329\u2329"); assertEquals(4, sb.length()); assertEquals(8, sb.columnLength()); assertEquals("", sb.columnSubSequence(0, 1).toString()); assertEquals("\u2329", sb.columnSubSequence(1, 3).toString()); assertEquals("\u2329\u2329\u2329", sb.columnSubSequence(3, 8).toString()); }
@Override public int length() { return end - start; }
AttributedString extends AttributedCharSequence { @Override public int length() { return end - start; } }
AttributedString extends AttributedCharSequence { @Override public int length() { return end - start; } AttributedString(CharSequence str);  AttributedString(CharSequence str, int start, int end);  AttributedString(CharSequence str, AttributedStyle s);  AttributedString(CharSequence str, int start, int end, AttributedStyle s);   AttributedString(char[] buffer, int[] style, int start, int end); }
AttributedString extends AttributedCharSequence { @Override public int length() { return end - start; } AttributedString(CharSequence str);  AttributedString(CharSequence str, int start, int end);  AttributedString(CharSequence str, AttributedStyle s);  AttributedString(CharSequence str, int start, int end, AttributedStyle s);   AttributedString(char[] buffer, int[] style, int start, int end); static AttributedString fromAnsi(String ansi); static AttributedString fromAnsi(String ansi, int tabs); static AttributedString fromAnsi(String ansi, List<Integer> tabs); static String stripAnsi(String ansi); @Override int length(); @Override AttributedStyle styleAt(int index); @Override AttributedString subSequence(int start, int end); AttributedString styleMatches(Pattern pattern, AttributedStyle style); @Override boolean equals(Object o); @Override int hashCode(); static AttributedString join(AttributedString delimiter, AttributedString... elements); static AttributedString join(AttributedString delimiter, Iterable<AttributedString> elements); }
AttributedString extends AttributedCharSequence { @Override public int length() { return end - start; } AttributedString(CharSequence str);  AttributedString(CharSequence str, int start, int end);  AttributedString(CharSequence str, AttributedStyle s);  AttributedString(CharSequence str, int start, int end, AttributedStyle s);   AttributedString(char[] buffer, int[] style, int start, int end); static AttributedString fromAnsi(String ansi); static AttributedString fromAnsi(String ansi, int tabs); static AttributedString fromAnsi(String ansi, List<Integer> tabs); static String stripAnsi(String ansi); @Override int length(); @Override AttributedStyle styleAt(int index); @Override AttributedString subSequence(int start, int end); AttributedString styleMatches(Pattern pattern, AttributedStyle style); @Override boolean equals(Object o); @Override int hashCode(); static AttributedString join(AttributedString delimiter, AttributedString... elements); static AttributedString join(AttributedString delimiter, Iterable<AttributedString> elements); static final AttributedString EMPTY; static final AttributedString NEWLINE; }