Methods Summary |
---|
public void | addDetail(org.apache.lucene.search.Explanation detail)Adds a sub-node to this explanation node.
if (details == null)
details = new ArrayList();
details.add(detail);
|
public java.lang.String | getDescription()A description of this explanation node. return description;
|
public org.apache.lucene.search.Explanation[] | getDetails()The sub-nodes of this explanation node.
if (details == null)
return null;
return (Explanation[])details.toArray(new Explanation[0]);
|
public float | getValue()The value assigned to this explanation node. return value;
|
public void | setDescription(java.lang.String description)Sets the description of this explanation node.
this.description = description;
|
public void | setValue(float value)Sets the value assigned to this explanation node. this.value = value;
|
public java.lang.String | toHtml()Render an explanation as HTML.
StringBuffer buffer = new StringBuffer();
buffer.append("<ul>\n");
buffer.append("<li>");
buffer.append(getValue());
buffer.append(" = ");
buffer.append(getDescription());
buffer.append("</li>\n");
Explanation[] details = getDetails();
if (details != null) {
for (int i = 0 ; i < details.length; i++) {
buffer.append(details[i].toHtml());
}
}
buffer.append("</ul>\n");
return buffer.toString();
|
private java.lang.String | toString(int depth)
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < depth; i++) {
buffer.append(" ");
}
buffer.append(getValue());
buffer.append(" = ");
buffer.append(getDescription());
buffer.append("\n");
Explanation[] details = getDetails();
if (details != null) {
for (int i = 0 ; i < details.length; i++) {
buffer.append(details[i].toString(depth+1));
}
}
return buffer.toString();
|
public java.lang.String | toString()Render an explanation as text.
return toString(0);
|