Source of 2.24.java


  1:         /** Removes one unspecified entry from this bag, if possible.
  2:        @return either the removed entry, if the removal was successful,
  3:                or null otherwise */
  4:         public T remove()
  5:         {
  6:                 checkIntegrity();
  7:       T result = null;
  8:                 
  9:                 if (numberOfEntries > 0))
 10:                 {
 11:          result = bag[numberOfEntries - 1];
 12:          bag[numberOfEntries - 1] = null;
 13:          numberOfEntries--;
 14:                 } // end if
 15:       
 16:       return result;
 17:         } // end remove