org.apache.commons.lang3.ArrayUtils#EMPTY_CHAR_ARRAY源码实例Demo

下面列出了org.apache.commons.lang3.ArrayUtils#EMPTY_CHAR_ARRAY 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: scheduling   文件: StrBuilder.java
/**
 * Copies the builder's character array into a new character array.
 *
 * @return a new array that represents the contents of the builder
 */
public char[] toCharArray() {
    if (size == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    final char chars[] = new char[size];
    System.arraycopy(buffer, 0, chars, 0, size);
    return chars;
}
 
源代码2 项目: scheduling   文件: StrBuilder.java
/**
 * Copies part of the builder's character array into a new character array.
 *
 * @param startIndex  the start index, inclusive, must be valid
 * @param endIndex  the end index, exclusive, must be valid except that
 *  if too large it is treated as end of string
 * @return a new array that holds part of the contents of the builder
 * @throws IndexOutOfBoundsException if startIndex is invalid,
 *  or if endIndex is invalid (but endIndex greater than size is valid)
 */
public char[] toCharArray(final int startIndex, int endIndex) {
    endIndex = validateRange(startIndex, endIndex);
    final int len = endIndex - startIndex;
    if (len == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    final char chars[] = new char[len];
    System.arraycopy(buffer, startIndex, chars, 0, len);
    return chars;
}
 
源代码3 项目: astor   文件: StrBuilder.java
/**
 * Copies the builder's character array into a new character array.
 * 
 * @return a new array that represents the contents of the builder
 */
public char[] toCharArray() {
    if (size == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[size];
    System.arraycopy(buffer, 0, chars, 0, size);
    return chars;
}
 
源代码4 项目: astor   文件: StrBuilder.java
/**
 * Copies part of the builder's character array into a new character array.
 * 
 * @param startIndex  the start index, inclusive, must be valid
 * @param endIndex  the end index, exclusive, must be valid except that
 *  if too large it is treated as end of string
 * @return a new array that holds part of the contents of the builder
 * @throws IndexOutOfBoundsException if startIndex is invalid,
 *  or if endIndex is invalid (but endIndex greater than size is valid)
 */
public char[] toCharArray(int startIndex, int endIndex) {
    endIndex = validateRange(startIndex, endIndex);
    int len = endIndex - startIndex;
    if (len == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[len];
    System.arraycopy(buffer, startIndex, chars, 0, len);
    return chars;
}
 
源代码5 项目: astor   文件: StrBuilder.java
/**
 * Copies the builder's character array into a new character array.
 * 
 * @return a new array that represents the contents of the builder
 */
public char[] toCharArray() {
    if (size == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[size];
    System.arraycopy(buffer, 0, chars, 0, size);
    return chars;
}
 
源代码6 项目: astor   文件: StrBuilder.java
/**
 * Copies part of the builder's character array into a new character array.
 * 
 * @param startIndex  the start index, inclusive, must be valid
 * @param endIndex  the end index, exclusive, must be valid except that
 *  if too large it is treated as end of string
 * @return a new array that holds part of the contents of the builder
 * @throws IndexOutOfBoundsException if startIndex is invalid,
 *  or if endIndex is invalid (but endIndex greater than size is valid)
 */
public char[] toCharArray(int startIndex, int endIndex) {
    endIndex = validateRange(startIndex, endIndex);
    int len = endIndex - startIndex;
    if (len == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[len];
    System.arraycopy(buffer, startIndex, chars, 0, len);
    return chars;
}
 
源代码7 项目: astor   文件: StrBuilder.java
/**
 * Copies the builder's character array into a new character array.
 * 
 * @return a new array that represents the contents of the builder
 */
public char[] toCharArray() {
    if (size == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[size];
    System.arraycopy(buffer, 0, chars, 0, size);
    return chars;
}
 
源代码8 项目: astor   文件: StrBuilder.java
/**
 * Copies part of the builder's character array into a new character array.
 * 
 * @param startIndex  the start index, inclusive, must be valid
 * @param endIndex  the end index, exclusive, must be valid except that
 *  if too large it is treated as end of string
 * @return a new array that holds part of the contents of the builder
 * @throws IndexOutOfBoundsException if startIndex is invalid,
 *  or if endIndex is invalid (but endIndex greater than size is valid)
 */
public char[] toCharArray(int startIndex, int endIndex) {
    endIndex = validateRange(startIndex, endIndex);
    int len = endIndex - startIndex;
    if (len == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[len];
    System.arraycopy(buffer, startIndex, chars, 0, len);
    return chars;
}
 
源代码9 项目: astor   文件: StrBuilder.java
/**
 * Copies the builder's character array into a new character array.
 * 
 * @return a new array that represents the contents of the builder
 */
public char[] toCharArray() {
    if (size == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    final char chars[] = new char[size];
    System.arraycopy(buffer, 0, chars, 0, size);
    return chars;
}
 
源代码10 项目: astor   文件: StrBuilder.java
/**
 * Copies part of the builder's character array into a new character array.
 * 
 * @param startIndex  the start index, inclusive, must be valid
 * @param endIndex  the end index, exclusive, must be valid except that
 *  if too large it is treated as end of string
 * @return a new array that holds part of the contents of the builder
 * @throws IndexOutOfBoundsException if startIndex is invalid,
 *  or if endIndex is invalid (but endIndex greater than size is valid)
 */
public char[] toCharArray(final int startIndex, int endIndex) {
    endIndex = validateRange(startIndex, endIndex);
    final int len = endIndex - startIndex;
    if (len == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    final char chars[] = new char[len];
    System.arraycopy(buffer, startIndex, chars, 0, len);
    return chars;
}
 
源代码11 项目: astor   文件: StrBuilder.java
/**
 * Copies the builder's character array into a new character array.
 * 
 * @return a new array that represents the contents of the builder
 */
public char[] toCharArray() {
    if (size == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[size];
    System.arraycopy(buffer, 0, chars, 0, size);
    return chars;
}
 
源代码12 项目: astor   文件: StrBuilder.java
/**
 * Copies part of the builder's character array into a new character array.
 * 
 * @param startIndex  the start index, inclusive, must be valid
 * @param endIndex  the end index, exclusive, must be valid except that
 *  if too large it is treated as end of string
 * @return a new array that holds part of the contents of the builder
 * @throws IndexOutOfBoundsException if startIndex is invalid,
 *  or if endIndex is invalid (but endIndex greater than size is valid)
 */
public char[] toCharArray(int startIndex, int endIndex) {
    endIndex = validateRange(startIndex, endIndex);
    int len = endIndex - startIndex;
    if (len == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[len];
    System.arraycopy(buffer, startIndex, chars, 0, len);
    return chars;
}