Package org.apache.lucene.codecs
Class CompetitiveImpactAccumulator
- java.lang.Object
-
- org.apache.lucene.codecs.CompetitiveImpactAccumulator
-
public final class CompetitiveImpactAccumulator extends java.lang.ObjectThis class accumulates the (freq, norm) pairs that may produce competitive scores.
-
-
Field Summary
Fields Modifier and Type Field Description private int[]maxFreqsprivate java.util.TreeSet<Impact>otherFreqNormPairs
-
Constructor Summary
Constructors Constructor Description CompetitiveImpactAccumulator()Sole constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int freq, long norm)Accumulate a (freq,norm) pair, updating this structure if there is no equivalent or more competitive entry already.private voidadd(Impact newEntry, java.util.TreeSet<Impact> freqNormPairs)voidaddAll(CompetitiveImpactAccumulator acc)Mergeaccinto this.private booleanassertConsistent()voidclear()Reset to the same state it was in after creation.java.util.Collection<Impact>getCompetitiveFreqNormPairs()Get the set of competitive freq and norm pairs, ordered by increasing freq and norm.java.lang.StringtoString()
-
-
-
Field Detail
-
maxFreqs
private final int[] maxFreqs
-
otherFreqNormPairs
private final java.util.TreeSet<Impact> otherFreqNormPairs
-
-
Method Detail
-
clear
public void clear()
Reset to the same state it was in after creation.
-
add
public void add(int freq, long norm)Accumulate a (freq,norm) pair, updating this structure if there is no equivalent or more competitive entry already.
-
addAll
public void addAll(CompetitiveImpactAccumulator acc)
Mergeaccinto this.
-
getCompetitiveFreqNormPairs
public java.util.Collection<Impact> getCompetitiveFreqNormPairs()
Get the set of competitive freq and norm pairs, ordered by increasing freq and norm.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
assertConsistent
private boolean assertConsistent()
-
-