Android Question [B4X] B4XCollections: B4XSet, B4XOrderedMap

LucaMs

Expert
Licensed User
Longtime User
B4XSet

I was wondering what the differences were between B4XSet and List (and therefore the advantage of using B4XSet). I understand that the main difference is that in B4XSet you can't have duplicates, right? But List has a few more methods.



B4XOrderedMap

It would be useful to have a Search method (values, of course).
 

udg

Expert
Licensed User
Longtime User
From its definition:
B4XSet - A set is a collection of unique items. It is similar to a map where only the keys are used. Note that the order of items is preserved.
It could be useful for a collection of unique items (colors, users..) where ypou don't need a key/value pair

B4XBitSet - An efficient collection of bits. Similar to an array of booleans but requires less memory (approximately 1/8 of a similar sized array).
One of my favourites. It could be used to hold the status of "options" (set/unset), switches..anything defined by a a state having two possible values.
 
Last edited:
Upvote 0
Top