Package org.apache.calcite.avatica.util
Class ArrayImpl
java.lang.Object
org.apache.calcite.avatica.util.ArrayImpl
- All Implemented Interfaces:
Array
Implementation of JDBC
Array.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFactory that can create a ResultSet or Array based on a stream of values. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanequalContents(Array left, Array right) Returns whether two arrays have the same contents.voidfree()getArray()getArray(long index, int count) protected ObjectgetArray(List<?> list, AbstractCursor.ArrayAccessor arrayAccessor) Converts a list into an array.intgetResultSet(long index, int count) getResultSet(long index, int count, Map<String, Class<?>> map) getResultSet(Map<String, Class<?>> map) toString()
-
Constructor Details
-
ArrayImpl
-
-
Method Details
-
getBaseTypeName
- Specified by:
getBaseTypeNamein interfaceArray- Throws:
SQLException
-
getBaseType
- Specified by:
getBaseTypein interfaceArray- Throws:
SQLException
-
getArray
- Specified by:
getArrayin interfaceArray- Throws:
SQLException
-
toString
-
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 typeNullPointerException- if any element is nullSQLException
-
getArray
- Specified by:
getArrayin interfaceArray- Throws:
SQLException
-
getArray
- Specified by:
getArrayin interfaceArray- Throws:
SQLException
-
getArray
- Specified by:
getArrayin interfaceArray- Throws:
SQLException
-
getResultSet
- Specified by:
getResultSetin interfaceArray- Throws:
SQLException
-
getResultSet
- Specified by:
getResultSetin interfaceArray- Throws:
SQLException
-
getResultSet
- Specified by:
getResultSetin interfaceArray- Throws:
SQLException
-
getResultSet
- Specified by:
getResultSetin interfaceArray- Throws:
SQLException
-
free
- Specified by:
freein interfaceArray- Throws:
SQLException
-
equalContents
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
-