public int codePointCount(int beginIndex, int endIndex) { return delegator.codePointCount(beginIndex, endIndex); }
public int codePointCount(int beginIndex, int endIndex) { return builder.codePointCount(beginIndex, endIndex); }
public int codePointCount(int beginIndex, int endIndex) { return sb.codePointCount(beginIndex, endIndex); }
@Override @JTranscAsync public synchronized int codePointCount(int beginIndex, int endIndex) { return super.codePointCount(beginIndex, endIndex); }
@Override public TextFormatter pad() { // We'll need this many pad characters (if>0). Note Spec.UNDEFINED<0. int n = spec.width - result.codePointCount(mark, result.length()); if (n > 0) { pad(mark, n); } return this; }
/** * 表示上の幅を取得します。 * @param val */ public static int getDisplayWidth(StringBuilder val){ if (val ==null){ return 0; } int count=0; int i=0; int codePointLen=val.codePointCount(0, val.length()); while(i<codePointLen){ int codePoint=val.codePointAt(i++); if (isHalf(codePoint)){ count++; } else{ count=count+2; } } return count; }
/** * Returns the number of Unicode code points in the given characters sequence, * or 0 if {@code null}. Unpaired surrogates within the text count as one code * point each. * * @param text the character sequence from which to get the count, or {@code null}. * @return the number of Unicode code points, or 0 if the argument is {@code null}. * * @see #codePointCount(CharSequence, int, int) */ public static int codePointCount(final CharSequence text) { if (text == null) return 0; if (text instanceof String) return ((String) text).codePointCount(0, text.length()); if (text instanceof StringBuilder) return ((StringBuilder) text).codePointCount(0, text.length()); if (text instanceof StringBuffer) return ((StringBuffer) text).codePointCount(0, text.length()); if (text instanceof CharBuffer) { final CharBuffer buffer = (CharBuffer) text; if (buffer.hasArray() && !buffer.isReadOnly()) { return Character.codePointCount(buffer.array(), buffer.position(), buffer.limit()); } } return Character.codePointCount(text, 0, text.length()); }
/** * Returns the number of Unicode code points in the given characters sequence, * or 0 if {@code null}. Unpaired surrogates within the text count as one code * point each. * * @param text the character sequence from which to get the count, or {@code null}. * @return the number of Unicode code points, or 0 if the argument is {@code null}. * * @see #codePointCount(CharSequence, int, int) */ public static int codePointCount(final CharSequence text) { if (text == null) return 0; if (text instanceof String) return ((String) text).codePointCount(0, text.length()); if (text instanceof StringBuilder) return ((StringBuilder) text).codePointCount(0, text.length()); if (text instanceof StringBuffer) return ((StringBuffer) text).codePointCount(0, text.length()); if (text instanceof CharBuffer) { final CharBuffer buffer = (CharBuffer) text; if (buffer.hasArray() && !buffer.isReadOnly()) { return Character.codePointCount(buffer.array(), buffer.position(), buffer.limit()); } } return Character.codePointCount(text, 0, text.length()); }
while (i < sb.codePointCount(0, sb.length()) && i < pos) { charCount += Character.charCount(sb.codePointAt(charCount)); i++; while (i < sb.codePointCount(0, sb.length()) && i < pos) { if (i++ < pos - n) { startIndex += Character.charCount(sb.codePointAt(startIndex));
if (text == null) return 0; if (text instanceof String) return ((String) text).codePointCount(fromIndex, toIndex); if (text instanceof StringBuilder) return ((StringBuilder) text).codePointCount(fromIndex, toIndex); if (text instanceof StringBuffer) return ((StringBuffer) text).codePointCount(fromIndex, toIndex); if (text instanceof CharBuffer) {
if (text == null) return 0; if (text instanceof String) return ((String) text).codePointCount(fromIndex, toIndex); if (text instanceof StringBuilder) return ((StringBuilder) text).codePointCount(fromIndex, toIndex); if (text instanceof StringBuffer) return ((StringBuffer) text).codePointCount(fromIndex, toIndex); if (text instanceof CharBuffer) {
codePointCount = buffer.codePointCount(0, printableLength); onLineBegin(true);
codePointCount = buffer.codePointCount(0, printableLength); onLineBegin(true);
int getBreakPos(Token[] tokens) { if (str.codePointCount(0, str.length()) <= maxLineLength) { if (str.codePointCount(0, latestNonSpacesTokenPos) <= maxLineLength) { return str.length(); if (str.codePointCount(0, t.getOffset()) >= lineLength) { if (spacesStart >= 0 && str.codePointCount(0, spacesStart) < maxLineLength) { return t.getOffset(); int cps = str.codePointCount(0, t.getOffset()); if (cps >= lineLength && cps < maxLineLength) { if (isSpaces(t)) { cps = str.codePointCount(0, t.getOffset() + t.getLength()); if (cps >= lineLength && cps < maxLineLength) { if (isSpaces(t)) { int cps = str.codePointCount(0, t.getOffset()); if (cps >= lineLength && cps < maxLineLength) { if (isPossibleBreakBefore(t.getOffset())) { cps = str.codePointCount(0, t.getOffset() + t.getLength()); if (cps >= lineLength && cps < maxLineLength) { if (isPossibleBreakBefore(t.getOffset() + t.getLength())) { if (str.codePointCount(0, t.getOffset()) >= lineLength) { if (i == 0) { return t.getOffset() + t.getLength();
c = previousChar; prefix.setLength(prefix.length() - 1); previousChar = prefix.codePointAt(prefix.codePointCount(0, prefix.length()) - 1);
c = previousChar; prefix.setLength(prefix.length() - 1); previousChar = prefix.codePointAt(prefix.codePointCount(0, prefix.length()) - 1);
for (int i = 0; i < buffer.codePointCount(0, buffer.length()); i++) { final int otherChar = buffer.codePointAt(i); final char startChar = buffer.charAt(i);