45
45
/**
46
46
* Extension of JImmutableList that allows insertion and deletion at arbitrary
47
47
* indexes within the list.
48
- *
49
- * @param <T>
50
48
*/
51
49
@ Immutable
52
50
public interface JImmutableRandomAccessList <T >
53
- extends JImmutableList <T >
51
+ extends JImmutableList <T >
54
52
{
55
53
interface Builder <T >
56
- extends MutableBuilder <T , JImmutableRandomAccessList <T >>
54
+ extends MutableBuilder <T , JImmutableRandomAccessList <T >>
57
55
{
58
56
}
59
57
60
58
/**
61
59
* Replaces the value at the specified index (which must be within current
62
60
* bounds of the list) with the new value.
63
61
*
64
- * @param index
65
- * @param value
66
- * @return
67
62
* @throws IndexOutOfBoundsException if index is out of bounds
68
63
*/
69
64
@ Nonnull
@@ -72,9 +67,6 @@ JImmutableRandomAccessList<T> assign(int index,
72
67
73
68
/**
74
69
* Adds a value to the end of the list. May be invoked on an empty list.
75
- *
76
- * @param value
77
- * @return
78
70
*/
79
71
@ Nonnull
80
72
JImmutableRandomAccessList <T > insert (@ Nullable T value );
@@ -83,10 +75,6 @@ JImmutableRandomAccessList<T> assign(int index,
83
75
* Insert value at index (which must be within 0 to size).
84
76
* Shifts all values at and after index one position to the right and adds 1
85
77
* to size of the list.
86
- *
87
- * @param index
88
- * @param value
89
- * @return
90
78
*/
91
79
@ Nonnull
92
80
JImmutableRandomAccessList <T > insert (int index ,
@@ -95,19 +83,13 @@ JImmutableRandomAccessList<T> insert(int index,
95
83
/**
96
84
* Adds a value to the front of the list. May be invoked on an empty list.
97
85
* Synonym for insert()
98
- *
99
- * @param value
100
- * @return
101
86
*/
102
87
@ Nonnull
103
88
JImmutableRandomAccessList <T > insertFirst (@ Nullable T value );
104
89
105
90
/**
106
91
* Adds a value to the end of the list. May be invoked on an empty list.
107
92
* Synonym for insert().
108
- *
109
- * @param value
110
- * @return
111
93
*/
112
94
@ Nonnull
113
95
JImmutableRandomAccessList <T > insertLast (@ Nullable T value );
@@ -116,7 +98,6 @@ JImmutableRandomAccessList<T> insert(int index,
116
98
* 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.
117
99
* Synonym for insertAllLast()
118
100
*
119
- * @param values
120
101
* @return instance of list containing the collection
121
102
*/
122
103
@ Nonnull
@@ -126,7 +107,6 @@ JImmutableRandomAccessList<T> insert(int index,
126
107
* 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.
127
108
* Synonym for insertAllLast()
128
109
*
129
- * @param values
130
110
* @return instance of list containing the collection
131
111
*/
132
112
@ Nonnull
@@ -136,7 +116,6 @@ JImmutableRandomAccessList<T> insert(int index,
136
116
* 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.
137
117
* Synonym for insertAllLast()
138
118
*
139
- * @param values
140
119
* @return instance of list containing the collection
141
120
*/
142
121
@ Nonnull
@@ -146,7 +125,6 @@ JImmutableRandomAccessList<T> insert(int index,
146
125
* 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.
147
126
* Synonym for insertAllLast()
148
127
*
149
- * @param values
150
128
* @return instance of list containing the collection
151
129
*/
152
130
@ Nonnull
@@ -158,8 +136,6 @@ JImmutableRandomAccessList<T> insert(int index,
158
136
* Shifts all values at and after index x positions to the right and adds x
159
137
* to size of the list, where x is the number of elements being inserted.
160
138
*
161
- * @param index
162
- * @param values
163
139
* @return instance of list containing the collection
164
140
*/
165
141
@ Nonnull
@@ -172,8 +148,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
172
148
* Shifts all values at and after index x positions to the right and adds x
173
149
* to size of the list, where x is the number of elements being inserted.
174
150
*
175
- * @param index
176
- * @param values
177
151
* @return instance of list containing the collection
178
152
*/
179
153
@ Nonnull
@@ -186,8 +160,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
186
160
* Shifts all values at and after index x positions to the right and adds x
187
161
* to size of the list, where x is the number of elements being inserted.
188
162
*
189
- * @param index
190
- * @param values
191
163
* @return instance of list containing the collection
192
164
*/
193
165
@ Nonnull
@@ -200,8 +172,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
200
172
* Shifts all values at and after index x positions to the right and adds x
201
173
* to size of the list, where x is the number of elements being inserted.
202
174
*
203
- * @param index
204
- * @param values
205
175
* @return instance of list containing the collection
206
176
*/
207
177
@ Nonnull
@@ -211,7 +181,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
211
181
/**
212
182
* 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.
213
183
*
214
- * @param values
215
184
* @return instance of list containing the collection
216
185
*/
217
186
@ Nonnull
@@ -220,7 +189,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
220
189
/**
221
190
* 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.
222
191
*
223
- * @param values
224
192
* @return instance of list containing the collection
225
193
*/
226
194
@ Nonnull
@@ -229,7 +197,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
229
197
/**
230
198
* 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.
231
199
*
232
- * @param values
233
200
* @return instance of list containing the collection
234
201
*/
235
202
@ Nonnull
@@ -238,7 +205,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
238
205
/**
239
206
* 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.
240
207
*
241
- * @param values
242
208
* @return instance of list containing the collection
243
209
*/
244
210
@ Nonnull
@@ -248,7 +214,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
248
214
* 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.
249
215
* Synonym for insertAll()
250
216
*
251
- * @param values
252
217
* @return instance of list containing the collection
253
218
*/
254
219
@ Nonnull
@@ -258,7 +223,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
258
223
* 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.
259
224
* Synonym for insertAll()
260
225
*
261
- * @param values
262
226
* @return instance of list containing the collection
263
227
*/
264
228
@ Nonnull
@@ -268,7 +232,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
268
232
* 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.
269
233
* Synonym for insertAll()
270
234
*
271
- * @param values
272
235
* @return instance of list containing the collection
273
236
*/
274
237
@ Nonnull
@@ -278,7 +241,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
278
241
* 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.
279
242
* Synonym for insertAll()
280
243
*
281
- * @param values
282
244
* @return instance of list containing the collection
283
245
*/
284
246
@ Nonnull
@@ -306,9 +268,6 @@ JImmutableRandomAccessList<T> insertAll(int index,
306
268
* Delete value at index (which must be within the current bounds of the list).
307
269
* Shifts all values at and after index one position to the left and subtracts 1
308
270
* from size of the list.
309
- *
310
- * @param index
311
- * @return
312
271
*/
313
272
@ Nonnull
314
273
JImmutableRandomAccessList <T > delete (int index );
@@ -333,8 +292,7 @@ default JImmutableRandomAccessList<T> reject(@Nonnull Predicate<T> predicate)
333
292
{
334
293
JImmutableRandomAccessList <T > answer = this ;
335
294
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 ) {
338
296
assert value == answer .get (index );
339
297
if (predicate .test (value )) {
340
298
answer = answer .delete (index );
0 commit comments