Tabnine Logo
Integer.rotateRight
Code IndexAdd Tabnine to your IDE (free)

How to use
rotateRight
method
in
java.lang.Integer

Best Java code snippets using java.lang.Integer.rotateRight (Showing top 20 results out of 315)

origin: MovingBlocks/Terasology

@Override
public int get(int src) {
  // RGBA becomes ARGBA by a simple rotation
  return Integer.rotateRight(src, Byte.SIZE);
}
origin: lealone/Lealone

private static int rot(int i, int count) {
  return Integer.rotateRight(i, count);
}
origin: stackoverflow.com

 int n = 0x55005500; // Binary 01010101000000000101010100000000
int k = 13;
System.err.printf("%08x%n", Integer.rotateRight(n, k));
origin: com.h2database/h2

private void decryptBlock(byte[] in, byte[] out, int off) {
  int x0 = Bits.readInt(in, off);
  int x1 = Bits.readInt(in, off + 4);
  int x2 = Bits.readInt(in, off + 8);
  int x3 = Bits.readInt(in, off + 12);
  int k = key;
  x1 = Integer.rotateRight(x1, x0) ^ k;
  x3 = Integer.rotateRight(x3, x0) ^ k;
  x0 = Integer.rotateRight(x0, x1) ^ k;
  x2 = Integer.rotateRight(x2, x1) ^ k;
  Bits.writeInt(out, off, x0);
  Bits.writeInt(out, off + 4, x1);
  Bits.writeInt(out, off + 8, x2);
  Bits.writeInt(out, off + 12, x3);
}
origin: org.eclipse.jgit/org.eclipse.jgit

{ c = rotateRight( c, 30);  a -= s4(b, c, d, e,w2[ 64]);}
{ d = rotateRight( d, 30);  b -= s4(c, d, e, a,w2[ 63]);}
{ e = rotateRight( e, 30);  c -= s4(d, e, a, b,w2[ 62]);}
{ a = rotateRight( a, 30);  d -= s4(e, a, b, c,w2[ 61]);}
{ b = rotateRight( b, 30);  e -= s4(a, b, c, d,w2[ 60]);}
{ c = rotateRight( c, 30);  a -= s3(b, c, d, e,w2[ 59]);}
{ d = rotateRight( d, 30);  b -= s3(c, d, e, a,w2[ 58]);}
{ e = rotateRight( e, 30);  c -= s3(d, e, a, b,w2[ 57]);}
{ a = rotateRight( a, 30);  d -= s3(e, a, b, c,w2[ 56]);}
{ b = rotateRight( b, 30);  e -= s3(a, b, c, d,w2[ 55]);}
{ c = rotateRight( c, 30);  a -= s3(b, c, d, e,w2[ 54]);}
{ d = rotateRight( d, 30);  b -= s3(c, d, e, a,w2[ 53]);}
{ e = rotateRight( e, 30);  c -= s3(d, e, a, b,w2[ 52]);}
{ a = rotateRight( a, 30);  d -= s3(e, a, b, c,w2[ 51]);}
{ b = rotateRight( b, 30);  e -= s3(a, b, c, d,w2[ 50]);}
{ c = rotateRight( c, 30);  a -= s3(b, c, d, e,w2[ 49]);}
{ d = rotateRight( d, 30);  b -= s3(c, d, e, a,w2[ 48]);}
{ e = rotateRight( e, 30);  c -= s3(d, e, a, b,w2[ 47]);}
{ a = rotateRight( a, 30);  d -= s3(e, a, b, c,w2[ 46]);}
{ b = rotateRight( b, 30);  e -= s3(a, b, c, d,w2[ 45]);}
{ c = rotateRight( c, 30);  a -= s3(b, c, d, e,w2[ 44]);}
{ d = rotateRight( d, 30);  b -= s3(c, d, e, a,w2[ 43]);}
{ e = rotateRight( e, 30);  c -= s3(d, e, a, b,w2[ 42]);}
{ a = rotateRight( a, 30);  d -= s3(e, a, b, c,w2[ 41]);}
{ b = rotateRight( b, 30);  e -= s3(a, b, c, d,w2[ 40]);}
{ c = rotateRight( c, 30);  a -= s2(b, c, d, e,w2[ 39]);}
origin: net.mikera/mikera

public int hashCode() {
  int result=0;
  for(int i=0; i<count; i++) {
    result^=data[i];
    result=Integer.rotateRight(result, 1);
  }
  return result;
}

origin: jpcsp/jpcsp

private int getScrambleDataSector(long fuseId, int partitionNumber) {
  if (partitionNumber == 3) {
    return 0x3C22812A;
  }
  int scramble = ((int) fuseId) ^ Integer.rotateRight((int) (fuseId >> 32), partitionNumber * 3);
  scramble ^= 0x556D81FE;
  if (scramble == 0) {
    scramble = Integer.rotateRight(0x556D81FE, partitionNumber);
  }
  return scramble;
}
origin: stackoverflow.com

 public static int encrypt(int value, byte key) {
 int result=value;
 for (int i=0; i<=(key&255); i++) {
  result=Integer.rotateRight(result,7)^(i+0xCAFEBABE);
 } 
 return result;
}
origin: net.mikera/mikera

public static <T> int hashCode(T[] data) {
  int result=0;
  for(int i=0; i<data.length; i++) {
    result^=data[i].hashCode();
    result=Integer.rotateRight(result, 1);
  }
  return result;
}

origin: stackoverflow.com

 public static <T> int hashCode(T[] data) {
  int result=0;
  for(int i=0; i<data.length; i++) {
    result^=data[i].hashCode();
    result=Integer.rotateRight(result, 1);
  }
  return result;
}
origin: stackoverflow.com

 public class Binary {

  public static void main(String[] args) {
    Integer i = 18;

    System.out.println(Integer.toBinaryString(i));
    i = Integer.rotateRight(i, 2);

    System.out.println(Integer.toBinaryString(i));
  }

}
origin: com.github.blasd.apex/apex-java

public static final int positiveUnpack2(long packed) {
  // Move the higher bit as lower bit: if packed >= 0, we then are sure to have a 0 as first bit
  // Then, this 0 bit it put back as last bit: the integer is guaranteed to be positive
  return Integer.rotateRight((int) (Long.rotateLeft(packed, 1) & MASK), 1);
}
origin: net.mikera/mikera

public static<T> int hashCode(Iterator<T> data) {
  int result=0;
  
  while(data.hasNext()) {
    result^=hashCodeWithNulls(data.next());
    result=Integer.rotateRight(result, 1);
  }
  return result;
}

origin: com.github.cormoran-io.pepper/pepper

public static final int positiveUnpack2(long packed) {
  // Move the higher bit as lower bit: if packed >= 0, we then are sure to have a
  // 0 as first bit
  // Then, this 0 bit it put back as last bit: the integer is guaranteed to be
  // positive
  return Integer.rotateRight((int) (Long.rotateLeft(packed, 1) & MASK), 1);
}
origin: net.imagej/ij

/** Returns a hashcode for this Roi that typically changes 
  if it is moved, even though it is still the same object. */
public int getHashCode() {
  return hashCode() ^ (new Double(getXBase()).hashCode()) ^
    Integer.rotateRight(new Double(getYBase()).hashCode(),16);
}

origin: jtransc/jtransc

static private void testBitsOps() {
  System.out.println("testBitsOps:");
  System.out.println("Integer.bitCount:" + Integer.bitCount(0x12345678));
  System.out.println("Integer.reverse:" + Integer.reverse(0x12345678));
  System.out.println("Integer.reverse:" + Integer.reverse(0xF2345678));
  System.out.println("Integer.reverseBytes:" + Integer.reverseBytes(0x12345678));
  System.out.println("Integer.reverseBytes:" + Integer.reverseBytes(0xF2345678));
  System.out.println("Integer.rotateLeft:" + Integer.rotateLeft(0x12345678, 13));
  System.out.println("Integer.rotateRight:" + Integer.rotateRight(0xF2345678, 27));
  System.out.println("Short.reverseBytes:" + Short.reverseBytes((short) 0x1234));
  System.out.println("Short.reverseBytes:" + Short.reverseBytes((short) 0xF234));
}
origin: jpcsp/jpcsp

public final void doWSBH(int rd, int rt) {
  if (rd != 0) {
    setRegister(rd, Integer.rotateRight(Integer.reverseBytes(getRegister(rt)), 16));
  }
}
origin: net.mikera/mikera

public int hashCode() {
  if (blocks.length==0) return 0;
  int r=blocks[0].hashCode();
  for (int i=1; i<blocks.length; i++) {
    r=Integer.rotateRight(r,blocks[i].size());
    r^=blocks[i].hashCode();
  }
  return r;
}

origin: jpcsp/jpcsp

public final void doROTRV(int rd, int rt, int rs) {
  if (rd != 0) {
    // no need of "getRegister(rs) & 31", rotateRight does it for us
    setRegister(rd, Integer.rotateRight(getRegister(rt), getRegister(rs)));
  }
}
origin: net.mikera/mikera

  public int hashCode() {
    int r= Integer.rotateRight(front.hashCode(),back.size());
    r^=back.hashCode();
    return r;
  }
}
java.langIntegerrotateRight

Javadoc

Rotates the bits of the specified integer to the right by the specified number of bits.

Popular methods of Integer

  • parseInt
    Parses the specified string as a signed integer value using the specified radix. The ASCII character
  • toString
    Converts the specified signed integer into a string representation based on the specified radix. The
  • valueOf
    Parses the specified string as a signed integer value using the specified radix.
  • intValue
    Gets the primitive value of this int.
  • <init>
    Constructs a new Integer from the specified string.
  • toHexString
    Returns a string representation of the integer argument as an unsigned integer in base 16.The unsign
  • equals
    Compares this instance with the specified object and indicates if they are equal. In order to be equ
  • compareTo
    Compares this Integer object to another object. If the object is an Integer, this function behaves l
  • hashCode
  • compare
    Compares two int values.
  • longValue
    Returns the value of this Integer as along.
  • decode
    Parses the specified string and returns a Integer instance if the string can be decoded into an inte
  • longValue,
  • decode,
  • numberOfLeadingZeros,
  • getInteger,
  • doubleValue,
  • toBinaryString,
  • byteValue,
  • bitCount,
  • shortValue,
  • highestOneBit

Popular in Java

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • onCreateOptionsMenu (Activity)
  • addToBackStack (FragmentTransaction)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Notification (javax.management)
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now