I don't really read Java, but the CARDINALS are just the numbers 1,2,3,4 each representing a direction. 1 is UP, 2 is RIGHT, 3 is DOWN, and 4 is LEFT. So adding 1 to a direction just gets you a different (possibly invalid) direction.
You probably just want to keep the direction the same during your loop as you search for the border. Bear in mind, this could lead to an infinite loop if you control a whole column or row of the map.