Package org.infinispan.multimap.impl
Interface BaseSetBucket<E>
- Type Parameters:
E
- Type of elements in the set.
- All Known Implementing Classes:
SetBucket
,SortedSetBucket
public interface BaseSetBucket<E>
Implements base functionalities shared by set-like data structures.
Some functionalities in set are shared across sets. In such a way that it requires a common interface when operating
with the FunctionalMap
API. This allows for functions to operate in any concrete
implementations of sets.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionList
<ScoredValue<E>> Set
<ScoredValue<E>> getAsSet()
default Collection
<ScoredValue<E>> inter
(Collection<ScoredValue<E>> input, double weight, SortedSetBucket.AggregateFunction function) Calculates the intersection of two sets.default Collection
<ScoredValue<E>> union
(Collection<ScoredValue<E>> input, double weight, SortedSetBucket.AggregateFunction function) Calculates the union of two sets.
-
Method Details
-
union
default Collection<ScoredValue<E>> union(Collection<ScoredValue<E>> input, double weight, SortedSetBucket.AggregateFunction function) Calculates the union of two sets.The method calculates the union of this
BaseSetBucket
instance with the provided input collection. In case of duplicates, the elements in the input take precedence.- Parameters:
input
- Items from another set to create the union.weight
- Weight to apply to scores of each element.function
- Aggregate function to apply to scores.- Returns:
- Collection with the elements of the union of the two sets.
-
inter
default Collection<ScoredValue<E>> inter(Collection<ScoredValue<E>> input, double weight, SortedSetBucket.AggregateFunction function) Calculates the intersection of two sets.Calculates the intersection of this
BaseSetBucket
instance with the provided input collection.- Parameters:
input
- Items from another set to create the intersection.weight
- Weight to apply to scores of each element.function
- Aggregate function to apply to scores.- Returns:
- Collection with the elements in the intersection of the two sets.
-
getAsSet
Set<ScoredValue<E>> getAsSet() -
getAsList
List<ScoredValue<E>> getAsList() -
getScore
-