コード例 #1
0
 /// <summary>
 /// Removes an id.
 /// </summary>
 /// <param name="number"></param>
 private void NegativeRemove(long number)
 {
     if (number < LongIndexNode.CalculateBaseNumber((short)(_rootNegative.Base + 1)))
     {
         _rootNegative.Remove(number);
     }
 }
コード例 #2
0
 /// <summary>
 /// Returns true if the id is there.
 /// </summary>
 /// <param name="number"></param>
 /// <returns></returns>
 private bool NegativeContains(long number)
 {
     if (number < LongIndexNode.CalculateBaseNumber((short)(_rootNegative.Base + 1)))
     {
         return(_rootNegative.Contains(number));
     }
     return(false);
 }
コード例 #3
0
        /// <summary>
        /// Adds an id.
        /// </summary>
        /// <param name="number"></param>
        private void PositiveAdd(long number)
        {
            while (number >= LongIndexNode.CalculateBaseNumber((short)(_rootPositive.Base + 1)))
            {
                LongIndexNode oldRoot = _rootPositive;
                _rootPositive      = new LongIndexNode((short)(_rootPositive.Base + 1));
                _rootPositive.Has0 = oldRoot;
            }

            _rootPositive.Add(number);
        }