MCPcopy Create free account
hub / github.com/apache/poi / add

Method add

src/java/org/apache/poi/util/IntList.java:113–136  ·  view source on GitHub ↗

add the specfied value at the specified index @param index the index where the new value is to be added @param value the new value @exception IndexOutOfBoundsException if the index is out of range (index < 0 || index > size()).

(final int index, final int value)

Source from the content-addressed store, hash-verified

111 */
112
113 public void add(final int index, final int value)
114 {
115 if (index > _limit)
116 {
117 throw new IndexOutOfBoundsException();
118 }
119 else if (index == _limit)
120 {
121 add(value);
122 }
123 else
124 {
125
126 // index < limit -- insert into the middle
127 if (_limit == _array.length)
128 {
129 growArray(_limit * 2);
130 }
131 System.arraycopy(_array, index, _array, index + 1,
132 _limit - index);
133 _array[ index ] = value;
134 _limit++;
135 }
136 }
137
138 /**
139 * Appends the specified element to the end of this list

Callers 15

testConstructorsMethod · 0.95
testAddMethod · 0.95
testAddAllMethod · 0.95
testClearMethod · 0.95
testContainsMethod · 0.95
testContainsAllMethod · 0.95
testEqualsMethod · 0.95
testGetMethod · 0.95
testIndexOfMethod · 0.95
testIsEmptyMethod · 0.95
testLastIndexOfMethod · 0.95
testRemoveMethod · 0.95

Calls 2

growArrayMethod · 0.95
arraycopyMethod · 0.80

Tested by 15

testConstructorsMethod · 0.76
testAddMethod · 0.76
testAddAllMethod · 0.76
testClearMethod · 0.76
testContainsMethod · 0.76
testContainsAllMethod · 0.76
testEqualsMethod · 0.76
testGetMethod · 0.76
testIndexOfMethod · 0.76
testIsEmptyMethod · 0.76
testLastIndexOfMethod · 0.76
testRemoveMethod · 0.76