Package: org.apache.groovy.json.internal

## [Java] Class Chr

- org.apache.groovy.json.internal.Chr

-     public class Chr
      extends Object

  Character array helpers used by the JSON internals.

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public static void` | `_idx(char[] buffer, int location, byte[] chars)` Copies a byte array into a character buffer.
    `` | `public static void` | `_idx(char[] array, int startIndex, char[] input)` Copies a character array into another array.
    `` | `public static void` | `_idx(char[] array, int startIndex, char[] input, int inputLength)` Copies a fixed number of characters into another array.
    `` | `public static void` | `_idx(char[] buffer, int location, byte[] chars, int start, int end)` Copies part of a byte array into a character buffer.
    `` | `public static char[]` | `add(char[] array, char v)` Appends a character to a new array copy.
    `` | `public static char[]` | `add(char[] array, String str)` Appends a string to a new array copy.
    `` | `public static char[]` | `add(char[] array, StringBuilder stringBuilder)` Appends a StringBuilder to a new array copy.
    `` | `public static char[]` | `add(char[] array, char[] array2)` Concatenates two character arrays.
    `` | `public static char[]` | `add(char[] strings)` Concatenates all non-null arrays.
    `` | `public static char[]` | `array(char array)` Returns the supplied characters as an array literal helper.
    `` | `public static char[]` | `chars(String array)` Converts a string to a character array.
    `` | `public static boolean` | `contains(char[] chars, char c, int start, int length)` Tests whether the supplied range contains a character.
    `` | `public static char[]` | `copy(char[] array)` Copies an entire character array.
    `` | `public static char[]` | `copy(char[] array, int offset, int length)` Copies a character range into a new array.
    `` | `public static char[]` | `grow(char[] array, int size)` Grows an array by the supplied increment.
    `` | `public static char[]` | `grow(char[] array)` Doubles the size of an array.
    `` | `public static boolean` | `in(char value, char[] array)` Tests whether the supplied character occurs in the array.
    `` | `public static boolean` | `in(int value, char[] array)` Tests whether the supplied character code occurs in the array.
    `` | `public static boolean` | `in(char value, int offset, char[] array)` Tests whether the supplied character occurs in the array from the given offset.
    `` | `public static boolean` | `in(char value, int offset, int end, char[] array)` Tests whether the supplied character occurs in the specified array range.
    `` | `public static char[]` | `lpad(char[] in, int size, char pad)` Left-pads a character array to the requested size.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### public static void _idx(char[] buffer, int location, byte[] chars)

      Copies a byte array into a character buffer.

      Parameters:
        `buffer` - the destination buffer
        `location` - the destination offset
        `chars` - the bytes to copy

    - #### public static void _idx(char[] array, int startIndex, char[] input)

      Copies a character array into another array.

      Parameters:
        `array` - the destination array
        `startIndex` - the destination offset
        `input` - the characters to copy

    - #### public static void _idx(char[] array, int startIndex, char[] input, int inputLength)

      Copies a fixed number of characters into another array.

      Parameters:
        `array` - the destination array
        `startIndex` - the destination offset
        `input` - the source characters
        `inputLength` - the number of characters to copy

    - #### public static void _idx(char[] buffer, int location, byte[] chars, int start, int end)

      Copies part of a byte array into a character buffer.

      Parameters:
        `buffer` - the destination buffer
        `location` - the destination offset
        `chars` - the source bytes
        `start` - the inclusive source start
        `end` - the exclusive source end

    - #### public static char[] add(char[] array, char v)

      Appends a character to a new array copy.

      Parameters:
        `array` - the source array
        `v` - the character to append
      Returns:
        the new array

    - #### public static char[] add(char[] array, String str)

      Appends a string to a new array copy.

      Parameters:
        `array` - the source array
        `str` - the string to append
      Returns:
        the new array

    - #### public static char[] add(char[] array, StringBuilder stringBuilder)

      Appends a StringBuilder to a new array copy.

      Parameters:
        `array` - the source array
        `stringBuilder` - the characters to append
      Returns:
        the new array

    - #### public static char[] add(char[] array, char[] array2)

      Concatenates two character arrays.

      Parameters:
        `array` - the first array
        `array2` - the second array
      Returns:
        the concatenated array

    - #### public static char[] add(char[] strings)

      Concatenates all non-null arrays.

      Parameters:
        `strings` - the arrays to concatenate
      Returns:
        the concatenated array

    - #### public static char[] array(char array)

      Returns the supplied characters as an array literal helper.

      Parameters:
        `array` - the characters to return
      Returns:
        the supplied array

    - #### public static char[] chars(String array)

      Converts a string to a character array.

      Parameters:
        `array` - the string to convert
      Returns:
        the string characters

    - #### public static boolean contains(char[] chars, char c, int start, int length)

      Tests whether the supplied range contains a character.

      Parameters:
        `chars` - the array to scan
        `c` - the character to find
        `start` - the inclusive scan start
        `length` - the number of characters to scan
      Returns:
        `true` if the character is present

    - #### public static char[] copy(char[] array)

      Copies an entire character array.

      Parameters:
        `array` - the array to copy
      Returns:
        the copied array

    - #### public static char[] copy(char[] array, int offset, int length)

      Copies a character range into a new array.

      Parameters:
        `array` - the source array
        `offset` - the inclusive start index
        `length` - the number of characters to copy
      Returns:
        the copied range

    - #### public static char[] grow(char[] array, int size)

      Grows an array by the supplied increment.

      Parameters:
        `array` - the array to grow
        `size` - the number of extra slots to allocate
      Returns:
        the grown array

    - #### public static char[] grow(char[] array)

      Doubles the size of an array.

      Parameters:
        `array` - the array to grow
      Returns:
        the grown array

    - #### public static boolean in(char value, char[] array)

      Tests whether the supplied character occurs in the array.

      Parameters:
        `value` - the character to find
        `array` - the array to scan
      Returns:
        `true` if the character is present

    - #### public static boolean in(int value, char[] array)

      Tests whether the supplied character code occurs in the array.

      Parameters:
        `value` - the character code to find
        `array` - the array to scan
      Returns:
        `true` if the character is present

    - #### public static boolean in(char value, int offset, char[] array)

      Tests whether the supplied character occurs in the array from the given offset.

      Parameters:
        `value` - the character to find
        `offset` - the inclusive scan start
        `array` - the array to scan
      Returns:
        `true` if the character is present

    - #### public static boolean in(char value, int offset, int end, char[] array)

      Tests whether the supplied character occurs in the specified array range.

      Parameters:
        `value` - the character to find
        `offset` - the inclusive scan start
        `end` - the exclusive scan end
        `array` - the array to scan
      Returns:
        `true` if the character is present

    - #### public static char[] lpad(char[] in, int size, char pad)

      Left-pads a character array to the requested size.

      Parameters:
        `in` - the input array
        `size` - the target size
        `pad` - the padding character
      Returns:
        the padded array, or the input if no padding is needed