diff options
author | Jon Bratseth <bratseth@verizonmedia.com> | 2019-09-24 20:49:45 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@verizonmedia.com> | 2019-09-24 20:49:45 +0200 |
commit | cd548f53404bd41bdf3b2a4a0279a437bbd9a160 (patch) | |
tree | 4918b2acbc2b38767396e21d57c92a15908eacc7 /searchlib/src/main/java | |
parent | ec62b8595306a40ac835aecf52fe9b03a0779a05 (diff) |
Nonfunctional changes only
Diffstat (limited to 'searchlib/src/main/java')
-rw-r--r-- | searchlib/src/main/java/com/yahoo/searchlib/aggregation/AggregationResult.java | 35 | ||||
-rw-r--r-- | searchlib/src/main/java/com/yahoo/searchlib/aggregation/HitsAggregationResult.java | 19 |
2 files changed, 19 insertions, 35 deletions
diff --git a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/AggregationResult.java b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/AggregationResult.java index c3ad7cbe879..6858ebb8f82 100644 --- a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/AggregationResult.java +++ b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/AggregationResult.java @@ -29,10 +29,10 @@ public abstract class AggregationResult extends ExpressionNode { } /** - * <p>Assigns a tag to this group.</p> + * Assigns a tag to this group. * - * @param tag The numerical tag to set. - * @return This, to allow chaining. + * @param tag the numerical tag to set. + * @return this, to allow chaining. */ public AggregationResult setTag(int tag) { this.tag = tag; @@ -40,52 +40,44 @@ public abstract class AggregationResult extends ExpressionNode { } /** - * <p>This method is called when merging aggregation results. This method is simply a proxy for the abstract {@link - * #onMerge(AggregationResult)} method.</p> + * Called when merging aggregation results. This method is simply a proxy for the abstract {@link + * #onMerge(AggregationResult)} method. * - * @param result The result to merge with. + * @param result the result to merge with. */ public void merge(AggregationResult result) { onMerge(result); } /** - * This method is called when all aggregation results have been merged. This method can be overloaded by + * Hook called when all aggregation results have been merged. This method can be overloaded by * subclasses that need special behaviour to occur after merge. */ public void postMerge() { // empty } - /** - * <p>This method returns a value that can be used for ranking.</p> - * - * @return The rankable result. - */ + /** Returns a value that can be used for ranking. */ public abstract ResultNode getRank(); /** - * <p>Sets the expression to aggregate on.</p> + * Sets the expression to aggregate on. * - * @param exp The expression. - * @return This, to allow chaining. + * @param exp the expression + * @return this, to allow chaining */ public AggregationResult setExpression(ExpressionNode exp) { expression = exp; return this; } - /** - * <p>Returns the expression to aggregate on.</p> - * - * @return The expression. - */ + /** Returns the expression to aggregate on. */ public ExpressionNode getExpression() { return expression; } /** - * This method must be implemented by subclasses to support merge. It is called as the {@link + * Mmust be implemented by subclasses to support merge. It is called as the {@link * #merge(AggregationResult)} method is invoked. * * @param result the result to merge with @@ -158,4 +150,5 @@ public abstract class AggregationResult extends ExpressionNode { visitor.visit("expression", expression); visitor.visit("tag", tag); } + } diff --git a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/HitsAggregationResult.java b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/HitsAggregationResult.java index b462fb67dd5..63b2b881e01 100644 --- a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/HitsAggregationResult.java +++ b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/HitsAggregationResult.java @@ -159,11 +159,7 @@ public class HitsAggregationResult extends AggregationResult { @Override public void postMerge() { - Collections.sort(hits, new Comparator<Hit>() { - public int compare(Hit lhs, Hit rhs) { - return -Double.compare(lhs.getRank(), rhs.getRank()); - } - }); + hits.sort((lhs, rhs) -> -Double.compare(lhs.getRank(), rhs.getRank())); if ((maxHits >= 0) && (hits.size() > maxHits)) { hits = hits.subList(0, maxHits); } @@ -172,15 +168,9 @@ public class HitsAggregationResult extends AggregationResult { @Override protected boolean equalsAggregation(AggregationResult obj) { HitsAggregationResult rhs = (HitsAggregationResult)obj; - if (!summaryClass.equals(rhs.summaryClass)) { - return false; - } - if (maxHits != rhs.maxHits) { - return false; - } - if (!hits.equals(rhs.hits)) { - return false; - } + if ( ! summaryClass.equals(rhs.summaryClass)) return false; + if (maxHits != rhs.maxHits) return false; + if ( ! hits.equals(rhs.hits)) return false; return true; } @@ -215,4 +205,5 @@ public class HitsAggregationResult extends AggregationResult { hit.select(predicate, operation); } } + } |