The way to do this would be through an enum, similar to the way you would style days of the week. They're in a loop of some sort, and you can map the associated chars with the enum options.
public enum CardinalPosition {
NORTH('N'), EAST('E'), SOUTH('S'), WEST('W)
private CardinalPosition left;
private CardinalPosition right;
// here you set each left and right per enum value
private void setupRight() {
NORTH.right = CardinalPosition.EAST;
...
WEST.right = CardinalPosition.NORTH;
}
private void setupLeft() {
EAST.left = CardinalPosition.NORTH;
...
NORTH.left = CardinalPosition.WEST;
}
// so the rotateLeft and rotateRight would just return the left and right values of the given CardinalPosition
}