[Biojava-l] [newio] Proposed event-notification interfaces
Thomas Down
td2@sanger.ac.uk
Fri, 10 Nov 2000 17:21:12 +0000
On Fri, Nov 10, 2000 at 12:32:11PM +0000, Matthew Pocock wrote:
>
> The current location frame-work is effectively built around the concept of
> sets of symbol indecies. Thus, there is no 'between'. This has caused
> problems for edit operations - GappedSymbolList for example is a bit tortuous
> in its definition of where to insert new gap characters. If you want to think
> of the current locations in terms of between-ness, then the min represents
> between it and the previous symbol, and max represents between it an the
> following symbol. Since min < max, there is no way to represent 'between'.
>
> The options are
>
> a) A completely new position object. Pros - it can look however you want it
> to. Cons - it will not play well with locations
This could be a bit awkward, especially when it comes to attaching
Position objects to Features (I guess we'd want a common base
interface for Position and Location, and I haven't a clue what
that would look like). Could also lead to quite a bit of special
case code :(.
Probably worth exploring options which use the existing Location
interface first, anyway.
> b) A location implementation that is empty, and still represents a gap
> emediately before min & emediately after max, and where max = min-1? Pros -
> this would fit the current math cleanly, and would let you add features to
> splice-sites. Cons - it kind-of breaks the Location concept.
>
> c) A location implementation where max = min + 1, but is empty and represents
> the position between the two indecies. Pros - nothing broken. Cons - We would
> have to adjust the Location docs to state that min & max are not contained in
> the location in this very special case - no biggie.
I think I prefer plan b -- to me this seems to be the smallest
possible change of current Location semantics.
One question concerns the semantics of the union operation for
`cut' locations. If we have two cut locations, should the union
method give:
- The empty location (i.e. the union operator is only considering
positions contained within the two locations).
- A `compound cut' location -- I guess calling blockIterator on
this will return the two individual cut-points.
- Something else entirely?
What about the case the union of a `cut' location and a normal
`coverage' location?
Any thoughts?
Thomas.
--
``If I was going to carry a large axe on my back to a diplomatic
function I think I'd want it glittery too.''
-- Terry Pratchett