Package io.vavr.collection
Class BitSet.Builder<T>
- java.lang.Object
-
- io.vavr.collection.BitSet.Builder<T>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.stream.Collector<T,java.util.ArrayList<T>,BitSet<T>>collector()Returns aCollectorwhich may be used in conjunction withStream.collect(java.util.stream.Collector)to obtain anArrayList.BitSet<T>empty()Returns a new empty BitSetBitSet<T>fill(int n, @NonNull java.util.function.Supplier<? extends T> s)Builds a new BitSet containing n copies of the same valueBitSet<T>of(T t)Builds a new BitSet from a specific value tBitSet<T>of(T @NonNull ... values)Builds a new BitSet from a list of valuesBitSet<T>ofAll(@NonNull java.lang.Iterable<? extends T> values)Builds a new BitSet from anIterableBitSet<T>ofAll(java.util.stream.Stream<? extends T> javaStream)Builds a new BitSet from aStreamof valuesBitSet<T>tabulate(int n, @NonNull java.util.function.Function<? super java.lang.Integer,? extends T> f)Builds a new BitSet tabulating a value n times
-
-
-
Field Detail
-
DEFAULT
static final BitSet.Builder<java.lang.Integer> DEFAULT
-
-
Method Detail
-
collector
public java.util.stream.Collector<T,java.util.ArrayList<T>,BitSet<T>> collector()
Returns aCollectorwhich may be used in conjunction withStream.collect(java.util.stream.Collector)to obtain anArrayList.- Returns:
- A
ArrayListCollector.
-
of
public BitSet<T> of(T t)
Builds a new BitSet from a specific value t- Parameters:
t- value to build the BitSet from- Returns:
- new BitSet
-
of
@SafeVarargs public final BitSet<T> of(T @NonNull ... values)
Builds a new BitSet from a list of values- Parameters:
values- values to build the BitSet from- Returns:
- new BitSet
-
ofAll
public BitSet<T> ofAll(@NonNull java.lang.Iterable<? extends T> values)
Builds a new BitSet from anIterable- Parameters:
values- iterable to build the BitSet from- Returns:
- new BitSet
-
ofAll
public BitSet<T> ofAll(java.util.stream.Stream<? extends T> javaStream)
Builds a new BitSet from aStreamof values- Parameters:
javaStream- stream of values to build the BitSet from- Returns:
- new BitSet
-
tabulate
public BitSet<T> tabulate(int n, @NonNull java.util.function.Function<? super java.lang.Integer,? extends T> f)
Builds a new BitSet tabulating a value n times- Parameters:
n- number of times to tabulatef- function to tabulate- Returns:
- new BitSet
-
-