SetSize() 공개 정적인 메소드

Sets the size of the ArrayList. If the new size is greater than the current capacity, then new null items are added to the end of the ArrayList. If the new size is lower than the current size, then all elements after the new size are discarded
public static SetSize ( System arrayList, int newSize ) : void
arrayList System The ArrayList to be changed
newSize int The new ArrayList size
리턴 void
예제 #1
0
 /*
  * If both of the vectors are empty, get more data for them.
  */
 private void resetVectors()
 {
     // If we're done, no further checking needed
     if (completed)
     {
         return;
     }
     // Checks if we have run out of references
     if ((referenceIndex != 0) && (referenceIndex >= referenceCount))
     {
         SupportClass.SetSize(references, 0);
         referenceCount = 0;
         referenceIndex = 0;
     }
     // Checks if we have run out of entries
     if ((entryIndex != 0) && (entryIndex >= entryCount))
     {
         SupportClass.SetSize(entries, 0);
         entryCount = 0;
         entryIndex = 0;
     }
     // If no data at all, must reload enumeration
     if ((referenceIndex == 0) && (referenceCount == 0) && (entryIndex == 0) && (entryCount == 0))
     {
         completed = BatchOfResults;
     }
 }