Source of 12.12.java


  1: // @author Frank M. Carrano, Timothy M. Henry
  2: // @version 5.0
  3: public boolean isEmpty()
  4: {
  5:    boolean result;
  6:       
  7:    if (numberOfEntries == 0) // Or getLength() == 0
  8:    {
  9:       // Assertion: firstNode == null
 10:       result = true;
 11:    }
 12:    else
 13:    {
 14:       // Assertion: firstNode != null
 15:       result = false;
 16:    } // end if
 17:       
 18:    return result;
 19: } // end isEmpty