If we define a figure of speech as figurative language, the poem includes metaphor and personification.
In Whitman's 1865 poem, Whitman metaphorically compares late president Abraham Lincoln to the "captain" of a "ship" that has weathered storms ("every rack") and battles, a metaphor for America during the Civil War. The poem's first stanza begins with the ship approaching port with the captain fallen dead on the deck. Since Lincoln was assassinated five days after the surrender at Appomattox, the ship is meant to metaphorically represent America heading home to its reunification after the many battles of the war, without its commander-in-chief.
In the third and final stanza, the ship has made it safely to port, but without its commanding officer alive to savor the moment of victory. Crowds gather to greet the ship, bells ring, wreaths and bouquets are offered, but even though the crowds call for the captain, he cannot hear them or share in their celebration, just as Lincoln was unable to greet the reunified nation he had steered through four years of war.
Using personification, Whitman's speaker walks with "mournful tread" because he cannot leave his beloved "captain." Still, he urges, "Exult, O shores," as he acknowledges that the country is entitled to celebrate the "victor ship" that brought the "object won"—the reunification of the country.