@Deprecated public final class ScoredIds extends Object
Utility classes for working with scored IDs.
Modifier and Type | Method and Description |
---|---|
static Ordering<ScoredId> |
channelOrder(Symbol chan)
Deprecated.
An ordering (comparator) that compares IDs by channel.
|
static <T extends Comparable<? super T>> |
channelOrder(TypedSymbol<T> chan)
Deprecated.
An ordering (comparator) that compares IDs by typed channel.
|
static <T> Ordering<ScoredId> |
channelOrder(TypedSymbol<T> chan,
Comparator<? super T> order)
Deprecated.
An ordering (comparator) that compares IDs by typed channel.
|
static Collection<ScoredId> |
collectionFromVector(SparseVector vector)
Deprecated.
View a vector as a collection of
ScoredId objects. |
static ScoredIdBuilder |
copyBuilder(ScoredId id)
Deprecated.
Create a new builder initialized to copy the specified scored ID.
|
static ScoredId |
create(long id,
double score)
Deprecated.
Create a scored id with no channels.
|
static Function<ScoredId,Long> |
idFunction()
Deprecated.
A
Function that extracts the ID from a scored ID. |
static Ordering<ScoredId> |
idOrder()
Deprecated.
An ordering (comparator) that compares IDs by score.
|
static ScoredIdBuilder |
newBuilder()
Deprecated.
Create a new builder.
|
static ScoredIdListBuilder |
newListBuilder()
Deprecated.
Create a new list builder.
|
static ScoredIdListBuilder |
newListBuilder(int cap)
Deprecated.
Create a new list builder.
|
static Ordering<ScoredId> |
scoreOrder()
Deprecated.
An ordering (comparator) that compares IDs by score.
|
public static ScoredIdBuilder copyBuilder(ScoredId id)
Create a new builder initialized to copy the specified scored ID.
id
- The scored ID to copy.public static ScoredIdBuilder newBuilder()
Create a new builder.
public static ScoredIdListBuilder newListBuilder()
Create a new list builder.
public static ScoredIdListBuilder newListBuilder(int cap)
Create a new list builder.
cap
- The initial capacity to reserve.public static ScoredId create(long id, double score)
Create a scored id with no channels.
id
- The ID.score
- The score.public static Function<ScoredId,Long> idFunction()
A Function
that extracts the ID from a scored ID.
public static Ordering<ScoredId> idOrder()
An ordering (comparator) that compares IDs by score.
ScoredId
s by score.public static Ordering<ScoredId> scoreOrder()
An ordering (comparator) that compares IDs by score.
ScoredId
s by score.public static Ordering<ScoredId> channelOrder(Symbol chan)
An ordering (comparator) that compares IDs by channel. Missing channels are less than present channels.
chan
- The channel to sort by.public static <T extends Comparable<? super T>> Ordering<ScoredId> channelOrder(TypedSymbol<T> chan)
An ordering (comparator) that compares IDs by typed channel. Null values are sorted first. This method calls channelOrder(TypedSymbol, Comparator)
with a comparator of Ordering.natural().nullsFirst()
.
chan
- The channel to sort by.channelOrder(TypedSymbol, Comparator)
public static <T> Ordering<ScoredId> channelOrder(TypedSymbol<T> chan, Comparator<? super T> order)
An ordering (comparator) that compares IDs by typed channel. Missing channels and null Ids are both treated as having null
channel values, so their ordering is controlled by the order’s null treatment.
chan
- The channel to sort by.order
- The ordering to use.public static Collection<ScoredId> collectionFromVector(SparseVector vector)
View a vector as a collection of ScoredId
objects.