Class BitSet.Builder<T>

java.lang.Object
io.vavr.collection.BitSet.Builder<T>
Type Parameters:
T - Component type
Enclosing interface:
BitSet<T>

public static class BitSet.Builder<T> extends Object
Builder of the BitSet. Encapsulates the conversion functions for T.
  • Field Details

  • Constructor Details

  • Method Details

    • collector

      public Collector<T, ArrayList<T>, BitSet<T>> collector()
      Returns a Collector which may be used in conjunction with Stream.collect(java.util.stream.Collector) to obtain an ArrayList.
      Returns:
      A ArrayList Collector.
    • empty

      public BitSet<T> empty()
      Returns a new empty BitSet
      Returns:
      new empty BitSet
    • 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 Iterable<? extends T> values)
      Builds a new BitSet from an Iterable
      Parameters:
      values - iterable to build the BitSet from
      Returns:
      new BitSet
    • ofAll

      public BitSet<T> ofAll(Stream<? extends T> javaStream)
      Builds a new BitSet from a Stream of values
      Parameters:
      javaStream - stream of values to build the BitSet from
      Returns:
      new BitSet
    • tabulate

      public BitSet<T> tabulate(int n, @NonNull Function<? super Integer, ? extends T> f)
      Builds a new BitSet tabulating a value n times
      Parameters:
      n - number of times to tabulate
      f - function to tabulate
      Returns:
      new BitSet
    • fill

      public BitSet<T> fill(int n, @NonNull Supplier<? extends T> s)
      Builds a new BitSet containing n copies of the same value
      Parameters:
      n - number of times to copy the value
      s - value supplier
      Returns:
      new BitSet