Switch to: V10V9V8V7V6V5

VArraySet Class


ArraySet is a subclass of VSet class. It implements a Set of records as an array of RecID values.

For example, if a set contains 10 records the 4 * 10 = 40 bytes of RAM will be used. If there are 10,000 records then 40Kb will be used.

Why do we need ArraySet? Why is a BitSet class not enough ?

1) The first and the main reason is that BitSet (i.e. a bitmap) cannot keep the sorted selection. Really, selection {1,3,5} and {3,5,1} will look the same as bitmap - {10101}.

  • To be more exact, a bitmap has one and only one sort order - the physical order of logical records in the Table.

Because of that, when you work with few Table Fields you should use BitSet to perform such set operations as Intersect, Union. But when you need to sort a selection, you need ArraySet class.

Although ArraySet class also has methods to perform set operations, they are slower than the methods of BitSet in general case.

2) The second reason is that BitSet does not allow random access to a Nth record of selection. BitSet has only sequential iteration.



Construction Methods

Element Methods

Set Operation Methods