I think that BooleanQuery should not implement Collection directly,
because it contains only BooleanClause's objects.
Collection view is good idea. I think it should be unmodifiable view.
public Collection clauses() {
return Collections.unmodifiableCollection(clauses);
}
Yonik Seeley (JIRA) wrote:
[ http://issues.apache.org/jira/browse/LUCENE-476?page=comments#action_12359326 ]
Yonik Seeley commented on LUCENE-476:
-------------------------------------
Perhaps it would be better to either support returning a Collection view of the
BooleanQuery, or have BooleanQuery directly implement Collection?
BooleanQuery add public method that returns number of clauses this query
------------------------------------------------------------------------
Key: LUCENE-476
URL: http://issues.apache.org/jira/browse/LUCENE-476
Project: Lucene - Java
Type: Improvement
Components: Search
Reporter: Volodymyr Bychkoviak
Attachments: BooleanQuery.diff
BooleanQuery add public method getClausesCount() that returns number of clauses
this query.
current ways of getting clauses count are:
1).
int clausesCount = booleanQuery.getClauses().length;
or
--
regards,
Volodymyr Bychkoviak