本文整理了Java中gnu.trove.TIntArrayList.ensureCapacity()
方法的一些代码示例,展示了TIntArrayList.ensureCapacity()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TIntArrayList.ensureCapacity()
方法的具体详情如下:
包路径:gnu.trove.TIntArrayList
类名称:TIntArrayList
方法名:ensureCapacity
[英]See gnu.trove.list.array.TIntArrayList#ensureCapacity(int)
[中]见gnu。宝藏。列表大堆TIntArrayList#ensureCapacity(内部)
代码示例来源:origin: de.julielab/jcore-mallet-0.4
/**
* Adds <tt>val</tt> to the end of the list, growing as needed.
*
* @param val an <code>int</code> value
*/
public void add(int val) {
ensureCapacity(_pos + 1);
_data[_pos++] = val;
}
代码示例来源:origin: de.julielab/jcore-mallet-0.4
/**
* Adds a subset of the values in the array <tt>vals</tt> to the
* end of the list, in order.
*
* @param vals an <code>int[]</code> value
* @param offset the offset at which to start copying
* @param length the number of values to copy.
*/
public void add(int[] vals, int offset, int length) {
ensureCapacity(_pos + length);
System.arraycopy(vals, offset, _data, _pos, length);
_pos += length;
}
代码示例来源:origin: de.julielab/jcore-mallet-0.4
/**
* Inserts <tt>value</tt> into the list at <tt>offset</tt>. All
* values including and to the right of <tt>offset</tt> are shifted
* to the right.
*
* @param offset an <code>int</code> value
* @param value an <code>int</code> value
*/
public void insert(int offset, int value) {
if (offset == _pos) {
add(value);
return;
}
ensureCapacity(_pos + 1);
// shift right
System.arraycopy(_data, offset, _data, offset + 1, _pos - offset);
// insert
_data[offset] = value;
_pos++;
}
代码示例来源:origin: de.julielab/jcore-mallet-0.4
/**
* Inserts a slice of the array of <tt>values</tt> into the list
* at <tt>offset</tt>. All values including and to the right of
* <tt>offset</tt> are shifted to the right.
*
* @param offset an <code>int</code> value
* @param values an <code>int[]</code> value
* @param valOffset the offset in the values array at which to
* start copying.
* @param len the number of values to copy from the values array
*/
public void insert(int offset, int[] values, int valOffset, int len) {
if (offset == _pos) {
add(values, valOffset, len);
return;
}
ensureCapacity(_pos + len);
// shift right
System.arraycopy(_data, offset, _data, offset + len, _pos - offset);
// insert
System.arraycopy(values, valOffset, _data, offset, len);
_pos += len;
}
代码示例来源:origin: org.fudaa.soft.fudaa-refonde/refonde-client
vconn.ensureCapacity(ndsEle.length );
for (int j= 0; j < ndsEle.length - 1; j++) {
numNoe= ((RefondeNoeudData)ndsEle[j].data()).numero;
内容来源于网络,如有侵权,请联系作者删除!