public class ScoredIdBuilder extends Object implements org.apache.commons.lang3.builder.Builder<ScoredId>
ScoredId.Builder to instantiate new ScoredId objects.| Constructor and Description |
|---|
ScoredIdBuilder()
Create a
ScoredIdBuilder. |
ScoredIdBuilder(long id)
Create a
ScoredIdBuilder. |
ScoredIdBuilder(long id,
double score)
Create a
ScoredIdBuilder. |
| Modifier and Type | Method and Description |
|---|---|
ScoredIdBuilder |
addChannel(Symbol symbol,
double value)
Add a new unboxed side channel to the
ScoredId under construction. |
<K> ScoredIdBuilder |
addChannel(TypedSymbol<K> symbol,
K value)
Add a new side channel to the
ScoredId under construction. |
ScoredId |
build()
Finish constructing the
ScoredId and instantiate it. |
ScoredIdBuilder |
clearChannels()
Removes all channels (typed and double) from new
ScoredId objects produced by the builder. |
ScoredIdBuilder |
setId(long id)
Change the ID of the
ScoredID object under construction. |
ScoredIdBuilder |
setScore(double score)
Change the score of the
ScoredId object under construction. |
public ScoredIdBuilder()
ScoredIdBuilder. Any ScoredId objects
created by this builder will have the default ID of 0 and default
score of 0 unless they are explicitly set by the user.public ScoredIdBuilder(long id)
ScoredIdBuilder. Any ScoredId objects
created by this builder will have the specified ID and a default
score of 0 unless they are explicitly changed by the user.id - The numerical ID of ScoredId objects produced
by this builder.public ScoredIdBuilder(long id,
double score)
ScoredIdBuilder. Any ScoredId objects
created by this builder will have the specified ID and score unless
they are explicitly changed by the user.id - The numerical ID of ScoredId objects produced by
this builder.score - The score for ScoredId objects produced by
this builder.public ScoredIdBuilder setId(long id)
ScoredID object under construction.id - The ID to be used for new ScoredId objects.public ScoredIdBuilder setScore(double score)
ScoredId object under construction.score - The score to be used for new ScoredId objects.public ScoredIdBuilder addChannel(Symbol symbol, double value)
ScoredId under construction.symbol - The symbol for the side channel.value - The numerical value for the side channel.addChannel(TypedSymbol, Object)public <K> ScoredIdBuilder addChannel(@Nonnull TypedSymbol<K> symbol, @Nonnull K value)
ScoredId under construction.symbol - The symbol for the side channel.value - The value for the side channel.public ScoredIdBuilder clearChannels()
ScoredId objects produced by the builder.Copyright © 2013 GroupLens Research. All Rights Reserved.