1: /** Removes one unspecified entry from this bag, if possible.
2: @return Either the removed entry, if the removal was successful,
3: or null */
4: public T remove()
5: {
6: T result = null;
7: if (firstNode != null)
8: {
9: result = firstNode.data;
10: firstNode = firstNode.next; // Remove first node from chain
11: numberOfEntries--;
12: } // end if
13:
14: return result;
15: } // end remove