Package com.yahoo.searchlib.aggregation
Class Hit
java.lang.Object
com.yahoo.vespa.objects.Selectable
com.yahoo.vespa.objects.Identifiable
com.yahoo.searchlib.aggregation.Hit
- All Implemented Interfaces:
Cloneable
public abstract class Hit
extends com.yahoo.vespa.objects.Identifiable
This class represents a generic hit with a rank value. Actual hits are represented using subclasses of this class.
- Author:
- havardpe
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the context object of this hit.double
getRank()
Obtain the rank of this hit.int
hashCode()
protected void
onDeserialize
(com.yahoo.vespa.objects.Deserializer buf) protected void
onSerialize
(com.yahoo.vespa.objects.Serializer buf) setContext
(Object context) Sets the context object of this hit.void
visitMembers
(com.yahoo.vespa.objects.ObjectVisitor visitor) Methods inherited from class com.yahoo.vespa.objects.Identifiable
clone, create, createFromId, deserialize, deserializeOptional, deserializeWithId, equals, getClassId, getRawUtf8Bytes, getUtf8, onGetClassId, putUtf8, registerClass, registerClass, serialize, serializeOptional, serializeWithId, toString
Methods inherited from class com.yahoo.vespa.objects.Selectable
select, select, selectMembers
-
Field Details
-
classId
public static final int classId
-
-
Constructor Details
-
Hit
public Hit()Constructs an empty result node. -
Hit
public Hit(double rank) Create a new hit with the given rank- Parameters:
rank
- generic rank value
-
-
Method Details
-
getRank
public double getRank()Obtain the rank of this hit. This is a comparable rank to allow multilevel sorting on arbitrary rank type.- Returns:
- generic rank value
-
getContext
Returns the context object of this hit.- Returns:
- The context object.
-
setContext
Sets the context object of this hit. This is not serialized, and is merely a tag used by the QRS.- Parameters:
context
- The context to set.- Returns:
- This, to allow chaining.
-
onSerialize
protected void onSerialize(com.yahoo.vespa.objects.Serializer buf) - Overrides:
onSerialize
in classcom.yahoo.vespa.objects.Identifiable
-
onDeserialize
protected void onDeserialize(com.yahoo.vespa.objects.Deserializer buf) - Overrides:
onDeserialize
in classcom.yahoo.vespa.objects.Identifiable
-
hashCode
public int hashCode()- Overrides:
hashCode
in classcom.yahoo.vespa.objects.Identifiable
-
equals
- Overrides:
equals
in classcom.yahoo.vespa.objects.Identifiable
-
visitMembers
public void visitMembers(com.yahoo.vespa.objects.ObjectVisitor visitor) - Overrides:
visitMembers
in classcom.yahoo.vespa.objects.Identifiable
-