I've always found the Sword to be a better weapon no matter what situation purely because of it's consistency. You either get a kill, or you don't, and once you've mastered it's range, gotten accustomed to it's lunge time, etc. it can become a beast. The Hammer, however, is highly inconsistent. You could seemingly hammer someone and get a kill that sends their limp body flying across the map, but you can repeat it at what appears to be the same range and simply graze the opposing player's shields yet also sending them farther, out of range for you to hit without switching weapons, giving them enough time to kill you first.
As for clearing out swarms, a Sword has always been more useful to me due to it's speed and range. It's lunge, the basic 1-hit kill melee, combined together allows a good swordsman to cut his way through any encounter he gets himself into. The gravity hammer lacks the range and consistency to clear out anything other than people who have run up to you to literally pummel you (which is rare when they've got strenght in numbers, AND when they see you holding a CQC Power weapon), it also takes a bit longer than the sword to get a second strike in, and it doesn't have a 1-hit kill melee that also has speed on it's side.
Unless I'm trying to play baseball with rockets and grenades, the sword is always the better weapon in my opinion, especially when the user has completely mastered the ins and outs of that piercing blue blade.