Class ScoreNode


  • public final class ScoreNode
    extends Object
    ScoreNode implements a simple container which holds a mapping of NodeId to a score value.
    • Constructor Detail

      • ScoreNode

        public ScoreNode​(NodeId id,
                         float score)
        Creates a new ScoreNode.
        Parameters:
        id - the node id.
        score - the score value.
      • ScoreNode

        public ScoreNode​(NodeId id,
                         float score,
                         int doc)
        Creates a new ScoreNode.
        Parameters:
        id - the node id.
        score - the score value.
        doc - the document number.
    • Method Detail

      • getNodeId

        public NodeId getNodeId()
        Returns:
        the node id for this ScoreNode.
      • getScore

        public float getScore()
        Returns:
        the score for this ScoreNode.
      • setScore

        public void setScore​(float score)
        Sets a new score value.
        Parameters:
        score - the score value.
      • getDoc

        public int getDoc​(IndexReader reader)
                   throws IOException
        Returns the document number for this score node.
        Parameters:
        reader - the current index reader to look up the document if needed.
        Returns:
        the document number.
        Throws:
        IOException - if an error occurs while reading from the index or the node is not present in the index.