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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the context object of this hit.doublegetRank()Obtain the rank of this hit.inthashCode()protected voidonDeserialize(com.yahoo.vespa.objects.Deserializer buf) protected voidonSerialize(com.yahoo.vespa.objects.Serializer buf) setContext(Object context) Sets the context object of this hit.voidvisitMembers(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, serialize, serializeOptional, serializeWithId, toStringMethods 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:
onSerializein classcom.yahoo.vespa.objects.Identifiable
-
onDeserialize
protected void onDeserialize(com.yahoo.vespa.objects.Deserializer buf) - Overrides:
onDeserializein classcom.yahoo.vespa.objects.Identifiable
-
hashCode
public int hashCode()- Overrides:
hashCodein classcom.yahoo.vespa.objects.Identifiable
-
equals
- Overrides:
equalsin classcom.yahoo.vespa.objects.Identifiable
-
visitMembers
public void visitMembers(com.yahoo.vespa.objects.ObjectVisitor visitor) - Overrides:
visitMembersin classcom.yahoo.vespa.objects.Identifiable
-