public Object getArray() throws SQLException { return getArray(list); }
public Object getArray() throws SQLException { return getArray(list, accessor); }
public Object getArray() throws SQLException { return getArray(list, accessor); }
Object getArrayData(Object o, AbstractCursor.ArrayAccessor componentAccessor) throws SQLException { if (o instanceof List) { return getArray((List<?>) o, componentAccessor); } else if (o instanceof ArrayImpl) { return (ArrayImpl) o; } throw new RuntimeException("Unhandled"); }
Object getArrayData(Object o, AbstractCursor.ArrayAccessor componentAccessor) throws SQLException { if (o instanceof List) { return getArray((List<?>) o, componentAccessor); } else if (o instanceof ArrayImpl) { return (ArrayImpl) o; } throw new RuntimeException("Unhandled"); }
public Object getArray(long index, int count) throws SQLException { return getArray(list.subList((int) index, count)); }
@Override public Object getArray(long index, int count) throws SQLException { if (index > Integer.MAX_VALUE) { throw new IllegalArgumentException("Arrays cannot be longer than " + Integer.MAX_VALUE); } // Convert from one-index to zero-index int startIndex = ((int) index) - 1; if (startIndex < 0 || startIndex > list.size()) { throw new IllegalArgumentException("Invalid index: " + index + ". Size = " + list.size()); } int endIndex = startIndex + count; if (endIndex > list.size()) { throw new IllegalArgumentException("Invalid count provided. Size = " + list.size() + ", count = " + count); } // End index is non-inclusive return getArray(list.subList(startIndex, endIndex), accessor); }
@Override public Object getArray(long index, int count) throws SQLException { if (index > Integer.MAX_VALUE) { throw new IllegalArgumentException("Arrays cannot be longer than " + Integer.MAX_VALUE); } // Convert from one-index to zero-index int startIndex = ((int) index) - 1; if (startIndex < 0 || startIndex > list.size()) { throw new IllegalArgumentException("Invalid index: " + index + ". Size = " + list.size()); } int endIndex = startIndex + count; if (endIndex > list.size()) { throw new IllegalArgumentException("Invalid count provided. Size = " + list.size() + ", count = " + count); } // End index is non-inclusive return getArray(list.subList(startIndex, endIndex), accessor); }