[ https://issues.apache.org/jira/browse/LUCENE-2109?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Uwe Schindler updated LUCENE-2109: ---------------------------------- Attachment: LUCENE-2109.patch Again the patch. I made the attributes() calls unfinal, which is not the best to ensure final, but the FilteredTermsEnum needs to override the method to return the attributes of the underlying TermsEnum. So everybody happy? > Make DocsEnum subclass of DocIdSetIterator > ------------------------------------------ > > Key: LUCENE-2109 > URL: https://issues.apache.org/jira/browse/LUCENE-2109 > Project: Lucene - Java > Issue Type: Improvement > Components: Index > Affects Versions: Flex Branch > Reporter: Uwe Schindler > Assignee: Uwe Schindler > Fix For: Flex Branch > > Attachments: LUCENE-2109.patch, LUCENE-2109.patch, LUCENE-2109.patch, > LUCENE-2109.patch > > > Spinoff from LUCENE-1458: > One thing I came along long time ago, but now with a new API it get's > interesting again: > DocsEnum should extend DocIdSetIterator, that would make it simplier to use > and implement e.g. in MatchAllDocQuery.Scorer, FieldCacheRangeFilter and so > on. You could e.g. write a filter for all documents that simply returns the > docs enumeration from IndexReader. > So it should be an abstract class that extends DocIdSetIterator. It has the > same methods, only some methods must be a little bit renamed. The problem is, > because java does not support multiple inheritace, we cannot also extends > attributesource Would DocIdSetIterator be an interface it would work (this > is one of the cases where interfaces for really simple patterns can be used, > like iterators). > The problem with multiple inheritance could be solved by an additional method > attributes() that creates a new AttributeSource on first access then (because > constructing an AttributeSource is costly). The same applies for the other > *Enums, it should be separated for lazy init. > DocsEnum could look like this: > {code} > public abstract class DocsEnum extends DocIdSetIterator { > private AttributeSource atts = null; > public int freq() > public DontKnowClassName positions() > public final AttributeSource attributes() { > if (atts==null) atts=new AttributeSource(); > return atts; > } > ...default impl of the bulk access using the abstract methods from > DocIdSetIterator > } > {code} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org For additional commands, e-mail: java-dev-h...@lucene.apache.org