You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Alan Woodward (JIRA)" <ji...@apache.org> on 2015/05/09 23:21:59 UTC

[jira] [Updated] (LUCENE-6473) Make Spans an interface

     [ https://issues.apache.org/jira/browse/LUCENE-6473?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alan Woodward updated LUCENE-6473:
----------------------------------
    Attachment: LUCENE-6473.patch

Patch.  This makes Spans an interface, incorporating the DocIdSetIterator methods that are used in the various implementations.  It also adds a Spans.Iterator wrapper class that represents a Spans as a DocIdSetIterator for those places that need it.

Another way to do this would be perhaps to make DocIdSetIterator itself an interface.  It currently only has a single concrete method on it, slowAdvance(), which we could replace in trunk with a default interface method and in 5.x with a separate utility method.  I'd guess that a lot more people extend DISI in their own code, however, which would make that change more invasive.

> Make Spans an interface
> -----------------------
>
>                 Key: LUCENE-6473
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6473
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Alan Woodward
>         Attachments: LUCENE-6473.patch
>
>
> Spans is currently an abstract class, extending DocIdSetIterator.  This restricts what we can do with implementations of Spans.  For example, in LUCENE-6371, it would be useful to have PayloadSpan classes that extend existing Spans implementations, but that also implement a PayloadSpans interface that extends Spans.  This isn't possible if Spans is not an interface itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org