Here you can find the source of shiftLeft(final Character orig, final int shiftDistance)
public static Character shiftLeft(final Character orig, final int shiftDistance)
//package com.java2s; //License from project: Open Source License public class Main { public static Character shiftLeft(final Character orig, final int shiftDistance) { return shiftCharacter(orig, shiftDistance, false); }/* w ww .jav a2s. c om*/ public static Character shiftCharacter(final Character orig, final int shiftDistance, final boolean shiftRight) { int actualShiftDistance = shiftDistance % 26; char shifted = orig; int singleMove = 1; if (!shiftRight) { singleMove = -1; } if (Character.isLetter(orig)) { for (int i = 0; i < actualShiftDistance; i++) { shifted += singleMove; if (!Character.isLetter(shifted)) { if (shiftRight) { shifted = (char) (shifted - 26); } else { shifted = (char) (shifted + 26); } } } } return shifted; } }