Java Utililty Methods Bit Shift

List of utility methods to do Bit Shift

Description

The list of methods to do Bit Shift are organized into topic(s).

Method

intshiftIdentifier(StringBuffer buffer, int posBegin, int posEnd)
Reads eventually the following identifier in the text.
int b = posBegin;
while (b < posEnd && Character.isWhitespace(buffer.charAt(b))) {
    b++;
if (b < posEnd && Character.isJavaIdentifierStart(buffer.charAt(b))) {
    int e = b + 1;
    while (e < posEnd && Character.isJavaIdentifierPart(buffer.charAt(e))) {
        e++;
...
intshiftKeyword(StringBuffer buffer, int posBegin, int posEnd, String keyword, boolean ignoreCase, boolean wholeWord)
Reads eventually the following text if the given keyword matches.
if (keyword == null || keyword.length() == 0) {
    return posBegin;
int b = posBegin;
while (b < posEnd && Character.isWhitespace(buffer.charAt(b))) {
    b++;
int result;
...
StringshiftLastAlphabets(String id)
shift last character.
if (id == null || "".equals(id) || id.length() <= 1)
    return id;
int firstNumberPosition = 0;
int lastNumberPosition = id.length() - 1;
while (firstNumberPosition < id.length() && Character.isLetter(id.charAt(firstNumberPosition)))
    firstNumberPosition++;
while (lastNumberPosition >= 0 && Character.isLetter(id.charAt(lastNumberPosition)))
    lastNumberPosition--;
...
charshiftLeft(char ch)
shift Left
switch (ch) {
case MAI_EK:
    return MAI_EK_LEFT_SHIFT;
case MAI_THO:
    return MAI_THO_LEFT_SHIFT;
case MAI_TRI:
    return MAI_TRI_LEFT_SHIFT;
case MAI_CHATTAWA:
...
CharactershiftLeft(final Character orig, final int shiftDistance)
shift Left
return shiftCharacter(orig, shiftDistance, false);
StringshiftPath(String uri)
shift Path
int pos = uri.indexOf('/', 1);
if (pos > 0) {
    uri = uri.substring(pos);
return uri;
intshiftsForNextPowerOfTwo(final int targetSize)
shifts For Next Power Of Two
int i;
for (i = 0; (1 << i) < targetSize; i++)
    ;
return i;
StringshiftText(final int pads, final String padding, String textPassed)
Shifts a multiline text to right the specified number of characters and the specified padding character
String text = textPassed;
if (pads < 0) {
    throw new Error("Cannot pad with negatives!");
String paddingString = "";
boolean newLineAtEnd = false;
for (int i = 0; i < pads; i++) {
    paddingString = paddingString + padding;
...
longshiftUpLeft(long b)
shift Up Left
return b << 7 & 0x7f7f7f7f7f7f7f7fL;