uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thilo Goetz <twgo...@gmx.de>
Subject Re: [jira] Closed: (UIMA-1352) java.lang.ClassCastException using find() with a SET index
Date Fri, 07 Aug 2009 14:50:25 GMT
Marshall Schor wrote:
> Thilo Goetz wrote:
>> I take that back.  find() works anyway.  The question with
>> moveTo(fs) is simply what the behavior should be in case
>> fs is not in the index.  If it is in the index, the cursor
>> will be positioned there, even for bag indexes.  If it's
>> not there, the cursor will currently be positioned at an
>> arbitrary point.  This is a left-over from the days when
>> bag indexes were also sorted and simply a bug, to my mind.
>> My intuition is that moveTo(fs) should make the iterator
>> invalid if fs is not in the index.
> +1 for having the iterator "invalid" if the fs is not in the index.
>> NB that the notion of equality here is FS identity.  Not
>> sure this is clear from the documentation.
> I'm not sure what FS identity means.  I thought that (for Set indexes)
> the comparison for equality was index-dependent, and used whatever keys
> were declared in the index.   Do you mean that the FS "address" in the
> heap must be the same (by FS identity), and does this test apply just
> for Bag indexes?

Yes, and yes.  I use equality for the equivalence relation
induced by the ordering relation on the index, and identity
when I mean "same address".  Even more confusingly, identity
is what FeatureStructure.equals() tests for :-).

Since bag indexes have no ordering relation, the only useful
notion of equality is identity, in the sense above.

> -Marshall
>> --Thilo

View raw message