4545/**
4646 * Extension of JImmutableList that allows insertion and deletion at arbitrary
4747 * indexes within the list.
48- *
49- * @param <T>
5048 */
5149@ Immutable
5250public interface JImmutableRandomAccessList <T >
53- extends JImmutableList <T >
51+ extends JImmutableList <T >
5452{
5553 interface Builder <T >
56- extends MutableBuilder <T , JImmutableRandomAccessList <T >>
54+ extends MutableBuilder <T , JImmutableRandomAccessList <T >>
5755 {
5856 }
5957
6058 /**
6159 * Replaces the value at the specified index (which must be within current
6260 * bounds of the list) with the new value.
6361 *
64- * @param index
65- * @param value
66- * @return
6762 * @throws IndexOutOfBoundsException if index is out of bounds
6863 */
6964 @ Nonnull
@@ -72,9 +67,6 @@ JImmutableRandomAccessList<T> assign(int index,
7267
7368 /**
7469 * Adds a value to the end of the list. May be invoked on an empty list.
75- *
76- * @param value
77- * @return
7870 */
7971 @ Nonnull
8072 JImmutableRandomAccessList <T > insert (@ Nullable T value );
@@ -83,10 +75,6 @@ JImmutableRandomAccessList<T> assign(int index,
8375 * Insert value at index (which must be within 0 to size).
8476 * Shifts all values at and after index one position to the right and adds 1
8577 * to size of the list.
86- *
87- * @param index
88- * @param value
89- * @return
9078 */
9179 @ Nonnull
9280 JImmutableRandomAccessList <T > insert (int index ,
@@ -95,19 +83,13 @@ JImmutableRandomAccessList<T> insert(int index,
9583 /**
9684 * Adds a value to the front of the list. May be invoked on an empty list.
9785 * Synonym for insert()
98- *
99- * @param value
100- * @return
10186 */
10287 @ Nonnull
10388 JImmutableRandomAccessList <T > insertFirst (@ Nullable T value );
10489
10590 /**
10691 * Adds a value to the end of the list. May be invoked on an empty list.
10792 * Synonym for insert().
108- *
109- * @param value
110- * @return
11193 */
11294 @ Nonnull
11395 JImmutableRandomAccessList <T > insertLast (@ Nullable T value );
@@ -116,7 +98,6 @@ JImmutableRandomAccessList<T> insert(int index,
11698 * Adds the values to the end of the list in the same order they appear in the Iterable. May be invoked on an empty list.
11799 * Synonym for insertAllLast()
118100 *
119- * @param values
120101 * @return instance of list containing the collection
121102 */
122103 @ Nonnull
@@ -126,7 +107,6 @@ JImmutableRandomAccessList<T> insert(int index,
126107 * Adds the values to the end of the list in the same order they appear in the Iterable. May be invoked on an empty list.
127108 * Synonym for insertAllLast()
128109 *
129- * @param values
130110 * @return instance of list containing the collection
131111 */
132112 @ Nonnull
@@ -136,7 +116,6 @@ JImmutableRandomAccessList<T> insert(int index,
136116 * Adds the values to the end of the list in the same order they appear in the Iterable. May be invoked on an empty list.
137117 * Synonym for insertAllLast()
138118 *
139- * @param values
140119 * @return instance of list containing the collection
141120 */
142121 @ Nonnull
@@ -146,7 +125,6 @@ JImmutableRandomAccessList<T> insert(int index,
146125 * Adds the values to the end of the list in the same order they appear in the Iterable. May be invoked on an empty list.
147126 * Synonym for insertAllLast()
148127 *
149- * @param values
150128 * @return instance of list containing the collection
151129 */
152130 @ Nonnull
@@ -158,8 +136,6 @@ JImmutableRandomAccessList<T> insert(int index,
158136 * Shifts all values at and after index x positions to the right and adds x
159137 * to size of the list, where x is the number of elements being inserted.
160138 *
161- * @param index
162- * @param values
163139 * @return instance of list containing the collection
164140 */
165141 @ Nonnull
@@ -172,8 +148,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
172148 * Shifts all values at and after index x positions to the right and adds x
173149 * to size of the list, where x is the number of elements being inserted.
174150 *
175- * @param index
176- * @param values
177151 * @return instance of list containing the collection
178152 */
179153 @ Nonnull
@@ -186,8 +160,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
186160 * Shifts all values at and after index x positions to the right and adds x
187161 * to size of the list, where x is the number of elements being inserted.
188162 *
189- * @param index
190- * @param values
191163 * @return instance of list containing the collection
192164 */
193165 @ Nonnull
@@ -200,8 +172,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
200172 * Shifts all values at and after index x positions to the right and adds x
201173 * to size of the list, where x is the number of elements being inserted.
202174 *
203- * @param index
204- * @param values
205175 * @return instance of list containing the collection
206176 */
207177 @ Nonnull
@@ -211,7 +181,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
211181 /**
212182 * Adds the values to the beginning of the list in the same order they appear in the Iterable. May be invoked on an empty list.
213183 *
214- * @param values
215184 * @return instance of list containing the collection
216185 */
217186 @ Nonnull
@@ -220,7 +189,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
220189 /**
221190 * Adds the values to the beginning of the list in the same order they appear in the Iterable. May be invoked on an empty list.
222191 *
223- * @param values
224192 * @return instance of list containing the collection
225193 */
226194 @ Nonnull
@@ -229,7 +197,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
229197 /**
230198 * Adds the values to the beginning of the list in the same order they appear in the Iterable. May be invoked on an empty list.
231199 *
232- * @param values
233200 * @return instance of list containing the collection
234201 */
235202 @ Nonnull
@@ -238,7 +205,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
238205 /**
239206 * Adds the values to the beginning of the list in the same order they appear in the Iterable. May be invoked on an empty list.
240207 *
241- * @param values
242208 * @return instance of list containing the collection
243209 */
244210 @ Nonnull
@@ -248,7 +214,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
248214 * Adds the values to the end of the list in the same order they appear in the Iterable. May be invoked on an empty list.
249215 * Synonym for insertAll()
250216 *
251- * @param values
252217 * @return instance of list containing the collection
253218 */
254219 @ Nonnull
@@ -258,7 +223,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
258223 * Adds the values to the end of the list in the same order they appear in the Iterable. May be invoked on an empty list.
259224 * Synonym for insertAll()
260225 *
261- * @param values
262226 * @return instance of list containing the collection
263227 */
264228 @ Nonnull
@@ -268,7 +232,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
268232 * Adds the values to the end of the list in the same order they appear in the Iterable. May be invoked on an empty list.
269233 * Synonym for insertAll()
270234 *
271- * @param values
272235 * @return instance of list containing the collection
273236 */
274237 @ Nonnull
@@ -278,7 +241,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
278241 * Adds the values to the end of the list in the same order they appear in the Iterable. May be invoked on an empty list.
279242 * Synonym for insertAll()
280243 *
281- * @param values
282244 * @return instance of list containing the collection
283245 */
284246 @ Nonnull
@@ -306,9 +268,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
306268 * Delete value at index (which must be within the current bounds of the list).
307269 * Shifts all values at and after index one position to the left and subtracts 1
308270 * from size of the list.
309- *
310- * @param index
311- * @return
312271 */
313272 @ Nonnull
314273 JImmutableRandomAccessList <T > delete (int index );
@@ -333,8 +292,7 @@ default JImmutableRandomAccessList<T> reject(@Nonnull Predicate<T> predicate)
333292 {
334293 JImmutableRandomAccessList <T > answer = this ;
335294 int index = 0 ;
336- for (Cursor <T > cursor = cursor ().start (); cursor .hasValue (); cursor = cursor .next ()) {
337- final T value = cursor .getValue ();
295+ for (T value : this ) {
338296 assert value == answer .get (index );
339297 if (predicate .test (value )) {
340298 answer = answer .delete (index );
0 commit comments