BitsetsNET.RoaringBitset.Get C# (CSharp) Method

Get() public method

Return whether the given index is a member of this set
public Get ( int index ) : bool
index int the index to test
return bool
        public bool Get(int index)
        {
            ushort highBits = Utility.GetHighBits(index);
            int containerIndex = containers.GetIndex(highBits);

            // a container exists at this index already.
            // find the right container, get the low order bits to add to the
            // container and add them
            if (containerIndex >= 0)
            {
                return containers.GetContainerAtIndex(containerIndex)
                                 .Contains(Utility.GetLowBits(index));
            }
            else
            {
                // no container exists for this index
                return false;
            }
        }