mirror of
https://github.com/apache/lucene.git
synced 2025-02-09 11:35:14 +00:00
LUCENE-6446: Fix method visibility and trappy factory method.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1675365 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9464d2afb7
commit
965105b8fe
@ -25,7 +25,7 @@ import java.util.List;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/** Expert: Describes the score computation for document and query. */
|
/** Expert: Describes the score computation for document and query. */
|
||||||
public class Explanation {
|
public final class Explanation {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new explanation for a match.
|
* Create a new explanation for a match.
|
||||||
@ -51,14 +51,14 @@ public class Explanation {
|
|||||||
* Create a new explanation for a document which does not match.
|
* Create a new explanation for a document which does not match.
|
||||||
*/
|
*/
|
||||||
public static Explanation noMatch(String description, Collection<Explanation> details) {
|
public static Explanation noMatch(String description, Collection<Explanation> details) {
|
||||||
return new Explanation(false, 0f, description, Collections.emptyList());
|
return new Explanation(false, 0f, description, details);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new explanation for a document which does not match.
|
* Create a new explanation for a document which does not match.
|
||||||
*/
|
*/
|
||||||
public static Explanation noMatch(String description, Explanation... details) {
|
public static Explanation noMatch(String description, Explanation... details) {
|
||||||
return new Explanation(false, 0f, description, Collections.emptyList());
|
return new Explanation(false, 0f, description, Arrays.asList(details));
|
||||||
}
|
}
|
||||||
|
|
||||||
private final boolean match; // whether the document matched
|
private final boolean match; // whether the document matched
|
||||||
@ -90,11 +90,7 @@ public class Explanation {
|
|||||||
/** A description of this explanation node. */
|
/** A description of this explanation node. */
|
||||||
public String getDescription() { return description; }
|
public String getDescription() { return description; }
|
||||||
|
|
||||||
/**
|
private String getSummary() {
|
||||||
* A short one line summary which should contain all high level
|
|
||||||
* information about this Explanation, without the "Details"
|
|
||||||
*/
|
|
||||||
protected String getSummary() {
|
|
||||||
return getValue() + " = " + getDescription();
|
return getValue() + " = " + getDescription();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,7 +104,8 @@ public class Explanation {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
return toString(0);
|
return toString(0);
|
||||||
}
|
}
|
||||||
protected String toString(int depth) {
|
|
||||||
|
private String toString(int depth) {
|
||||||
StringBuilder buffer = new StringBuilder();
|
StringBuilder buffer = new StringBuilder();
|
||||||
for (int i = 0; i < depth; i++) {
|
for (int i = 0; i < depth; i++) {
|
||||||
buffer.append(" ");
|
buffer.append(" ");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user