public class Aggregator<T> extends Object
ScoredObject
elements.Constructor and Description |
---|
Aggregator()
Constructs a new
Aggregator . |
Aggregator(Comparator<ScoredObject<T>> comparator)
Constructs a new
Aggregator . |
Modifier and Type | Method and Description |
---|---|
boolean |
add(ScoredObject<T> element)
Adds a single element, if not present already.
|
boolean |
addAll(Collection<ScoredObject<T>> elements)
Adds a collection of elements, if not present already.
|
boolean |
isEmpty()
Returns
true if no elements exist. |
boolean |
retain(ScoredObject<T> element)
Retain the elements in common, compared according to the objects scored.
|
boolean |
retainAll(Collection<ScoredObject<T>> elements)
Retains the elements in common, compared according to the objects scored.
|
int |
size()
Returns the number of elements.
|
List<T> |
values()
Returns a
List of all objects scored, sorted according to the default comparator. |
public Aggregator()
Aggregator
.public Aggregator(@Nullable Comparator<ScoredObject<T>> comparator)
Aggregator
.public boolean add(ScoredObject<T> element)
NullPointerException
- if element
is null;public boolean addAll(Collection<ScoredObject<T>> elements)
NullPointerException
- if elements
is null or contains a null element;public boolean isEmpty()
true
if no elements exist.public boolean retain(ScoredObject<T> element)
NullPointerException
- if element
is null;public boolean retainAll(Collection<ScoredObject<T>> elements)
NullPointerException
- if elements
is null or contains a null element;public int size()
Copyright © 2017. All rights reserved.