oracle.kv.table

## Interface ArrayValue

- All Superinterfaces:
    Comparable<FieldValue>, FieldValue

      public interface ArrayValue
      extends FieldValue

  ArrayValue extends `FieldValue` to add methods appropriate for array values.
  Since:
    3.0

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ArrayValue` | `add(boolean value)` Adds a new value at the end of the array.
    `ArrayValue` | `add(boolean[] values)` Adds an array of new values at the end of the array.
    `ArrayValue` | `add(byte[] value)` Adds a new value at the end of the array.
    `ArrayValue` | `add(byte[][] values)` Adds an array of new values at the end of the array.
    `ArrayValue` | `add(double value)` Adds a new value at the end of the array.
    `ArrayValue` | `add(double[] values)` Adds an array of new values at the end of the array.
    `ArrayValue` | `add(FieldValue value)` Adds a new value at the end of the array.
    `ArrayValue` | `add(float value)` Adds a new value at the end of the array.
    `ArrayValue` | `add(float[] values)` Adds an array of new values at the end of the array.
    `ArrayValue` | `add(int value)` Adds a new value at the end of the array.
    `ArrayValue` | `add(int[] values)` Adds an array of new values at the end of the array.
    `ArrayValue` | `add(int index, boolean value)` Inserts a new value at the specified index.
    `ArrayValue` | `add(int index, byte[] value)` Inserts a new value at the specified index.
    `ArrayValue` | `add(int index, double value)` Inserts a new value at the specified index.
    `ArrayValue` | `add(int index, FieldValue value)` Inserts a new value at the specified index.
    `ArrayValue` | `add(int index, float value)` Inserts a new value at the specified index.
    `ArrayValue` | `add(int index, int value)` Inserts a new value at the specified index.
    `ArrayValue` | `add(int index, long value)` Inserts a new value at the specified index.
    `ArrayValue` | `add(int index, String value)` Inserts a new value at the specified index.
    `ArrayValue` | `add(long value)` Adds a new value at the end of the array.
    `ArrayValue` | `add(long[] values)` Adds an array of new values at the end of the array.
    `ArrayValue` | `add(String value)` Adds a new value at the end of the array.
    `ArrayValue` | `add(String[] values)` Adds an array of new values at the end of the array.
    `ArrayValue` | `addArray()` Adds a new ArrayValue to the end of the array.
    `ArrayValue` | `addArray(int index)` Inserts a new ArrayValue at the specified index.
    `ArrayValue` | `addEnum(int index, String value)` Inserts a new value at the specified index.
    `ArrayValue` | `addEnum(String value)` Adds a new value at the end of the array.
    `ArrayValue` | `addEnum(String[] values)` Adds an array of new values at the end of the array.
    `ArrayValue` | `addFixed(byte[] value)` Adds a new value at the end of the array.
    `ArrayValue` | `addFixed(byte[][] values)` Adds an array of new values at the end of the array.
    `ArrayValue` | `addFixed(int index, byte[] value)` Inserts a new value at the specified index.
    `MapValue` | `addMap()` Adds a new MapValue to the end of the array.
    `MapValue` | `addMap(int index)` Inserts a new MapValue at the specified index.
    `RecordValue` | `addRecord()` Adds a new RecordValue to the end of the array.
    `RecordValue` | `addRecord(int index)` Inserts a new RecordValue at the specified index.
    `ArrayValue` | `clone()` Create a deep copy of this object.
    `FieldValue` | `get(int index)` Gets the value at the specified index.
    `ArrayDef` | `getDefinition()` Returns the ArrayDef that defines the content of this array.
    `ArrayValue` | `set(int index, boolean value)` Set the value at the specified index.
    `ArrayValue` | `set(int index, byte[] value)` Set the value at the specified index.
    `ArrayValue` | `set(int index, double value)` Set the value at the specified index.
    `ArrayValue` | `set(int index, FieldValue value)` Set the value at the specified index.
    `ArrayValue` | `set(int index, float value)` Set the value at the specified index.
    `ArrayValue` | `set(int index, int value)` Set the value at the specified index.
    `ArrayValue` | `set(int index, long value)` Set the value at the specified index.
    `ArrayValue` | `set(int index, String value)` Set the value at the specified index.
    `ArrayValue` | `setArray(int index)` Sets the value at the specified index with an empty ArrayValue, replacing any existing value at that index.
    `ArrayValue` | `setEnum(int index, String value)` Set the value at the specified index.
    `ArrayValue` | `setFixed(int index, byte[] value)` Set the value at the specified index.
    `MapValue` | `setMap(int index)` Sets the value at the specified index with an empty MapValue, replacing any existing value at that index.
    `RecordValue` | `setRecord(int index)` Sets the value at the specified index with an empty RecordValue, replacing any existing value at that index.
    `int` | `size()` Returns the size of the array.
    `List<FieldValue>` | `toList()` Returns the array values as an unmodifiable list.

    - ### Methods inherited from interface oracle.kv.table.FieldValue

      `asArray, asBinary, asBoolean, asDouble, asEnum, asFixedBinary, asFloat, asIndexKey, asInteger, asLong, asMap, asPrimaryKey, asRecord, asRow, asString, getType, isArray, isBinary, isBoolean, isDouble, isEnum, isFixedBinary, isFloat, isIndexKey, isInteger, isLong, isMap, isNull, isPrimaryKey, isRecord, isRow, isString, toJsonString`

    - ### Methods inherited from interface java.lang.Comparable

      `compareTo`

- - ### Method Detail

    - #### getDefinition

          ArrayDef getDefinition()

      Returns the ArrayDef that defines the content of this array.
      Returns:
        an ArrayDef

    - #### get

          FieldValue get(int index)

      Gets the value at the specified index.
      Parameters:
        `index` - the index to use for the get
      Returns:
        the value at the index or null if none exists
      Throws:
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### size

          int size()

      Returns the size of the array.
      Returns:
        the size of the array

    - #### toList

          List<FieldValue> toList()

      Returns the array values as an unmodifiable list.
      Returns:
        the list of values

    - #### add

          ArrayValue add(FieldValue value)

      Adds a new value at the end of the array.
      Parameters:
        `value` - the value to add
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array

    - #### add

          ArrayValue add(int index,
                       FieldValue value)

      Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.
      Parameters:
        `index` - the index for the entry
        `value` - the value to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### set

          ArrayValue set(int index,
                       FieldValue value)

      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
        `index` - the index for the entry
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### add

          ArrayValue add(int value)

      Adds a new value at the end of the array.
      Parameters:
        `value` - the value to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### add

          ArrayValue add(int[] values)

      Adds an array of new values at the end of the array.
      Parameters:
        `values` - the array of values to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array

    - #### add

          ArrayValue add(int index,
                       int value)

      Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.
      Parameters:
        `index` - the index for the entry
        `value` - the value to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### set

          ArrayValue set(int index,
                       int value)

      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
        `index` - the index for the entry
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### add

          ArrayValue add(long value)

      Adds a new value at the end of the array.
      Parameters:
        `value` - the value to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### add

          ArrayValue add(long[] values)

      Adds an array of new values at the end of the array.
      Parameters:
        `values` - the array of values to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array

    - #### add

          ArrayValue add(int index,
                       long value)

      Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.
      Parameters:
        `index` - the index for the entry
        `value` - the value to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### set

          ArrayValue set(int index,
                       long value)

      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
        `index` - the index for the entry
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### add

          ArrayValue add(String value)

      Adds a new value at the end of the array.
      Parameters:
        `value` - the value to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### add

          ArrayValue add(String[] values)

      Adds an array of new values at the end of the array.
      Parameters:
        `values` - the array of values to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array

    - #### add

          ArrayValue add(int index,
                       String value)

      Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.
      Parameters:
        `index` - the index for the entry
        `value` - the value to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### set

          ArrayValue set(int index,
                       String value)

      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
        `index` - the index for the entry
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### add

          ArrayValue add(double value)

      Adds a new value at the end of the array.
      Parameters:
        `value` - the value to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### add

          ArrayValue add(double[] values)

      Adds an array of new values at the end of the array.
      Parameters:
        `values` - the array of values to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array

    - #### add

          ArrayValue add(int index,
                       double value)

      Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.
      Parameters:
        `index` - the index for the entry
        `value` - the value to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### set

          ArrayValue set(int index,
                       double value)

      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
        `index` - the index for the entry
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### add

          ArrayValue add(float value)

      Adds a new value at the end of the array.
      Parameters:
        `value` - the value to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### add

          ArrayValue add(float[] values)

      Adds an array of new values at the end of the array.
      Parameters:
        `values` - the array of values to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array

    - #### add

          ArrayValue add(int index,
                       float value)

      Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.
      Parameters:
        `index` - the index for the entry
        `value` - the value to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### set

          ArrayValue set(int index,
                       float value)

      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
        `index` - the index for the entry
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### add

          ArrayValue add(boolean value)

      Adds a new value at the end of the array.
      Parameters:
        `value` - the value to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### add

          ArrayValue add(boolean[] values)

      Adds an array of new values at the end of the array.
      Parameters:
        `values` - the array of values to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array

    - #### add

          ArrayValue add(int index,
                       boolean value)

      Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.
      Parameters:
        `index` - the index for the entry
        `value` - the value to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### set

          ArrayValue set(int index,
                       boolean value)

      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
        `index` - the index for the entry
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### add

          ArrayValue add(byte[] value)

      Adds a new value at the end of the array.
      Parameters:
        `value` - the value to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### add

          ArrayValue add(byte[][] values)

      Adds an array of new values at the end of the array.
      Parameters:
        `values` - the array of values to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array

    - #### add

          ArrayValue add(int index,
                       byte[] value)

      Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.
      Parameters:
        `index` - the index for the entry
        `value` - the value to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### set

          ArrayValue set(int index,
                       byte[] value)

      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
        `index` - the index for the entry
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### addFixed

          ArrayValue addFixed(byte[] value)

      Adds a new value at the end of the array.
      Parameters:
        `value` - the value to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### addFixed

          ArrayValue addFixed(byte[][] values)

      Adds an array of new values at the end of the array.
      Parameters:
        `values` - the array of values to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array

    - #### addFixed

          ArrayValue addFixed(int index,
                            byte[] value)

      Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.
      Parameters:
        `index` - the index for the entry
        `value` - the value to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### setFixed

          ArrayValue setFixed(int index,
                            byte[] value)

      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
        `index` - the index for the entry
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### addEnum

          ArrayValue addEnum(String value)

      Adds a new value at the end of the array.
      Parameters:
        `value` - the value to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array

    - #### addEnum

          ArrayValue addEnum(String[] values)

      Adds an array of new values at the end of the array.
      Parameters:
        `values` - the array of values to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array

    - #### addEnum

          ArrayValue addEnum(int index,
                           String value)

      Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.
      Parameters:
        `index` - the index for the entry
        `value` - the value to insert
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### setEnum

          ArrayValue setEnum(int index,
                           String value)

      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
        `index` - the index for the entry
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### setRecord

          RecordValue setRecord(int index)

      Sets the value at the specified index with an empty RecordValue, replacing any existing value at that index. The returned object is empty and must be further initialized based on the definition of the field.
      Parameters:
        `index` - the index of the entry to set
      Returns:
        an empty instance of RecordValue
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array

    - #### addRecord

          RecordValue addRecord()

      Adds a new RecordValue to the end of the array. The returned object is empty and must be further initialized based on the definition of the field.
      Returns:
        an empty RecordValue
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array

    - #### addRecord

          RecordValue addRecord(int index)

      Inserts a new RecordValue at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right. The returned object is empty and must be further initialized based on the definition of the field.
      Parameters:
        `index` - the index for the entry
      Returns:
        an empty RecordValue
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### setMap

          MapValue setMap(int index)

      Sets the value at the specified index with an empty MapValue, replacing any existing value at that index. The returned object is empty and must be further initialized based on the definition of the field.
      Parameters:
        `index` - the index of the entry to set
      Returns:
        an empty MapValue
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### addMap

          MapValue addMap()

      Adds a new MapValue to the end of the array. The returned object is empty and must be further initialized based on the definition of the field.
      Returns:
        an empty MapValue
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array

    - #### addMap

          MapValue addMap(int index)

      Inserts a new MapValue at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right. The returned object is empty and must be further initialized based on the definition of the field.
      Parameters:
        `index` - the index for the entry
      Returns:
        an empty MapValue
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### setArray

          ArrayValue setArray(int index)

      Sets the value at the specified index with an empty ArrayValue, replacing any existing value at that index. The returned object is empty and must be further initialized based on the definition of the field.
      Parameters:
        `index` - the index of the entry to set
      Returns:
        an empty ArrayValue
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array

    - #### addArray

          ArrayValue addArray()

      Adds a new ArrayValue to the end of the array. The returned object is empty and must be further initialized based on the definition of the field.
      Returns:
        an empty ArrayValue
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array

    - #### addArray

          ArrayValue addArray(int index)

      Inserts a new ArrayValue at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right. The returned object is empty and must be further initialized based on the definition of the field.
      Parameters:
        `index` - the index for the entry
      Returns:
        an empty ArrayValue
      Throws:
        `IllegalArgumentException` - if the definition of the value does not match that of the array
        `IndexOutOfBoundsException` - if the index is out of range for the array (index < 0 || index >= size())

    - #### clone

          ArrayValue clone()

      Description copied from interface: `FieldValue`
      Create a deep copy of this object.
      Specified by:
        `clone` in interface `FieldValue`
      Returns:
        a deep copy of this object.

Copyright (c) 2011, 2014 Oracle and/or its affiliates. All rights reserved.