Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Creates a new longindex.
 /// </summary>
 public LongIndex()
 {
     _rootPositive = new LongIndexNode(1);
     _rootNegative = new LongIndexNode(1);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Clears this index.
 /// </summary>
 public void Clear()
 {
     _rootPositive = new LongIndexNode(1);
     _rootNegative = new LongIndexNode(1);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Clears this index.
 /// </summary>
 public void Clear()
 {
     _rootPositive = new LongIndexNode(1);
     _rootNegative = new LongIndexNode(1);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Creates a new longindex.
 /// </summary>
 public LongIndex()
 {
     _rootPositive = new LongIndexNode(1);
     _rootNegative = new LongIndexNode(1);
 }
Exemplo n.º 8
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);
        }