com.atlassian.confluence.search.contentnames
Interface DocumentResultScores

All Known Implementing Classes:
BitSetAwareDocumentResultScores, FloatArrayDocumentResultScores, OpenBitSetAwareDocumentResultScores

public interface DocumentResultScores

Interface for storing, incrementing and iterating over document scores. Each document id is associated with one document score.


Nested Class Summary
static interface DocumentResultScores.Block
          Callback interface to provide clients with the ability to run custom code against all document and score pairs maintained by this class.
 
Method Summary
 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)
          Increase the score for the specified document by the supplied amount.
 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.
 long size()
          Returns the number of scores.
 

Method Detail

incrementScore

float incrementScore(int docId,
                     byte increment)
Increase the score for the specified document by the supplied amount.

Parameters:
docId - the document Id
increment - the amount to increase score by (must be greater than zero)
Returns:
the new total score for the document
Throws:
java.lang.IllegalArgumentException - if increment is less than or equal to zero

multiplyScore

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.

getScore

float getScore(int docId)
Retrieve the score for the specified docId.

Parameters:
docId - the document id
Returns:
the score for the specified docId

setScore

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.

each

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.

size

long size()
Returns the number of scores.



Copyright © 2003-2014 Atlassian. All Rights Reserved.