Skip to content

Commit 819e2ca

Browse files
authored
Add missing BitSet JavaDocs (#2888)
1 parent 48bb34e commit 819e2ca

File tree

1 file changed

+100
-0
lines changed

1 file changed

+100
-0
lines changed

vavr/src/main/java/io/vavr/collection/BitSet.java

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,30 @@ static Collector<Integer, ArrayList<Integer>, BitSet<Integer>> collector() {
139139
return Builder.DEFAULT.collector();
140140
}
141141

142+
/**
143+
* Returns a BitSet containing no elements.
144+
*
145+
* @return an empty BitSet
146+
*/
142147
static BitSet<Integer> empty() {
143148
return Builder.DEFAULT.empty();
144149
}
145150

151+
/**
152+
* Returns a BitSet containing a single value.
153+
*
154+
* @param value A single value
155+
* @return A BitSet containing the given value
156+
*/
146157
static BitSet<Integer> of(Integer value) {
147158
return Builder.DEFAULT.of(value);
148159
}
149160

161+
/**
162+
* Creates a BitSet of int numbers starting from {@code from}, extending to {@code toExclusive - 1}.
163+
* @param values int values
164+
* @return A new BitSet of int values
165+
*/
150166
static BitSet<Integer> of(Integer... values) {
151167
return Builder.DEFAULT.of(values);
152168
}
@@ -176,10 +192,20 @@ static BitSet<Integer> fill(int n, Supplier<Integer> s) {
176192
return Builder.DEFAULT.fill(n, s);
177193
}
178194

195+
/**
196+
* Creates a BitSet of int numbers starting from {@code from}, extending to {@code toExclusive - 1}.
197+
* @param values int values
198+
* @return A new BitSet of int values
199+
*/
179200
static BitSet<Integer> ofAll(Iterable<Integer> values) {
180201
return Builder.DEFAULT.ofAll(values);
181202
}
182203

204+
/**
205+
* Creates a BitSet of int numbers starting from {@code from}, extending to {@code toExclusive - 1}.
206+
* @param javaStream A java.util.stream.Stream of int values
207+
* @return A new BitSet of int values
208+
*/
183209
static BitSet<Integer> ofAll(java.util.stream.Stream<Integer> javaStream) {
184210
return Builder.DEFAULT.ofAll(javaStream);
185211
}
@@ -267,10 +293,24 @@ static BitSet<Integer> range(int from, int toExclusive) {
267293
return BitSet.ofAll(Iterator.range(from, toExclusive));
268294
}
269295

296+
/**
297+
* Creates a BitSet of char numbers starting from {@code from}, extending to {@code toExclusive - 1}.
298+
*
299+
* @param from the first number
300+
* @param toExclusive the last number + 1
301+
* @return a range of char values as specified or the empty range if {@code from >= toExclusive}
302+
*/
270303
static BitSet<Character> range(char from, char toExclusive) {
271304
return BitSet.withCharacters().ofAll(Iterator.range(from, toExclusive));
272305
}
273306

307+
/**
308+
* Creates a BitSet of long numbers starting from {@code from}, extending to {@code toExclusive - 1}.
309+
*
310+
* @param from the first number
311+
* @param toExclusive the last number + 1
312+
* @return a range of long values as specified or the empty range if {@code from >= toExclusive}
313+
*/
274314
static BitSet<Long> range(long from, long toExclusive) {
275315
return BitSet.withLongs().ofAll(Iterator.range(from, toExclusive));
276316
}
@@ -291,10 +331,32 @@ static BitSet<Integer> rangeBy(int from, int toExclusive, int step) {
291331
return BitSet.ofAll(Iterator.rangeBy(from, toExclusive, step));
292332
}
293333

334+
/** Creates a BitSet of char numbers starting from {@code from}, extending to {@code toExclusive - 1},
335+
* with {@code step}.
336+
*
337+
* @param from the first number
338+
* @param toExclusive the last number + 1
339+
* @param step the step
340+
* @return a range of char values as specified or the empty range if<br>
341+
* {@code from >= toInclusive} and {@code step > 0} or<br>
342+
* {@code from <= toInclusive} and {@code step < 0}
343+
* @throws IllegalArgumentException if {@code step} is zero
344+
*/
294345
static BitSet<Character> rangeBy(char from, char toExclusive, int step) {
295346
return BitSet.withCharacters().ofAll(Iterator.rangeBy(from, toExclusive, step));
296347
}
297348

349+
/** Creates a BitSet of long numbers starting from {@code from}, extending to {@code toExclusive - 1},
350+
* with {@code step}.
351+
*
352+
* @param from the first number
353+
* @param toExclusive the last number + 1
354+
* @param step the step
355+
* @return a range of long values as specified or the empty range if<br>
356+
* {@code from >= toInclusive} and {@code step > 0} or<br>
357+
* {@code from <= toInclusive} and {@code step < 0}
358+
* @throws IllegalArgumentException if {@code step} is zero
359+
*/
298360
static BitSet<Long> rangeBy(long from, long toExclusive, long step) {
299361
return BitSet.withLongs().ofAll(Iterator.rangeBy(from, toExclusive, step));
300362
}
@@ -310,10 +372,24 @@ static BitSet<Integer> rangeClosed(int from, int toInclusive) {
310372
return BitSet.ofAll(Iterator.rangeClosed(from, toInclusive));
311373
}
312374

375+
/**
376+
* Creates a BitSet of char numbers starting from {@code from}, extending to {@code toInclusive}.
377+
*
378+
* @param from the first number
379+
* @param toInclusive the last number
380+
* @return a range of char values as specified or the empty range if {@code from > toInclusive}
381+
*/
313382
static BitSet<Character> rangeClosed(char from, char toInclusive) {
314383
return BitSet.withCharacters().ofAll(Iterator.rangeClosed(from, toInclusive));
315384
}
316385

386+
/**
387+
* Creates a BitSet of long numbers starting from {@code from}, extending to {@code toInclusive}.
388+
*
389+
* @param from the first number
390+
* @param toInclusive the last number
391+
* @return a range of long values as specified or the empty range if {@code from > toInclusive}
392+
*/
317393
static BitSet<Long> rangeClosed(long from, long toInclusive) {
318394
return BitSet.withLongs().ofAll(Iterator.rangeClosed(from, toInclusive));
319395
}
@@ -334,10 +410,34 @@ static BitSet<Integer> rangeClosedBy(int from, int toInclusive, int step) {
334410
return BitSet.ofAll(Iterator.rangeClosedBy(from, toInclusive, step));
335411
}
336412

413+
/**
414+
* Creates a BitSet of char numbers starting from {@code from}, extending to {@code toInclusive},
415+
* with {@code step}.
416+
*
417+
* @param from the first number
418+
* @param toInclusive the last number
419+
* @param step the step
420+
* @return a range of char values as specified or the empty range if<br>
421+
* {@code from > toInclusive} and {@code step > 0} or<br>
422+
* {@code from < toInclusive} and {@code step < 0}
423+
* @throws IllegalArgumentException if {@code step} is zero
424+
*/
337425
static BitSet<Character> rangeClosedBy(char from, char toInclusive, int step) {
338426
return BitSet.withCharacters().ofAll(Iterator.rangeClosedBy(from, toInclusive, step));
339427
}
340428

429+
/**
430+
* Creates a BitSet of long numbers starting from {@code from}, extending to {@code toInclusive},
431+
* with {@code step}.
432+
*
433+
* @param from the first number
434+
* @param toInclusive the last number
435+
* @param step the step
436+
* @return a range of long values as specified or the empty range if<br>
437+
* {@code from > toInclusive} and {@code step > 0} or<br>
438+
* {@code from < toInclusive} and {@code step < 0}
439+
* @throws IllegalArgumentException if {@code step} is zero
440+
*/
341441
static BitSet<Long> rangeClosedBy(long from, long toInclusive, long step) {
342442
return BitSet.withLongs().ofAll(Iterator.rangeClosedBy(from, toInclusive, step));
343443
}

0 commit comments

Comments
 (0)