Top Description Inners Fields Methods
io.vavr.collection

public Interface BitSet<T>

Additional top-level class in compilation unit: BitSetModule.

extends SortedSet<T>
Known Direct Implementers
io.vavr.collection.BitSetModule.AbstractBitSet
Imports
io.vavr.Function1, .PartialFunction, .Tuple3, .Tuple2, io.vavr.control.Option, java.io.Serializable, java.util.ArrayList, .Comparator, .NoSuchElementException, .Objects, java.util.function.*, java.util.stream.Collector

An immutable BitSet implementation.
Author
Ruslan Sennov

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final long

Method Summary

Modifier and TypeMethod and Description
public BitSet<T>
add(T
The element to be added.
element
)

Redeclares io.vavr.collection.SortedSet.add.

Add the given element to this set, if it is not already contained.

public BitSet<T>
addAll(Iterable<? extends T>
The elements to be added.
elements
)

Redeclares io.vavr.collection.SortedSet.addAll.

Adds all of the given elements to this set, if not already contained.

public default <R> SortedSet<R>
collect(PartialFunction<? super T, ? extends R>
A function that is not necessarily defined of all elements of this traversable.
partialFunction
)

Implements io.vavr.collection.SortedSet.collect.

Collects all elements that are in the domain of the given partialFunction by mapping the elements to type R.

public static Collector<Integer, ArrayList<Integer>, BitSet<Integer>>

Returns:

A BitSet Collector.
collector
()

Returns a java.util.stream.Collector which may be used in conjunction with java.util.stream.Stream#collect(java.util.stream.Collector) to obtain a BitSet.

public default BitSet<T>
diff(Set<? extends T>
Elements to be removed from this set.
elements
)

Implements io.vavr.collection.SortedSet.diff.

Calculates the difference between this set and another set.

public default BitSet<T>
distinct()

Implements io.vavr.collection.SortedSet.distinct.

Returns a new version of this which contains no duplicates.

public BitSet<T>
distinctBy(Comparator<? super T>
A comparator
comparator
)

Redeclares io.vavr.collection.SortedSet.distinctBy.

Returns a new version of this which contains no duplicates.

public <U> BitSet<T>
distinctBy(Function<? super T, ? extends U>
A key extractor
keyExtractor
)

Redeclares io.vavr.collection.SortedSet.distinctBy.

Returns a new version of this which contains no duplicates.

public BitSet<T>
drop(int
The number of elements to drop.
n
)

Redeclares io.vavr.collection.SortedSet.drop.

Drops the first n elements of this or all elements, if this length < n.

public BitSet<T>
dropRight(int
The number of elements to drop.
n
)

Redeclares io.vavr.collection.SortedSet.dropRight.

Drops the last n elements of this or all elements, if this length < n.

public default BitSet<T>
dropUntil(Predicate<? super T>
A condition tested subsequently for this elements.
predicate
)

Implements io.vavr.collection.SortedSet.dropUntil.

Drops elements until the predicate holds for the current element.

public BitSet<T>
dropWhile(Predicate<? super T>
A condition tested subsequently for this elements.
predicate
)

Redeclares io.vavr.collection.SortedSet.dropWhile.

Drops elements while the predicate holds for the current element.

public static BitSet<Integer>

Returns:

an empty BitSet
empty
()

Returns a BitSet containing no elements.

public static BitSet<Integer>

Returns:

A BitSet of size n, where each element contains the result supplied by s.
fill
(int
The number of elements in the BitSet
n
,
Supplier<Integer>
The Supplier computing element values
s
)

Returns a BitSet containing n values supplied by a given Supplier s.

public BitSet<T>
filter(Predicate<? super T>
A predicate
predicate
)

Redeclares io.vavr.collection.SortedSet.filter.

Returns a new traversable consisting of all elements which satisfy the given predicate.

public default <U> SortedSet<U>
flatMap(Comparator<? super U>
A comparator for values of type U
comparator
,
Function<? super T, ? extends Iterable<? extends U>>
A function which maps values of type T to Iterables of values of type U
mapper
)

Implements io.vavr.collection.SortedSet.flatMap.

Same as flatMap(Function) but using a specific comparator for values of the codomain of the given mapper.

public default <U> SortedSet<U>
flatMap(Function<? super T, ? extends Iterable<? extends U>>
A mapper
mapper
)

Implements io.vavr.collection.SortedSet.flatMap.

FlatMaps this Traversable.

public default <U> U
foldRight(U
A zero element to start with.
zero
,
BiFunction<? super T, ? super U, ? extends U>
A function which combines elements.
f
)

Implements io.vavr.collection.Traversable.foldRight.

Folds this elements from the right, starting with zero and successively calling combine.

public <C> Map<C, BitSet<T>>
groupBy(Function<? super T, ? extends C>
A function which classifies elements into classes
classifier
)

Redeclares io.vavr.collection.SortedSet.groupBy.

Groups this elements by classifying the elements.

public default Iterator<BitSet<T>>
grouped(int
a positive block size
size
)

Implements io.vavr.collection.SortedSet.grouped.

Groups this Traversable into fixed size blocks.

public default boolean
hasDefiniteSize()

Implements io.vavr.collection.Traversable.hasDefiniteSize.

Checks if this Traversable is known to have a finite size.

public BitSet<T>
init()

Redeclares io.vavr.collection.SortedSet.init.

Dual of tail(), returning all elements except the last.

public default Option<BitSet<T>>
initOption()

Implements io.vavr.collection.SortedSet.initOption.

Dual of tailOption(), returning all elements except the last as Option.

public BitSet<T>
intersect(Set<? extends T>
the set to intersect with.
elements
)

Redeclares io.vavr.collection.SortedSet.intersect.

Computes the intersection between this set and another set.

public default boolean

Returns:

false
isAsync
()

Implements io.vavr.Value.isAsync.

An BitSet's value is computed synchronously.

public default boolean

Returns:

false
isLazy
()

Implements io.vavr.Value.isLazy.

An BitSet's value is computed eagerly.

public default boolean
isTraversableAgain()

Implements io.vavr.collection.Traversable.isTraversableAgain.

Checks if this Traversable can be repeatedly traversed.

public default T
last()

Implements io.vavr.collection.Traversable.last.

Dual of head(), returning the last element.

public default <U> SortedSet<U>
map(Comparator<? super U>
A comparator for values of type U
comparator
,
Function<? super T, ? extends U>
A function which maps values of type T to values of type U
mapper
)

Implements io.vavr.collection.SortedSet.map.

Same as map(Function) but using a specific comparator for values of the codomain of the given mapper.

public default <U> SortedSet<U>
map(Function<? super T, ? extends U>
A mapper.
mapper
)

Implements io.vavr.collection.SortedSet.map.

Maps the elements of this Traversable to elements of a new type preserving their order, if any.

public static BitSet<Integer>

Returns:

A BitSet containing the given value
of
(Integer
A single value
value
)

Returns a BitSet containing a single value.

public static BitSet<Integer>

Returns:

A new BitSet of int values
of
(Integer...
int values
values
)

Creates a BitSet of int numbers starting from from, extending to toExclusive - 1.

public static BitSet<Integer>

Returns:

A new BitSet of int values
ofAll
(Iterable<Integer>
int values
values
)

Creates a BitSet of int numbers starting from from, extending to toExclusive - 1.

public static BitSet<Integer>

Returns:

A new BitSet of int values
ofAll
(Stream<Integer>
A java.util.stream.Stream of int values
javaStream
)

Creates a BitSet of int numbers starting from from, extending to toExclusive - 1.

public static BitSet<Boolean>

Returns:

A new BitSet of boolean values
ofAll
(boolean...
boolean values
elements
)

Creates a BitSet from boolean values.

public static BitSet<Byte>

Returns:

A new BitSet of byte values
ofAll
(byte...
byte values
elements
)

Creates a BitSet from byte values.

public static BitSet<Character>

Returns:

A new BitSet of char values
ofAll
(char...
char values
elements
)

Creates a BitSet from char values.

public static BitSet<Integer>

Returns:

A new BitSet of int values
ofAll
(int...
int values
elements
)

Creates a BitSet from int values.

public static BitSet<Long>

Returns:

A new BitSet of long values
ofAll
(long...
long values
elements
)

Creates a BitSet from long values.

public static BitSet<Short>

Returns:

A new BitSet of short values
ofAll
(short...
short values
elements
)

Creates a BitSet from short values.

public Tuple2<BitSet<T>, BitSet<T>>
partition(Predicate<? super T>
A predicate which classifies an element if it is in the first or the second traversable.
predicate
)

Redeclares io.vavr.collection.SortedSet.partition.

Creates a partition of this Traversable by splitting this elements in two in distinct traversables according to a predicate.

public default BitSet<T>
peek(Consumer<? super T>
The action that will be performed on the element(s).
action
)

Implements io.vavr.collection.SortedSet.peek.

Performs the given action on the first element if this is an eager implementation.

public static BitSet<Integer>

Returns:

a range of int values as specified or the empty range if from >= toExclusive
range
(int
the first number
from
,
int
the last number + 1
toExclusive
)

Creates a BitSet of int numbers starting from from, extending to toExclusive - 1.

public static BitSet<Character>

Returns:

a range of char values as specified or the empty range if from >= toExclusive
range
(char
the first number
from
,
char
the last number + 1
toExclusive
)

Creates a BitSet of char numbers starting from from, extending to toExclusive - 1.

public static BitSet<Long>

Returns:

a range of long values as specified or the empty range if from >= toExclusive
range
(long
the first number
from
,
long
the last number + 1
toExclusive
)

Creates a BitSet of long numbers starting from from, extending to toExclusive - 1.

public static BitSet<Integer>

Returns:

a range of long values as specified or the empty range if
from >= toInclusive and step > 0 or
from <= toInclusive and step < 0
rangeBy
(int
the first number
from
,
int
the last number + 1
toExclusive
,
int
the step
step
)

Creates a BitSet of int numbers starting from from, extending to toExclusive - 1, with step.

public static BitSet<Character>

Returns:

a range of char values as specified or the empty range if
from >= toInclusive and step > 0 or
from <= toInclusive and step < 0
rangeBy
(char
the first number
from
,
char
the last number + 1
toExclusive
,
int
the step
step
)

Creates a BitSet of char numbers starting from from, extending to toExclusive - 1, with step.

public static BitSet<Long>

Returns:

a range of long values as specified or the empty range if
from >= toInclusive and step > 0 or
from <= toInclusive and step < 0
rangeBy
(long
the first number
from
,
long
the last number + 1
toExclusive
,
long
the step
step
)

Creates a BitSet of long numbers starting from from, extending to toExclusive - 1, with step.

public static BitSet<Integer>

Returns:

a range of int values as specified or the empty range if from > toInclusive
rangeClosed
(int
the first number
from
,
int
the last number
toInclusive
)

Creates a BitSet of int numbers starting from from, extending to toInclusive.

public static BitSet<Character>

Returns:

a range of char values as specified or the empty range if from > toInclusive
rangeClosed
(char
the first number
from
,
char
the last number
toInclusive
)

Creates a BitSet of char numbers starting from from, extending to toInclusive.

public static BitSet<Long>

Returns:

a range of long values as specified or the empty range if from > toInclusive
rangeClosed
(long
the first number
from
,
long
the last number
toInclusive
)

Creates a BitSet of long numbers starting from from, extending to toInclusive.

public static BitSet<Integer>

Returns:

a range of int values as specified or the empty range if
from > toInclusive and step > 0 or
from < toInclusive and step < 0
rangeClosedBy
(int
the first number
from
,
int
the last number
toInclusive
,
int
the step
step
)

Creates a BitSet of int numbers starting from from, extending to toInclusive, with step.

public static BitSet<Character>

Returns:

a range of char values as specified or the empty range if
from > toInclusive and step > 0 or
from < toInclusive and step < 0
rangeClosedBy
(char
the first number
from
,
char
the last number
toInclusive
,
int
the step
step
)

Creates a BitSet of char numbers starting from from, extending to toInclusive, with step.

public static BitSet<Long>

Returns:

a range of long values as specified or the empty range if
from > toInclusive and step > 0 or
from < toInclusive and step < 0
rangeClosedBy
(long
the first number
from
,
long
the last number
toInclusive
,
long
the step
step
)

Creates a BitSet of long numbers starting from from, extending to toInclusive, with step.

public BitSet<T>
reject(Predicate<? super T>
A predicate
predicate
)

Redeclares io.vavr.collection.SortedSet.reject.

Returns a new traversable consisting of all elements which do not satisfy the given predicate.

public BitSet<T>
remove(T
The element to be removed from this set.
element
)

Redeclares io.vavr.collection.SortedSet.remove.

Removes a specific element from this set, if present.

public BitSet<T>
removeAll(Iterable<? extends T>
The elements to be removed from this set.
elements
)

Redeclares io.vavr.collection.SortedSet.removeAll.

Removes all of the given elements from this set, if present.

public default BitSet<T>
replace(T
An element to be substituted.
currentElement
,
T
A replacement for currentElement.
newElement
)

Implements io.vavr.collection.SortedSet.replace.

Replaces the first occurrence (if exists) of the given currentElement with newElement.

public default BitSet<T>
replaceAll(T
An element to be substituted.
currentElement
,
T
A replacement for currentElement.
newElement
)

Implements io.vavr.collection.SortedSet.replaceAll.

Replaces all occurrences of the given currentElement with newElement.

public default BitSet<T>
retainAll(Iterable<? extends T>
Elements to be kept.
elements
)

Implements io.vavr.collection.SortedSet.retainAll.

Keeps all occurrences of the given elements from this.

public BitSet<T>
scan(T
neutral element for the operator op
zero
,
BiFunction<? super T, ? super T, ? extends T>
the associative operator for the scan
operation
)

Redeclares io.vavr.collection.SortedSet.scan.

Computes a prefix scan of the elements of the collection.

public default <U> Set<U>
scanLeft(U
the initial value
zero
,
BiFunction<? super U, ? super T, ? extends U>
the binary operator applied to the intermediate result and the element
operation
)

Implements io.vavr.collection.SortedSet.scanLeft.

Produces a collection containing cumulative results of applying the operator going left to right.

public default <U> Set<U>
scanRight(U
the initial value
zero
,
BiFunction<? super T, ? super U, ? extends U>
the binary operator applied to the intermediate result and the element
operation
)

Implements io.vavr.collection.SortedSet.scanRight.

Produces a collection containing cumulative results of applying the operator going right to left.

public Iterator<BitSet<T>>
slideBy(Function<? super T, ?>
A function which classifies elements into classes
classifier
)

Redeclares io.vavr.collection.SortedSet.slideBy.

Slides a non-overlapping window of a variable size over this Traversable.

public default Iterator<BitSet<T>>
sliding(int
a positive window size
size
)

Implements io.vavr.collection.SortedSet.sliding.

Slides a window of a specific size and step size 1 over this Traversable by calling sliding(int, int).

public Iterator<BitSet<T>>
sliding(int
a positive window size
size
,
int
a positive step size
step
)

Redeclares io.vavr.collection.SortedSet.sliding.

Slides a window of a specific size and step size over this Traversable.

public Tuple2<BitSet<T>, BitSet<T>>
span(Predicate<? super T>
A predicate.
predicate
)

Redeclares io.vavr.collection.SortedSet.span.

Returns a tuple where the first element is the longest prefix of elements that satisfy the given predicate and the second element is the remainder.

public default String
stringPrefix()

Implements io.vavr.Value.stringPrefix.

Returns the name of this Value type, which is used by toString().

public static BitSet<Integer>

Returns:

A BitSet consisting of elements f(0),f(1), ..., f(n - 1)
tabulate
(int
The number of elements in the BitSet
n
,
Function<Integer, Integer>
The Function computing element values
f
)

Returns a BitSet containing n values of a given Function f over a range of integer values from 0 to n - 1.

public default BitSet<T>
tail()

Implements io.vavr.collection.SortedSet.tail.

Drops the first element of a non-empty Traversable.

public default Option<BitSet<T>>
tailOption()

Implements io.vavr.collection.SortedSet.tailOption.

Drops the first element of a non-empty Traversable and returns an Option.

public BitSet<T>
take(int
The number of elements to take.
n
)

Redeclares io.vavr.collection.SortedSet.take.

Takes the first n elements of this or all elements, if this length < n.

public BitSet<T>
takeRight(int
The number of elements to take.
n
)

Redeclares io.vavr.collection.SortedSet.takeRight.

Takes the last n elements of this or all elements, if this length < n.

public default BitSet<T>
takeUntil(Predicate<? super T>
A condition tested subsequently for this elements.
predicate
)

Implements io.vavr.collection.SortedSet.takeUntil.

Takes elements until the predicate holds for the current element.

public BitSet<T>
takeWhile(Predicate<? super T>
A condition tested subsequently for the contained elements.
predicate
)

Redeclares io.vavr.collection.SortedSet.takeWhile.

Takes elements while the predicate holds for the current element.

public default SortedSet<T>
toJavaSet()

Implements io.vavr.collection.SortedSet.toJavaSet.

Converts this Vavr Set to a java.util.Set while preserving characteristics like insertion order (LinkedHashSet) and sort order (SortedSet).

public default BitSet<T>
union(Set<? extends T>
The set to form the union with.
elements
)

Implements io.vavr.collection.SortedSet.union.

Adds all of the elements of that set to this set, if not already present.

public default <T1, T2> Tuple2<TreeSet<T1>, TreeSet<T2>>
unzip(Function<? super T, Tuple2<? extends T1, ? extends T2>>
a function which converts elements of this to pairs
unzipper
)

Implements io.vavr.collection.SortedSet.unzip.

Unzips this elements by mapping this elements to pairs which are subsequently split into two distinct sets.

public default <T1, T2, T3> Tuple3<TreeSet<T1>, TreeSet<T2>, TreeSet<T3>>
unzip3(Function<? super T, Tuple3<? extends T1, ? extends T2, ? extends T3>>
a function which converts elements of this to pairs
unzipper
)

Implements io.vavr.collection.SortedSet.unzip3.

Unzips this elements by mapping this elements to triples which are subsequently split into three distinct sets.

public static BitSet.Builder<Byte>
public static BitSet.Builder<Character>
public static <T extends Enum<T>> BitSet.Builder<T>
withEnum(Class<T> enumClass)

public static BitSet.Builder<Long>
public static <T> BitSet.Builder<T>
public static BitSet.Builder<Short>
public default <U> TreeSet<Tuple2<T, U>>
zip(Iterable<? extends U>
The Iterable providing the second half of each result pair.
that
)

Implements io.vavr.collection.SortedSet.zip.

Returns a traversable formed from this traversable and another Iterable collection by combining corresponding elements in pairs.

public default <U> TreeSet<Tuple2<T, U>>
zipAll(Iterable<? extends U>
The Iterable providing the second half of each result pair.
that
,
T
The element to be used to fill up the result if this traversable is shorter than that.
thisElem
,
U
The element to be used to fill up the result if that is shorter than this traversable.
thatElem
)

Implements io.vavr.collection.SortedSet.zipAll.

Returns a traversable formed from this traversable and another Iterable by combining corresponding elements in pairs.

public default <U, R> TreeSet<R>
zipWith(Iterable<? extends U>
The Iterable providing the second parameter of the mapper.
that
,
BiFunction<? super T, ? super U, ? extends R>
a mapper.
mapper
)

Implements io.vavr.collection.SortedSet.zipWith.

Returns a traversable formed from this traversable and another Iterable collection by mapping elements.

public default TreeSet<Tuple2<T, Integer>>
zipWithIndex()

Implements io.vavr.collection.SortedSet.zipWithIndex.

Zips this traversable with its indices.

public default <U> TreeSet<U>
zipWithIndex(BiFunction<? super T, ? super Integer, ? extends U>
a mapper.
mapper
)

Implements io.vavr.collection.SortedSet.zipWithIndex.

Zips this traversable with its indices by applying mapper provided.

Inherited from io.vavr.collection.SortedSet:
isOrderednarroworElseorElse