コード例 #1
0
 public bool addIndex(int data)
 {
     if (!full())
     {
         index[indexPointer] = data;
         indexPointer++;
         if (indexPointer == 100)
         {
             primaryIndex = new PrimaryIndex();
         }
     }
     else if (!primaryIndex.full())
     {
         primaryIndex.addIndex(data);
         if (primaryIndex.full())
         {
             secondaryIndex = new SecondaryIndex();
         }
     }
     else if (!secondaryIndex.full())
     {
         secondaryIndex.addIndex(data);
     }
     else
     {
         return(false);
     }
     return(true);
 }
コード例 #2
0
        public void addIndex(int data)
        {
            PrimaryIndex temp = index[indexPointer];

            if (temp.full())
            {
                index.Add(new PrimaryIndex());
                indexPointer++;
                temp = index[indexPointer];
            }
            temp.addIndex(data);
            indexPointer++;
        }