Iterable iterable = (Iterable) value; IntArrayList intArrayList = new IntArrayList(); intArrayList.add(convertedValue); return intArrayList.toArray();
/** * Returns the element at the specified position in this list. */ public int get(int index) { checkRange(index); return array[index]; }
/** * Inserts the specified element at the specified position in this list. * Shifts the element currently at that position (if any) and any subsequent * elements to the right (adds one to their indices). * * @param index the index at which to insert the element * @param element the value to insert */ public void add(int index, int element) { checkRangeIncludingEndpoint(index); ensureCapacity(size + 1); int numtomove = size - index; System.arraycopy(array, index, array, index + 1, numtomove); array[index] = element; size++; }
private void storeNamedParameter(String name, int position) { IntArrayList locations = namedParameterLocationMap.get(name); if (locations == null) { locations = new IntArrayList(); namedParameterLocationMap.put(name, locations); } locations.add(position); }
/** * Appends the specified element to the end of this list. */ public void add(int element) { ensureCapacity(size + 1); array[size++] = element; }
argumentsOffset.add(argumentsWords + 1); argumentsTypeNames.add(typeName); if ((type == 'D') || (type == 'J')) {
protected int getArgumentOffset(int i) { return argumentsOffset.get(i); }
@Override public SignatureVisitor visitParameterType() { super.visitParameterType(); visitingArgument = true; if (argumentsOpcodeType == null) { argumentsOpcodeType = new CharArrayList(); argumentsOffset = new IntArrayList(); argumentsTypeNames = new ArrayList<String>(); argumentsOpcodeType.add('L'); argumentsOffset.add(0); argumentsTypeNames.add(null); } return this; }
/** * Appends all of the elements in the specified array to the end of this list. */ public void addAll(int[] data) { int dataLen = data.length; if (dataLen == 0) { return; } int newcap = size + (int) (dataLen * 1.1) + 1; ensureCapacity(newcap); System.arraycopy(data, 0, array, size, dataLen); size += dataLen; }
public void setShort(String param, short value) { init(); IntArrayList positions = query.getNamedParameterIndices(param); try { for (int i = 0; i < positions.size(); i++) { int index = positions.get(i); preparedStatement.setShort(index, value); } } catch (SQLException sex) { throwSetParamError(param, sex); } }
/** * Replaces the element at the specified position in this list with the specified element. * * @param index the index of the element to change * @param element the value to be stored at the specified position * @return the value previously stored at the specified position */ public int set(int index, int element) { checkRange(index); int oldval = array[index]; array[index] = element; return oldval; }
/** * Inserts the specified element at the specified position in this list. * Shifts the element currently at that position (if any) and any subsequent * elements to the right (adds one to their indices). * * @param index the index at which to insert the element * @param element the value to insert */ public void add(int index, int element) { checkRangeIncludingEndpoint(index); ensureCapacity(size + 1); int numtomove = size - index; System.arraycopy(array, index, array, index + 1, numtomove); array[index] = element; size++; }
/** * Appends all of the elements in the specified array at the specified position in this list. */ public void addAll(int index, int[] data) { int dataLen = data.length; if (dataLen == 0) { return; } int newcap = size + (int) (dataLen * 1.1) + 1; ensureCapacity(newcap); System.arraycopy(array, index, array, index + dataLen, size - index); System.arraycopy(data, 0, array, index, dataLen); size += dataLen; }
/** * Removes from this list all of the elements whose index is between fromIndex, * inclusive and toIndex, exclusive. Shifts any succeeding elements to the left (reduces their index). */ public void removeRange(int fromIndex, int toIndex) { checkRange(fromIndex); checkRange(toIndex); if (fromIndex >= toIndex) { return; } int numtomove = size - toIndex; if (numtomove > 0) { System.arraycopy(array, toIndex, array, fromIndex, numtomove); } size -= (toIndex - fromIndex); }
/** * Appends the specified element to the end of this list. */ public void add(int element) { ensureCapacity(size + 1); array[size++] = element; }
public void setBigDecimal(String param, BigDecimal value) { init(); IntArrayList positions = query.getNamedParameterIndices(param); try { for (int i = 0; i < positions.size(); i++) { preparedStatement.setBigDecimal(positions.get(i), value); } } catch (SQLException sex) { throwSetParamError(param, sex); } }
/** * Removes the element at the specified position in this list. * Shifts any subsequent elements to the left (subtracts * one from their indices). * * @param index the index of the element to remove * @return the value of the element that was removed * @throws UnsupportedOperationException when this operation is not * supported * @throws IndexOutOfBoundsException if the specified index is out of range */ public int remove(int index) { checkRange(index); int oldval = array[index]; int numtomove = size - index - 1; if (numtomove > 0) { System.arraycopy(array, index + 1, array, index, numtomove); } size--; return oldval; } /**