Indeed, though many forget it doesn't need to be hammering, the idea is to thoroughly cool the area, not create a non freezing cold injury(!)
Ice is normally applied to sprains/strains where as mentioned earlier it shouldn't be applied directly, I imagine it makes an adequate substitute though if running water is unavailable for whatever reason. I still find it slightly amazing that it took us 'till the 1940's to work out that cooling burns is a good thing mind you!