/** * Computes the visual length of the indentation of a * <code>CharSequence</code>, counting a tab character as the size until * the next tab stop and every other whitespace character as one. * * @param line the string to measure the indent of * @param tabSize the visual size of a tab in space equivalents * @return the visual length of the indentation of <code>line</code> * @since 3.1 */ public static int measureIndentLength(CharSequence line, int tabSize) { return IndentManipulation.measureIndentInSpaces(line, tabSize); }
/** * Computes the visual length of the indentation of a * <code>CharSequence</code>, counting a tab character as the size until * the next tab stop and every other whitespace character as one. * * @param line the string to measure the indent of * @param tabSize the visual size of a tab in space equivalents * @return the visual length of the indentation of <code>line</code> * @since 3.1 */ public static int measureIndentLength(CharSequence line, int tabSize) { return IndentManipulation.measureIndentInSpaces(line, tabSize); }
/** * Computes the visual length of the indentation of a * <code>CharSequence</code>, counting a tab character as the size until * the next tab stop and every other whitespace character as one. * * @param line the string to measure the indent of * @param tabSize the visual size of a tab in space equivalents * @return the visual length of the indentation of <code>line</code> * @since 3.1 */ public static int measureIndentLength(CharSequence line, int tabSize) { return IndentManipulation.measureIndentInSpaces(line, tabSize); }
/** * Returns the indentation of the given line in indentation units. Odd spaces are * not counted. This method only analyzes the content of <code>line</code> up to the first * non-whitespace character. * * @param line the string to measure the indent of * @param tabWidth the width of one tab character in space equivalents * @param indentWidth the width of one indentation unit in space equivalents * @return the number of indentation units that line is indented by * @exception IllegalArgumentException if: * <ul> * <li>the given <code>indentWidth</code> is lower than zero</li> * <li>the given <code>tabWidth</code> is lower than zero</li> * <li>the given <code>line</code> is null</li> * </ul> */ public static int measureIndentUnits(CharSequence line, int tabWidth, int indentWidth) { if (indentWidth < 0 || tabWidth < 0 || line == null) { throw new IllegalArgumentException(); } if (indentWidth == 0) return 0; int visualLength= measureIndentInSpaces(line, tabWidth); return visualLength / indentWidth; }
/** * Returns the indentation of the given line in indentation units. Odd spaces are * not counted. This method only analyzes the content of <code>line</code> up to the first * non-whitespace character. * * @param line the string to measure the indent of * @param tabWidth the width of one tab character in space equivalents * @param indentWidth the width of one indentation unit in space equivalents * @return the number of indentation units that line is indented by * @exception IllegalArgumentException if: * <ul> * <li>the given <code>indentWidth</code> is lower than zero</li> * <li>the given <code>tabWidth</code> is lower than zero</li> * <li>the given <code>line</code> is null</li> * </ul> */ public static int measureIndentUnits(CharSequence line, int tabWidth, int indentWidth) { if (indentWidth < 0 || tabWidth < 0 || line == null) { throw new IllegalArgumentException(); } if (indentWidth == 0) return 0; int visualLength= measureIndentInSpaces(line, tabWidth); return visualLength / indentWidth; }
/** * Returns the indentation of the given line in indentation units. Odd spaces are * not counted. This method only analyzes the content of <code>line</code> up to the first * non-whitespace character. * * @param line the string to measure the indent of * @param tabWidth the width of one tab character in space equivalents * @param indentWidth the width of one indentation unit in space equivalents * @return the number of indentation units that line is indented by * @exception IllegalArgumentException if: * <ul> * <li>the given <code>indentWidth</code> is lower than zero</li> * <li>the given <code>tabWidth</code> is lower than zero</li> * <li>the given <code>line</code> is null</li> * </ul> */ public static int measureIndentUnits(CharSequence line, int tabWidth, int indentWidth) { if (indentWidth < 0 || tabWidth < 0 || line == null) { throw new IllegalArgumentException(); } if (indentWidth == 0) return 0; int visualLength= measureIndentInSpaces(line, tabWidth); return visualLength / indentWidth; }
/** * Returns the indentation of the given line in indentation units. Odd spaces are * not counted. This method only analyzes the content of <code>line</code> up to the first * non-whitespace character. * * @param line the string to measure the indent of * @param tabWidth the width of one tab character in space equivalents * @param indentWidth the width of one indentation unit in space equivalents * @return the number of indentation units that line is indented by * @exception IllegalArgumentException if: * <ul> * <li>the given <code>indentWidth</code> is lower than zero</li> * <li>the given <code>tabWidth</code> is lower than zero</li> * <li>the given <code>line</code> is null</li> * </ul> */ public static int measureIndentUnits(CharSequence line, int tabWidth, int indentWidth) { if (indentWidth < 0 || tabWidth < 0 || line == null) { throw new IllegalArgumentException(); } if (indentWidth == 0) return 0; int visualLength= measureIndentInSpaces(line, tabWidth); return visualLength / indentWidth; }
/** * Returns the indentation of the given line in indentation units. Odd spaces are * not counted. This method only analyzes the content of <code>line</code> up to the first * non-whitespace character. * * @param line the string to measure the indent of * @param tabWidth the width of one tab character in space equivalents * @param indentWidth the width of one indentation unit in space equivalents * @return the number of indentation units that line is indented by * @exception IllegalArgumentException if: * <ul> * <li>the given <code>indentWidth</code> is lower than zero</li> * <li>the given <code>tabWidth</code> is lower than zero</li> * <li>the given <code>line</code> is null</li> * </ul> */ public static int measureIndentUnits(CharSequence line, int tabWidth, int indentWidth) { if (indentWidth < 0 || tabWidth < 0 || line == null) { throw new IllegalArgumentException(); } if (indentWidth == 0) return 0; int visualLength= measureIndentInSpaces(line, tabWidth); return visualLength / indentWidth; }
/** * Returns the indentation of the given line in indentation units. Odd spaces are * not counted. This method only analyzes the content of <code>line</code> up to the first * non-whitespace character. * * @param line the string to measure the indent of * @param tabWidth the width of one tab character in space equivalents * @param indentWidth the width of one indentation unit in space equivalents * @return the number of indentation units that line is indented by * @exception IllegalArgumentException if: * <ul> * <li>the given <code>indentWidth</code> is lower than zero</li> * <li>the given <code>tabWidth</code> is lower than zero</li> * <li>the given <code>line</code> is null</li> * </ul> */ public static int measureIndentUnits(CharSequence line, int tabWidth, int indentWidth) { if (indentWidth < 0 || tabWidth < 0 || line == null) { throw new IllegalArgumentException(); } if (indentWidth == 0) return 0; int visualLength= measureIndentInSpaces(line, tabWidth); return visualLength / indentWidth; }