public interface ScoredId
ScoredId object is intended to be immutable. Scored IDs can be created by using the
builder or accumulated in a PackedScoredIdList.
In addition to the score, a scored id associates channels with the id. Channels are
identified by TypedSymbols. As an optimization, channels of type double can be
accessed in unboxed fashion using an untyped Symbol.
A channel, if it is present, cannot contain null.
| Modifier and Type | Method and Description |
|---|---|
Collection<SymbolValue<?>> |
getChannels()
Get the channels associated with a scored ID.
|
Set<TypedSymbol<?>> |
getChannelSymbols()
Determine the typed symbols associated with all side channels of a
ScoredId. |
<T> T |
getChannelValue(TypedSymbol<T> sym)
Get the value for a channel.
|
long |
getId()
Retrieve the numerical identifier of this
ScoredId. |
double |
getScore()
Retrieve the score of this
ScoredId. |
Collection<DoubleSymbolValue> |
getUnboxedChannels()
Get the unboxed channels associated with a scored ID.
|
Set<Symbol> |
getUnboxedChannelSymbols()
Determine the symbols associated with all unboxed double side channels of a
ScoredId. |
double |
getUnboxedChannelValue(Symbol sym)
Get the unboxed value for a channel.
|
boolean |
hasChannel(TypedSymbol<?> s)
Determine if a
ScoredId has a specific typed channel. |
boolean |
hasUnboxedChannel(Symbol s)
Determine if a
ScoredId has a specific channel. |
long getId()
ScoredId.double getScore()
ScoredId.@Nonnull Set<Symbol> getUnboxedChannelSymbols()
ScoredId.Symbol objects, each of which maps to a value in
one of the ScoredId's unboxed double side channels.@Nonnull Set<TypedSymbol<?>> getChannelSymbols()
ScoredId.TypedSymbol objects, each of which maps to a value in
one of the ScoredId's side channels.@Nonnull Collection<SymbolValue<?>> getChannels()
@Nonnull Collection<DoubleSymbolValue> getUnboxedChannels()
@Nullable <T> T getChannelValue(@Nonnull TypedSymbol<T> sym)
T - The type contained.sym - The channel symbol.null if no such channel is present.double getUnboxedChannelValue(Symbol sym)
sym - The channel symbol.NullPointerException - if the symbol names a nonexistent channel.boolean hasUnboxedChannel(Symbol s)
ScoredId has a specific channel.s - The side channel's symbol.true if the ScoredId has a channel associated
with this symbol, false otherwise.boolean hasChannel(TypedSymbol<?> s)
ScoredId has a specific typed channel.s - The typed side channel's symbol.true if the ScoredId has a channel associated
with this symbol, false otherwise.