org.apache.calcite.avatica.util

## Class ArrayImpl

- java.lang.Object
- - org.apache.calcite.avatica.util.ArrayImpl

All Implemented Interfaces:
  Array

    public class ArrayImpl
    extends Object
    implements Array

Implementation of JDBC `Array`.

### Nested Class Summary

Nested Classes
`static interface` `ArrayImpl.Factory` Factory that can create a ResultSet or Array based on a stream of values.

### Field Summary

Fields
`private AbstractCursor.ArrayAccessor` `accessor`
`private List<Object>` `list`

### Constructor Summary

Constructors
Constructor and Description
`ArrayImpl(List<Object> list, AbstractCursor.ArrayAccessor accessor)`

### Method Summary

All Methods Instance Methods Concrete Methods
`private void` `append(StringBuilder buf, Object o)`
`void` `free()`
`Object` `getArray()`
`protected Object` `getArray(List<?> list, AbstractCursor.ArrayAccessor arrayAccessor)` Converts a list into an array.
`Object` `getArray(long index, int count)`
`Object` `getArray(long index, int count, Map<String,Class<?>> map)`
`Object` `getArray(Map<String,Class<?>> map)`
`(package private) Object` `getArrayData(Object o, AbstractCursor.ArrayAccessor componentAccessor)`
`int` `getBaseType()`
`String` `getBaseTypeName()`
`ResultSet` `getResultSet()`
`ResultSet` `getResultSet(long index, int count)`
`ResultSet` `getResultSet(long index, int count, Map<String,Class<?>> map)`
`ResultSet` `getResultSet(Map<String,Class<?>> map)`
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### list

    private final List<Object> list

#### accessor

    private final AbstractCursor.ArrayAccessor accessor

### Constructor Detail

#### ArrayImpl

    public ArrayImpl(List<Object> list,
                     AbstractCursor.ArrayAccessor accessor)

### Method Detail

#### getBaseTypeName

    public String getBaseTypeName()
                           throws SQLException

Specified by:
  `getBaseTypeName` in interface `Array`
Throws:
  `SQLException`

#### getBaseType

    public int getBaseType()
                    throws SQLException

Specified by:
  `getBaseType` in interface `Array`
Throws:
  `SQLException`

#### getArray

    public Object getArray()
                    throws SQLException

Specified by:
  `getArray` in interface `Array`
Throws:
  `SQLException`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### append

    private void append(StringBuilder buf,
                        Object o)

#### getArray

    protected Object getArray(List<?> list,
                              AbstractCursor.ArrayAccessor arrayAccessor)
                       throws SQLException

Converts a list into an array.

If the elements of the list are primitives, converts to an array of primitives (e.g. `boolean[]`.

Parameters:
  `list` - List of objects
Returns:
  array
Throws:
  `ClassCastException` - if any element is not of the box type
  `NullPointerException` - if any element is null
  `SQLException`

#### getArrayData

    Object getArrayData(Object o,
                        AbstractCursor.ArrayAccessor componentAccessor)
                 throws SQLException

Throws:
  `SQLException`

#### getArray

    public Object getArray(Map<String,Class<?>> map)
                    throws SQLException

Specified by:
  `getArray` in interface `Array`
Throws:
  `SQLException`

#### getArray

    public Object getArray(long index,
                           int count)
                    throws SQLException

Specified by:
  `getArray` in interface `Array`
Throws:
  `SQLException`

#### getArray

    public Object getArray(long index,
                           int count,
                           Map<String,Class<?>> map)
                    throws SQLException

Specified by:
  `getArray` in interface `Array`
Throws:
  `SQLException`

#### getResultSet

    public ResultSet getResultSet()
                           throws SQLException

Specified by:
  `getResultSet` in interface `Array`
Throws:
  `SQLException`

#### getResultSet

    public ResultSet getResultSet(Map<String,Class<?>> map)
                           throws SQLException

Specified by:
  `getResultSet` in interface `Array`
Throws:
  `SQLException`

#### getResultSet

    public ResultSet getResultSet(long index,
                                  int count)
                           throws SQLException

Specified by:
  `getResultSet` in interface `Array`
Throws:
  `SQLException`

#### getResultSet

    public ResultSet getResultSet(long index,
                                  int count,
                                  Map<String,Class<?>> map)
                           throws SQLException

Specified by:
  `getResultSet` in interface `Array`
Throws:
  `SQLException`

#### free

    public void free()
              throws SQLException

Specified by:
  `free` in interface `Array`
Throws:
  `SQLException`