public boolean unpin( int frameNo ) throws InvalidFrameNumberException, PageUnpinnedException
  {
    if ((frameNo < 0) || (frameNo >= (int)mgr.getNumBuffers())) {
      
      throw new InvalidFrameNumberException (null, "BUFMGR: BAD_BUFFRAMENO.");
      
    }

    if ((mgr.frameTable())[frameNo].pin_count() == 0) {
  
      throw new PageUnpinnedException (null, "BUFMGR: PAGE_NOT_PINNED.");

    }

    (mgr.frameTable())[frameNo].unpin();

    if ((mgr.frameTable())[frameNo].pin_count() == 0)
        state_bit[frameNo].state = Referenced;
    return true;

  }