[V4RB 0000631]: VBitSet and VArraySet cannot use Union, Difference, Intersection, etc.

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Apr 4 21:50:10 CDT 2005


On 4/4/05 9:36 PM, "Kem Tekinay" <ktekinay at mactechnologies.com> wrote:

>> I have told that Union() returns Vset.
>> 
>> This is very logical, because Union() works for both, VBitSet and VArraySet.
>> So we return the Vset class which is parent of both.
> 
> Ruslan,
> 
> We seem to be going around in a circle, so let me see if I can summarize
> this issue:
> 
> - Doing a Find (like fld.FindStartsWith) returns a VBitSet.
> 
> - Doing a Union with the results of that find (bs.Union(bs1)) returns a
> VSet.
> 
> - Once you have the VSet, you cannot convert it back to a VBitSet or a
> VArraySet.

No.
    you can cast it back to VBitSet.
        this is very simply operation. Actually ZERO TIME.

And you can CONVERT VBitSet into ArraySet.
    This is more complex operation.
    It require create new arraySet, then copy into it values from VBitSet.

> If I am wrong, please provide the code that searches one field, searches
> another field, combines the results of those searches (Union), and then
> returns the result as a VArraySet.

I have made this several times.
This is again, and I add here bitset3 varaible to split operations into
several lines.


   dim bitset1, bitset2, bitset3 as VBitSet
   dim set1 as VSet
   dim arrSet as VArraySet
 
   bitset1 = fld.FindStartsWith( something )
   bitset2 = fld.FindStartsWith( somethingElse )

   set1 = bitset1.Union( bitset2 )
   bitset3 = VBitSet( set1 )   // this line just do cast. ZERO TIME.

   arrSet = new VArraySet( bitset3 )    // this line convert bitset into
                                        // array set

> It seems to me that the problem is that Union returns VSet, an abstract
> class that we really shouldn't be using. Ideally it would return the same
> class as was used in the Union, or, at least, a VBitSet so we can convert
> that to a VArraySet if necessary.

I agree. It needs improve something here...

> I have already sent you a project illustrating this, but I will soon send
> another, better one.

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list