Class Hit

java.lang.Object
com.yahoo.vespa.objects.Selectable
com.yahoo.vespa.objects.Identifiable
com.yahoo.searchlib.aggregation.Hit
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
FS4Hit, VdsHit

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
    Modifier and Type
    Field
    Description
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Hit()
    Constructs an empty result node.
    Hit(double rank)
    Create a new hit with the given rank
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    Returns the context object of this hit.
    double
    Obtain the rank of this hit.
    int
     
    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, serialize, serializeOptional, serializeWithId, toString

    Methods inherited from class com.yahoo.vespa.objects.Selectable

    select, select, selectMembers

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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

      public Object getContext()
      Returns the context object of this hit.
      Returns:
      The context object.
    • setContext

      public Hit setContext(Object context)
      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 class com.yahoo.vespa.objects.Identifiable
    • onDeserialize

      protected void onDeserialize(com.yahoo.vespa.objects.Deserializer buf)
      Overrides:
      onDeserialize in class com.yahoo.vespa.objects.Identifiable
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class com.yahoo.vespa.objects.Identifiable
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class com.yahoo.vespa.objects.Identifiable
    • visitMembers

      public void visitMembers(com.yahoo.vespa.objects.ObjectVisitor visitor)
      Overrides:
      visitMembers in class com.yahoo.vespa.objects.Identifiable