public class

FloatArrayDocumentResultScores

extends Object
implements DocumentResultScores
java.lang.Object
   ↳ com.atlassian.confluence.search.contentnames.FloatArrayDocumentResultScores

Class Overview

A DocumentScores implementation which will keep each score in a float array where the position in the array matches the docId for each document.

Summary

Public Constructors
FloatArrayDocumentResultScores(int size)
Public Methods
void each(DocumentResultScores.Block block)
Iterates through all docId and score pairs where the score is greater than zero and then executes the block against each pair.
float getScore(int docId)
Retrieve the score for the specified docId.
float incrementScore(int docId, byte increment)
Increments the score for docId.
float multiplyScore(int docId, float factor)
Multiply the score of the specified document by the supplied factor.
void setScore(int docId, float score)
Override any existing score for the specified document and replace with the new supplied score.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.confluence.search.contentnames.DocumentResultScores

Public Constructors

public FloatArrayDocumentResultScores (int size)

Parameters
size size of the underlying byte array

Public Methods

public void each (DocumentResultScores.Block block)

Iterates through all docId and score pairs where the score is greater than zero and then executes the block against each pair.

Parameters
block the block to run against each document id and score pair.

public float getScore (int docId)

Retrieve the score for the specified docId.

Parameters
docId the document id
Returns
  • the score for the specified docId

public float incrementScore (int docId, byte increment)

Increments the score for docId. If this score exceeds MAX_VALUE the score is left at the max value.

Parameters
docId the document id
increment how much to increment the score by. Must be greater than 0.
Returns
  • the score for docId after incrementing.

public float multiplyScore (int docId, float factor)

Multiply the score of the specified document by the supplied factor.

Parameters
docId the document Id to change the score of
factor the factor to multiple the document's current score by.
Returns
  • the new score for the document.

public void setScore (int docId, float score)

Override any existing score for the specified document and replace with the new supplied score.

Parameters
docId the document Id to set the score for.
score the new score for this document.