Package: org.apache.groovy.json.internal

## [Java] Class ValueList

- org.apache.groovy.json.internal.ValueList

-     public class ValueList
      extends AbstractList

  List implementation that lazily converts overlay Value instances on access.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `ValueList(boolean lazyChop)` Creates a lazy list wrapper.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public boolean` | `add(Object obj)` Adds a parsed element without forcing conversion.
    `` | `public void` | `chopList()` Chops every overlay-backed element currently stored in the list.
    `` | `public void` | `clear()` Removes all of the elements from this list (optional operation). The list will be empty after this call returns. throws: UnsupportedOperationException if the `clear` operation is not supported by this list Implementation Requirements: This implementation calls `removeRange(0, size())`. Note that this implementation throws an `UnsupportedOperationException` unless `remove(int index)` or `removeRange(int fromIndex, int toIndex)` is overridden.
    `` | `public Object` | `get(int index)` Converts the indexed element on demand and optionally chops nested containers.
    `` | `public Iterator<Object>` | `iterator()` Returns an iterator after materializing all pending Value entries.
    `` | `public List<Object>` | `list()` Exposes the raw backing list used during lazy parsing.
    `` | `public int` | `size()`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class AbstractList` | `add, add, addAll, addAll, clear, contains, containsAll, equals, forEach, get, getClass, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, notify, notifyAll, parallelStream, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, size, sort, spliterator, stream, subList, toArray, toArray, toArray, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### public ValueList(boolean lazyChop)

      Creates a lazy list wrapper.

      Parameters:
        `lazyChop` - whether nested values should be chopped when touched

  - ### Method Detail

    - #### public boolean add(Object obj)

      Adds a parsed element without forcing conversion.

      Parameters:
        `obj` - element to append
      Returns:
        `true`

    - #### public void chopList()

      Chops every overlay-backed element currently stored in the list.

    - #### public void clear()

      Removes all of the elements from this list (optional operation). The list will be empty after this call returns.

      throws:
        UnsupportedOperationException if the `clear` operation is not supported by this list
      Implementation Requirements:
        This implementation calls `removeRange(0, size())`.

        Note that this implementation throws an `UnsupportedOperationException` unless `remove(int index)` or `removeRange(int fromIndex, int toIndex)` is overridden.

    - #### public Object get(int index)

      Converts the indexed element on demand and optionally chops nested containers.

      Parameters:
        `index` - element index
      Returns:
        the materialized element

    - #### public Iterator<Object> iterator()

      Returns an iterator after materializing all pending Value entries.

      Returns:
        iterator over hydrated elements

    - #### public List<Object> list()

      Exposes the raw backing list used during lazy parsing.

      Returns:
        the mutable backing list

    - #### public int size()