Package 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
Modifier and Type
Class
Description
`static interface`
`ArrayImpl.Factory`
Factory that can create a ResultSet or Array based on a stream of values.

## Constructor Summary

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

## Method Summary

Modifier and Type
Method
Description
`static boolean`
`equalContents(Array left, Array right)`
Returns whether two arrays have the same contents.
`void`
`free()`
`Object`
`getArray()`
`Object`
`getArray(long index, int count)`
`Object`
`getArray(long index, int count, Map<String,Class<?>> map)`
`protected Object`
`getArray(List<?> list, AbstractCursor.ArrayAccessor arrayAccessor)`
Converts a list into an array.
`Object`
`getArray(Map<String,Class<?>> map)`
`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`

## Constructor Details

### ArrayImpl

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

## Method Details

### 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`

### 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`

### 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`

### equalContents

public static boolean equalContents(Array left, Array right) throws SQLException
Returns whether two arrays have the same contents.

Arrays must have the same size, and elements in the same order. Elements are compared using `Object.equals(Object)`, and null values are equal to each other.

Throws:
  `SQLException`