Beispiel #1
0
 public void Add(long number)
 {
     switch (this.CalculateDigit(number))
     {
         case 0:
             if (this.has_0 == null)
             {
                 this.has_0 = LongIndexNode.CreateForBase((short)(this.Base - 1));
             }
             this.has_0.Add(number);
             break;
         case 1:
             if (this.has_1 == null)
             {
                 this.has_1 = LongIndexNode.CreateForBase((short)(this.Base - 1));
             }
             this.has_1.Add(number);
             break;
         case 2:
             if (this.has_2 == null)
             {
                 this.has_2 = LongIndexNode.CreateForBase((short)(this.Base - 1));
             }
             this.has_2.Add(number);
             break;
         case 3:
             if (this.has_3 == null)
             {
                 this.has_3 = LongIndexNode.CreateForBase((short)(this.Base - 1));
             }
             this.has_3.Add(number);
             break;
         case 4:
             if (this.has_4 == null)
             {
                 this.has_4 = LongIndexNode.CreateForBase((short)(this.Base - 1));
             }
             this.has_4.Add(number);
             break;
         case 5:
             if (this.has_5 == null)
             {
                 this.has_5 = LongIndexNode.CreateForBase((short)(this.Base - 1));
             }
             this.has_5.Add(number);
             break;
         case 6:
             if (this.has_6 == null)
             {
                 this.has_6 = LongIndexNode.CreateForBase((short)(this.Base - 1));
             }
             this.has_6.Add(number);
             break;
         case 7:
             if (this.has_7 == null)
             {
                 this.has_7 = LongIndexNode.CreateForBase((short)(this.Base - 1));
             }
             this.has_7.Add(number);
             break;
         case 8:
             if (this.has_8 == null)
             {
                 this.has_8 = LongIndexNode.CreateForBase((short)(this.Base - 1));
             }
             this.has_8.Add(number);
             break;
         case 9:
             if (this.has_9 == null)
             {
                 this.has_9 = LongIndexNode.CreateForBase((short)(this.Base - 1));
             }
             this.has_9.Add(number);
             break;
         default:
             throw new ArgumentOutOfRangeException();
     }
 }
 public void Add(long number)
 {
     switch (this.CalculateDigit(number))
     {
         case 0:
             if (this.Has0 == null)
             {
                 this.Has0 = LongIndexNode.CreateForBase((short)(this.Base - 1));
             }
             this.Has0.Add(number);
             break;
         case 1:
             if (this.Has1 == null)
             {
                 this.Has1 = LongIndexNode.CreateForBase((short)(this.Base - 1));
             }
             this.Has1.Add(number);
             break;
         case 2:
             if (this.Has2 == null)
             {
                 this.Has2 = LongIndexNode.CreateForBase((short)(this.Base - 1));
             }
             this.Has2.Add(number);
             break;
         case 3:
             if (this.Has3 == null)
             {
                 this.Has3 = LongIndexNode.CreateForBase((short)(this.Base - 1));
             }
             this.Has3.Add(number);
             break;
         case 4:
             if (this.Has4 == null)
             {
                 this.Has4 = LongIndexNode.CreateForBase((short)(this.Base - 1));
             }
             this.Has4.Add(number);
             break;
         case 5:
             if (this.Has5 == null)
             {
                 this.Has5 = LongIndexNode.CreateForBase((short)(this.Base - 1));
             }
             this.Has5.Add(number);
             break;
         case 6:
             if (this.Has6 == null)
             {
                 this.Has6 = LongIndexNode.CreateForBase((short)(this.Base - 1));
             }
             this.Has6.Add(number);
             break;
         case 7:
             if (this.Has7 == null)
             {
                 this.Has7 = LongIndexNode.CreateForBase((short)(this.Base - 1));
             }
             this.Has7.Add(number);
             break;
         case 8:
             if (this.Has8 == null)
             {
                 this.Has8 = LongIndexNode.CreateForBase((short)(this.Base - 1));
             }
             this.Has8.Add(number);
             break;
         case 9:
             if (this.Has9 == null)
             {
                 this.Has9 = LongIndexNode.CreateForBase((short)(this.Base - 1));
             }
             this.Has9.Add(number);
             break;
         default:
             throw new ArgumentOutOfRangeException();
     }
 }
Beispiel #3
0
        public void Add(long number)
        {
            switch (this.CalculateDigit(number))
            {
            case 0:
                if (this.Has0 == null)
                {
                    this.Has0 = LongIndexNode.CreateForBase((short)(this.Base - 1));
                }
                this.Has0.Add(number);
                break;

            case 1:
                if (this.Has1 == null)
                {
                    this.Has1 = LongIndexNode.CreateForBase((short)(this.Base - 1));
                }
                this.Has1.Add(number);
                break;

            case 2:
                if (this.Has2 == null)
                {
                    this.Has2 = LongIndexNode.CreateForBase((short)(this.Base - 1));
                }
                this.Has2.Add(number);
                break;

            case 3:
                if (this.Has3 == null)
                {
                    this.Has3 = LongIndexNode.CreateForBase((short)(this.Base - 1));
                }
                this.Has3.Add(number);
                break;

            case 4:
                if (this.Has4 == null)
                {
                    this.Has4 = LongIndexNode.CreateForBase((short)(this.Base - 1));
                }
                this.Has4.Add(number);
                break;

            case 5:
                if (this.Has5 == null)
                {
                    this.Has5 = LongIndexNode.CreateForBase((short)(this.Base - 1));
                }
                this.Has5.Add(number);
                break;

            case 6:
                if (this.Has6 == null)
                {
                    this.Has6 = LongIndexNode.CreateForBase((short)(this.Base - 1));
                }
                this.Has6.Add(number);
                break;

            case 7:
                if (this.Has7 == null)
                {
                    this.Has7 = LongIndexNode.CreateForBase((short)(this.Base - 1));
                }
                this.Has7.Add(number);
                break;

            case 8:
                if (this.Has8 == null)
                {
                    this.Has8 = LongIndexNode.CreateForBase((short)(this.Base - 1));
                }
                this.Has8.Add(number);
                break;

            case 9:
                if (this.Has9 == null)
                {
                    this.Has9 = LongIndexNode.CreateForBase((short)(this.Base - 1));
                }
                this.Has9.Add(number);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }